Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 3.4k
HBASE-23281: Track meta region locations in masters#830
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
ndimiduk
merged 10 commits into
apache:HBASE-18095/client-locate-meta-no-zookeeper
from
bharathv:HBASE-23281Dec 4, 2019
Uh oh!
There was an error while loading. Please reload this page.
Merged
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
e57b806
HBASE-23281: Track meta region locations in masters
bharathv ad53427
Fix checkstyle and findbugs issues and review comments.
bharathv d318470
[checkstyle] Remove some more unusued imports
bharathv f5b6b48
Address Nick's comments.
bharathv ac5cc62
Address Nick's comments - Part 2.
bharathv 7b93a4a
[checkstyle] Remove unused imports
bharathv dc2912a
Gracefully handle InterruptedException.
bharathv 871b749
Rename populateInitMetaLocations to something more meaningful.
bharathv bec6c47
Better handling of InterruptedException and async init of cache.
bharathv ef7c0f0
Address comments from Nick
bharathv File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Uh oh!
There was an error while loading. Please reload this page.
Jump to
Jump to file
Failed to load files.
Loading
Uh oh!
There was an error while loading. Please reload this page.
Diff view
Diff view
There are no files selected for viewing
42 changes: 41 additions & 1 deletion
42 hbase-client/src/main/java/org/apache/hadoop/hbase/shaded/protobuf/ProtobufUtil.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,4 @@ | ||
| /** | ||
| /* | ||
| * Licensed to the Apache Software Foundation (ASF) under one | ||
| * or more contributor license agreements. See the NOTICE file | ||
| * distributed with this work for additional information | ||
| @@ -80,6 +80,7 @@ | ||
| import org.apache.hadoop.hbase.client.Put; | ||
| import org.apache.hadoop.hbase.client.RegionInfoBuilder; | ||
| import org.apache.hadoop.hbase.client.RegionLoadStats; | ||
| import org.apache.hadoop.hbase.client.RegionReplicaUtil; | ||
| import org.apache.hadoop.hbase.client.RegionStatesCount; | ||
| import org.apache.hadoop.hbase.client.Result; | ||
| import org.apache.hadoop.hbase.client.Scan; | ||
| @@ -93,6 +94,7 @@ | ||
| import org.apache.hadoop.hbase.filter.ByteArrayComparable; | ||
| import org.apache.hadoop.hbase.filter.Filter; | ||
| import org.apache.hadoop.hbase.io.TimeRange; | ||
| import org.apache.hadoop.hbase.master.RegionState; | ||
| import org.apache.hadoop.hbase.protobuf.ProtobufMagic; | ||
| import org.apache.hadoop.hbase.protobuf.ProtobufMessageConverter; | ||
| import org.apache.hadoop.hbase.quotas.QuotaScope; | ||
| @@ -3051,6 +3053,44 @@ public static ProcedureDescription buildProcedureDescription(String signature, S | ||
| return builder.build(); | ||
| } | ||
| /** | ||
| * Get the Meta region state from the passed data bytes. Can handle both old and new style | ||
| * server names. | ||
| * @param data protobuf serialized data with meta server name. | ||
| * @param replicaId replica ID for this region | ||
| * @return RegionState instance corresponding to the serialized data. | ||
| * @throws DeserializationException if the data is invalid. | ||
| */ | ||
| public static RegionState parseMetaRegionStateFrom(final byte[] data, int replicaId) | ||
bharathv marked this conversation as resolved.
Uh oh!There was an error while loading. Please reload this page. | ||
| throws DeserializationException { | ||
| RegionState.State state = RegionState.State.OPEN; | ||
| ServerName serverName; | ||
| if (data != null && data.length > 0 && ProtobufUtil.isPBMagicPrefix(data)) { | ||
| try { | ||
| int prefixLen = ProtobufUtil.lengthOfPBMagic(); | ||
| ZooKeeperProtos.MetaRegionServer rl = | ||
| ZooKeeperProtos.MetaRegionServer.parser().parseFrom(data, prefixLen, | ||
| data.length - prefixLen); | ||
| if (rl.hasState()) { | ||
| state = RegionState.State.convert(rl.getState()); | ||
| } | ||
| HBaseProtos.ServerName sn = rl.getServer(); | ||
| serverName = ServerName.valueOf( | ||
| sn.getHostName(), sn.getPort(), sn.getStartCode()); | ||
| } catch (InvalidProtocolBufferException e) { | ||
| throw new DeserializationException("Unable to parse meta region location"); | ||
| } | ||
| } else { | ||
| // old style of meta region location? | ||
| serverName = parseServerNameFrom(data); | ||
| } | ||
| if (serverName == null) { | ||
| state = RegionState.State.OFFLINE; | ||
bharathv marked this conversation as resolved.
Uh oh!There was an error while loading. Please reload this page. | ||
| } | ||
| return new RegionState(RegionReplicaUtil.getRegionInfoForReplica( | ||
| RegionInfoBuilder.FIRST_META_REGIONINFO, replicaId), state, serverName); | ||
| } | ||
| /** | ||
| * Get a ServerName from the passed in data bytes. | ||
| * @param data Data with a serialize server name in it; can handle the old style | ||
19 changes: 16 additions & 3 deletions
19 hbase-client/src/main/java/org/apache/hadoop/hbase/zookeeper/ZNodePaths.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
18 changes: 14 additions & 4 deletions
18 hbase-server/src/main/java/org/apache/hadoop/hbase/master/HMaster.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.