[1/2] hbase git commit: HBASE-16058 TestHRegion fails on 1.4 builds
Repository: hbase Updated Branches: refs/heads/branch-1 e721aa1a8 -> 1a989a196 refs/heads/master bdb0cc880 -> 6717f0e38 HBASE-16058 TestHRegion fails on 1.4 builds Project: http://git-wip-us.apache.org/repos/asf/hbase/repo Commit: http://git-wip-us.apache.org/repos/asf/hbase/commit/6717f0e3 Tree: http://git-wip-us.apache.org/repos/asf/hbase/tree/6717f0e3 Diff: http://git-wip-us.apache.org/repos/asf/hbase/diff/6717f0e3 Branch: refs/heads/master Commit: 6717f0e3883577513fef8c6cb8a2d0f4b4f41433 Parents: bdb0cc8 Author: Enis SoztutarAuthored: Fri Jun 17 18:41:51 2016 -0700 Committer: Enis Soztutar Committed: Fri Jun 17 18:41:51 2016 -0700 -- .../apache/hadoop/hbase/regionserver/TestHRegion.java| 11 +++ 1 file changed, 7 insertions(+), 4 deletions(-) -- http://git-wip-us.apache.org/repos/asf/hbase/blob/6717f0e3/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestHRegion.java -- diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestHRegion.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestHRegion.java index 93074e1..9aa3a9b 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestHRegion.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestHRegion.java @@ -130,6 +130,7 @@ import org.apache.hadoop.hbase.test.MetricsAssertHelper; import org.apache.hadoop.hbase.testclassification.LargeTests; import org.apache.hadoop.hbase.testclassification.VerySlowRegionServerTests; import org.apache.hadoop.hbase.util.Bytes; +import org.apache.hadoop.hbase.util.ClassSize; import org.apache.hadoop.hbase.util.EnvironmentEdgeManager; import org.apache.hadoop.hbase.util.EnvironmentEdgeManagerTestHelper; import org.apache.hadoop.hbase.util.FSUtils; @@ -452,8 +453,9 @@ public class TestHRegion { fail("Should have failed with IOException"); } catch (IOException expected) { } -assertEquals("memstoreSize should be incremented", onePutSize * 2, region.getMemstoreSize()); -assertEquals("flushable size should be incremented", onePutSize * 2, store.getFlushableSize()); +long expectedSize = onePutSize * 2 - ClassSize.ARRAY; +assertEquals("memstoreSize should be incremented", expectedSize, region.getMemstoreSize()); +assertEquals("flushable size should be incremented", expectedSize, store.getFlushableSize()); region.setCoprocessorHost(null); HBaseTestingUtility.closeRegionAndWAL(region); @@ -523,13 +525,14 @@ public class TestHRegion { p2.add(new KeyValue(row, COLUMN_FAMILY_BYTES, qual2, 2, (byte[])null)); p2.add(new KeyValue(row, COLUMN_FAMILY_BYTES, qual3, 3, (byte[])null)); region.put(p2); - Assert.assertEquals(sizeOfOnePut * 3, region.getMemstoreSize()); + long expectedSize = sizeOfOnePut * 3- ClassSize.ARRAY; + Assert.assertEquals(expectedSize, region.getMemstoreSize()); // Do a successful flush. It will clear the snapshot only. Thats how flushes work. // If already a snapshot, we clear it else we move the memstore to be snapshot and flush // it region.flush(true); // Make sure our memory accounting is right. - Assert.assertEquals(sizeOfOnePut * 2, region.getMemstoreSize()); + Assert.assertEquals(sizeOfOnePut * 2 - ClassSize.ARRAY, region.getMemstoreSize()); } finally { HBaseTestingUtility.closeRegionAndWAL(region); }
[2/2] hbase git commit: HBASE-16058 TestHRegion fails on 1.4 builds
HBASE-16058 TestHRegion fails on 1.4 builds Conflicts: hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestHRegion.java Project: http://git-wip-us.apache.org/repos/asf/hbase/repo Commit: http://git-wip-us.apache.org/repos/asf/hbase/commit/1a989a19 Tree: http://git-wip-us.apache.org/repos/asf/hbase/tree/1a989a19 Diff: http://git-wip-us.apache.org/repos/asf/hbase/diff/1a989a19 Branch: refs/heads/branch-1 Commit: 1a989a1964e8bc5af3bb1c48f41da9dd06bd1257 Parents: e721aa1 Author: Enis SoztutarAuthored: Fri Jun 17 18:41:51 2016 -0700 Committer: Enis Soztutar Committed: Fri Jun 17 19:00:01 2016 -0700 -- .../apache/hadoop/hbase/regionserver/TestHRegion.java| 11 +++ 1 file changed, 7 insertions(+), 4 deletions(-) -- http://git-wip-us.apache.org/repos/asf/hbase/blob/1a989a19/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestHRegion.java -- diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestHRegion.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestHRegion.java index 4d9c6bd..33226e0 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestHRegion.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestHRegion.java @@ -149,6 +149,7 @@ import org.apache.hadoop.hbase.security.User; import org.apache.hadoop.hbase.test.MetricsAssertHelper; import org.apache.hadoop.hbase.testclassification.MediumTests; import org.apache.hadoop.hbase.util.Bytes; +import org.apache.hadoop.hbase.util.ClassSize; import org.apache.hadoop.hbase.util.EnvironmentEdgeManager; import org.apache.hadoop.hbase.util.EnvironmentEdgeManagerTestHelper; import org.apache.hadoop.hbase.util.FSUtils; @@ -431,8 +432,9 @@ public class TestHRegion { fail("Should have failed with IOException"); } catch (IOException expected) { } -assertEquals("memstoreSize should be incremented", onePutSize * 2, region.getMemstoreSize()); -assertEquals("flushable size should be incremented", onePutSize * 2, store.getFlushableSize()); +long expectedSize = onePutSize * 2 - ClassSize.ARRAY; +assertEquals("memstoreSize should be incremented", expectedSize, region.getMemstoreSize()); +assertEquals("flushable size should be incremented", expectedSize, store.getFlushableSize()); region.setCoprocessorHost(null); HBaseTestingUtility.closeRegionAndWAL(region); @@ -508,13 +510,14 @@ public class TestHRegion { p2.add(new KeyValue(row, COLUMN_FAMILY_BYTES, qual2, 2, (byte[])null)); p2.add(new KeyValue(row, COLUMN_FAMILY_BYTES, qual3, 3, (byte[])null)); region.put(p2); - Assert.assertEquals(sizeOfOnePut * 3, region.getMemstoreSize()); + long expectedSize = sizeOfOnePut * 3- ClassSize.ARRAY; + Assert.assertEquals(expectedSize, region.getMemstoreSize()); // Do a successful flush. It will clear the snapshot only. Thats how flushes work. // If already a snapshot, we clear it else we move the memstore to be snapshot and flush // it region.flush(true); // Make sure our memory accounting is right. - Assert.assertEquals(sizeOfOnePut * 2, region.getMemstoreSize()); + Assert.assertEquals(sizeOfOnePut * 2 - ClassSize.ARRAY, region.getMemstoreSize()); } catch (Exception e) { int x = 0; } finally {
[2/2] hbase git commit: HBASE-15467 Remove 1.x/2.0 TableDescriptor incompatibility
HBASE-15467 Remove 1.x/2.0 TableDescriptor incompatibility Project: http://git-wip-us.apache.org/repos/asf/hbase/repo Commit: http://git-wip-us.apache.org/repos/asf/hbase/commit/bdb0cc88 Tree: http://git-wip-us.apache.org/repos/asf/hbase/tree/bdb0cc88 Diff: http://git-wip-us.apache.org/repos/asf/hbase/diff/bdb0cc88 Branch: refs/heads/master Commit: bdb0cc8808af7c3d08af4a506f34b8341726b58e Parents: 65a8d77 Author: Enis SoztutarAuthored: Fri Jun 17 17:16:57 2016 -0700 Committer: Enis Soztutar Committed: Fri Jun 17 17:25:04 2016 -0700 -- .../apache/hadoop/hbase/HTableDescriptor.java | 44 -- .../hbase/protobuf/generated/HBaseProtos.java | 731 ++- hbase-protocol/src/main/protobuf/HBase.proto| 5 - .../apache/hadoop/hbase/TableDescriptor.java| 165 - .../apache/hadoop/hbase/TableDescriptors.java | 20 +- .../org/apache/hadoop/hbase/master/HMaster.java | 11 +- .../hadoop/hbase/master/MasterFileSystem.java | 4 +- .../hadoop/hbase/master/TableStateManager.java | 6 +- .../procedure/CloneSnapshotProcedure.java | 3 +- .../master/procedure/CreateTableProcedure.java | 4 +- .../procedure/TruncateTableProcedure.java | 2 +- .../hbase/regionserver/CompactionTool.java | 13 +- .../hadoop/hbase/snapshot/SnapshotManifest.java | 7 +- .../hadoop/hbase/util/FSTableDescriptors.java | 231 ++ .../org/apache/hadoop/hbase/util/HBaseFsck.java | 9 +- .../org/apache/hadoop/hbase/util/HMerge.java| 3 +- .../org/apache/hadoop/hbase/util/Merge.java | 5 +- .../TestHColumnDescriptorDefaultVersions.java | 6 +- .../hadoop/hbase/TestTableDescriptor.java | 55 -- .../hadoop/hbase/master/TestCatalogJanitor.java | 29 +- .../MasterProcedureTestingUtility.java | 19 +- ...stTableDescriptorModificationFromClient.java | 5 +- .../hbase/regionserver/TestDefaultMemStore.java | 5 +- .../TestRegionMergeTransactionOnCluster.java| 2 - .../hbase/snapshot/SnapshotTestingUtils.java| 7 +- .../hbase/util/TestFSTableDescriptors.java | 61 +- .../apache/hadoop/hbase/util/TestMergeTool.java | 6 +- 27 files changed, 237 insertions(+), 1221 deletions(-) -- http://git-wip-us.apache.org/repos/asf/hbase/blob/bdb0cc88/hbase-client/src/main/java/org/apache/hadoop/hbase/HTableDescriptor.java -- diff --git a/hbase-client/src/main/java/org/apache/hadoop/hbase/HTableDescriptor.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/HTableDescriptor.java index 4283330..13f1bd9 100644 --- a/hbase-client/src/main/java/org/apache/hadoop/hbase/HTableDescriptor.java +++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/HTableDescriptor.java @@ -42,7 +42,6 @@ import org.apache.hadoop.hbase.client.RegionReplicaUtil; import org.apache.hadoop.hbase.exceptions.DeserializationException; import org.apache.hadoop.hbase.protobuf.ProtobufUtil; import org.apache.hadoop.hbase.protobuf.generated.HBaseProtos.TableSchema; -import org.apache.hadoop.hbase.regionserver.BloomType; import org.apache.hadoop.hbase.security.User; import org.apache.hadoop.hbase.util.Bytes; @@ -1422,49 +1421,6 @@ public class HTableDescriptor implements Comparable { new Path(name.getNamespaceAsString(), new Path(name.getQualifierAsString(); } - /** Table descriptor for hbase:meta catalog table - * Deprecated, use TableDescriptors#get(TableName.META_TABLE) or - * Admin#getTableDescriptor(TableName.META_TABLE) instead. - */ - @Deprecated - public static final HTableDescriptor META_TABLEDESC = new HTableDescriptor( - TableName.META_TABLE_NAME, - new HColumnDescriptor[] { - new HColumnDescriptor(HConstants.CATALOG_FAMILY) - // Ten is arbitrary number. Keep versions to help debugging. - .setMaxVersions(10) - .setInMemory(true) - .setBlocksize(8 * 1024) - .setScope(HConstants.REPLICATION_SCOPE_LOCAL) - // Disable blooms for meta. Needs work. Seems to mess w/ getClosestOrBefore. - .setBloomFilterType(BloomType.NONE) - // Enable cache of data blocks in L1 if more than one caching tier deployed: - // e.g. if using CombinedBlockCache (BucketCache). - .setCacheDataInL1(true), - new HColumnDescriptor(HConstants.TABLE_FAMILY) - // Ten is arbitrary number. Keep versions to help debugging. - .setMaxVersions(10) - .setInMemory(true) - .setBlocksize(8 * 1024) - .setScope(HConstants.REPLICATION_SCOPE_LOCAL) - // Disable blooms for meta. Needs work. Seems to mess w/ getClosestOrBefore. - .setBloomFilterType(BloomType.NONE) -
[1/2] hbase git commit: HBASE-15467 Remove 1.x/2.0 TableDescriptor incompatibility
Repository: hbase Updated Branches: refs/heads/master 65a8d7743 -> bdb0cc880 http://git-wip-us.apache.org/repos/asf/hbase/blob/bdb0cc88/hbase-server/src/main/java/org/apache/hadoop/hbase/util/FSTableDescriptors.java -- diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/util/FSTableDescriptors.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/util/FSTableDescriptors.java index 18156cb..d0aeb6c 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/util/FSTableDescriptors.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/util/FSTableDescriptors.java @@ -40,15 +40,16 @@ import org.apache.hadoop.fs.FileStatus; import org.apache.hadoop.fs.FileSystem; import org.apache.hadoop.fs.Path; import org.apache.hadoop.fs.PathFilter; +import org.apache.hadoop.hbase.Coprocessor; +import org.apache.hadoop.hbase.HColumnDescriptor; import org.apache.hadoop.hbase.HConstants; import org.apache.hadoop.hbase.HTableDescriptor; -import org.apache.hadoop.hbase.TableDescriptor; import org.apache.hadoop.hbase.TableDescriptors; import org.apache.hadoop.hbase.TableInfoMissingException; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.classification.InterfaceAudience; import org.apache.hadoop.hbase.exceptions.DeserializationException; -import org.apache.hadoop.hbase.protobuf.ProtobufUtil; +import org.apache.hadoop.hbase.regionserver.BloomType; /** * Implementation of {@link TableDescriptors} that reads descriptors from the @@ -88,13 +89,13 @@ public class FSTableDescriptors implements TableDescriptors { // This cache does not age out the old stuff. Thinking is that the amount // of data we keep up in here is so small, no need to do occasional purge. // TODO. - private final Mapcache = -new ConcurrentHashMap (); + private final Map cache = +new ConcurrentHashMap (); /** * Table descriptor for hbase:meta catalog table */ - private final HTableDescriptor metaTableDescritor; + private final HTableDescriptor metaTableDescriptor; /** * Construct a FSTableDescriptors instance using the hbase root dir of the given @@ -122,7 +123,44 @@ public class FSTableDescriptors implements TableDescriptors { this.fsreadonly = fsreadonly; this.usecache = usecache; -this.metaTableDescritor = TableDescriptor.metaTableDescriptor(conf); +this.metaTableDescriptor = createMetaTableDescriptor(conf); + } + + @VisibleForTesting + public static HTableDescriptor createMetaTableDescriptor(final Configuration conf) + throws IOException { +HTableDescriptor metaDescriptor = new HTableDescriptor( +TableName.META_TABLE_NAME, +new HColumnDescriptor[] { +new HColumnDescriptor(HConstants.CATALOG_FAMILY) +.setMaxVersions(conf.getInt(HConstants.HBASE_META_VERSIONS, +HConstants.DEFAULT_HBASE_META_VERSIONS)) +.setInMemory(true) +.setBlocksize(conf.getInt(HConstants.HBASE_META_BLOCK_SIZE, +HConstants.DEFAULT_HBASE_META_BLOCK_SIZE)) +.setScope(HConstants.REPLICATION_SCOPE_LOCAL) +// Disable blooms for meta. Needs work. Seems to mess w/ getClosestOrBefore. +.setBloomFilterType(BloomType.NONE) +// Enable cache of data blocks in L1 if more than one caching tier deployed: +// e.g. if using CombinedBlockCache (BucketCache). +.setCacheDataInL1(true), +new HColumnDescriptor(HConstants.TABLE_FAMILY) +// Ten is arbitrary number. Keep versions to help debugging. +.setMaxVersions(10) +.setInMemory(true) +.setBlocksize(8 * 1024) +.setScope(HConstants.REPLICATION_SCOPE_LOCAL) +// Disable blooms for meta. Needs work. Seems to mess w/ getClosestOrBefore. +.setBloomFilterType(BloomType.NONE) +// Enable cache of data blocks in L1 if more than one caching tier deployed: +// e.g. if using CombinedBlockCache (BucketCache). +.setCacheDataInL1(true) +}) { +}; +metaDescriptor.addCoprocessor( +"org.apache.hadoop.hbase.coprocessor.MultiRowMutationEndpoint", +null, Coprocessor.PRIORITY_SYSTEM, null); +return metaDescriptor; } @Override @@ -150,12 +188,12 @@ public class FSTableDescriptors implements TableDescriptors { */ @Override @Nullable - public TableDescriptor getDescriptor(final TableName tablename) + public HTableDescriptor get(final TableName tablename) throws IOException { invocations++; if (TableName.META_TABLE_NAME.equals(tablename)) { cachehits++; - return new
hbase git commit: HBASE-16023 Fastpath for the FIFO rpcscheduler Adds an executor that does balanced queue and fast path handing off requests directly to waiting handlers if any present. Idea taken fr
Repository: hbase Updated Branches: refs/heads/branch-1.3 75fb789a7 -> 0f8debc4c HBASE-16023 Fastpath for the FIFO rpcscheduler Adds an executor that does balanced queue and fast path handing off requests directly to waiting handlers if any present. Idea taken from Apace Kudu (incubating). See https://gerrit.cloudera.org/#/c/2938/7/src/kudu/rpc/service_queue.h M hbase-server/src/main/java/org/apache/hadoop/hbase/ipc/RpcExecutor.java Refactor which makes a Handler type. Put all 'handler' stuff inside this new type. Also make it so subclass can provide its own Handler type. M hbase-server/src/main/java/org/apache/hadoop/hbase/ipc/SimpleRpcScheduler.java Name the handler threads for their type so can tell if configs are having an effect. Signed-off-by: stackProject: http://git-wip-us.apache.org/repos/asf/hbase/repo Commit: http://git-wip-us.apache.org/repos/asf/hbase/commit/0f8debc4 Tree: http://git-wip-us.apache.org/repos/asf/hbase/tree/0f8debc4 Diff: http://git-wip-us.apache.org/repos/asf/hbase/diff/0f8debc4 Branch: refs/heads/branch-1.3 Commit: 0f8debc4c4b4403c5fff61e1ae7338d80831d988 Parents: 75fb789 Author: stack Authored: Tue Jun 14 11:18:34 2016 -0700 Committer: stack Committed: Fri Jun 17 17:10:14 2016 -0700 -- .../java/org/apache/hadoop/hbase/ipc/SimpleRpcScheduler.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) -- http://git-wip-us.apache.org/repos/asf/hbase/blob/0f8debc4/hbase-server/src/main/java/org/apache/hadoop/hbase/ipc/SimpleRpcScheduler.java -- diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/ipc/SimpleRpcScheduler.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/ipc/SimpleRpcScheduler.java index 7337b92..5e68dc8 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/ipc/SimpleRpcScheduler.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/ipc/SimpleRpcScheduler.java @@ -222,11 +222,11 @@ public class SimpleRpcScheduler extends RpcScheduler implements ConfigurationObs if (isDeadlineQueueType(callQueueType)) { CallPriorityComparator callPriority = new CallPriorityComparator(conf, this.priority); callExecutor = - new BalancedQueueRpcExecutor("DeadlineBQ.default", handlerCount, numCallQueues, + new BalancedQueueRpcExecutor("BQDeadline.default", handlerCount, numCallQueues, conf, abortable, BoundedPriorityBlockingQueue.class, maxQueueLength, callPriority); } else if (isCodelQueueType(callQueueType)) { callExecutor = - new BalancedQueueRpcExecutor("CodelBQ.default", handlerCount, numCallQueues, + new BalancedQueueRpcExecutor("BQCodel.default", handlerCount, numCallQueues, conf, abortable, AdaptiveLifoCoDelCallQueue.class, maxQueueLength, codelTargetDelay, codelInterval, codelLifoThreshold, numGeneralCallsDropped, numLifoModeSwitches); @@ -240,7 +240,7 @@ public class SimpleRpcScheduler extends RpcScheduler implements ConfigurationObs // Create 2 queues to help priorityExecutor be more scalable. this.priorityExecutor = priorityHandlerCount > 0? new FifoWithFastPathBalancedQueueRpcExecutor("FifoWFPBQ.priority", priorityHandlerCount, - 2, maxPriorityQueueLength, conf, abortable): null; +2, maxPriorityQueueLength, conf, abortable): null; this.replicationExecutor = replicationHandlerCount > 0? new FifoWithFastPathBalancedQueueRpcExecutor("FifoWFPBQ.replication", replicationHandlerCount, 1, maxQueueLength, conf, abortable) : null;
hbase git commit: HBASE-16061 Allow logging to a buffered console
Repository: hbase Updated Branches: refs/heads/branch-1 411e3cdb6 -> e721aa1a8 HBASE-16061 Allow logging to a buffered console Project: http://git-wip-us.apache.org/repos/asf/hbase/repo Commit: http://git-wip-us.apache.org/repos/asf/hbase/commit/e721aa1a Tree: http://git-wip-us.apache.org/repos/asf/hbase/tree/e721aa1a Diff: http://git-wip-us.apache.org/repos/asf/hbase/diff/e721aa1a Branch: refs/heads/branch-1 Commit: e721aa1a8ac2db2697d699ca553fad4b26b5e633 Parents: 411e3cd Author: Elliott ClarkAuthored: Fri Jun 17 16:32:57 2016 -0700 Committer: Elliott Clark Committed: Fri Jun 17 17:09:18 2016 -0700 -- conf/log4j.properties | 5 +- .../hadoop/hbase/AsyncConsoleAppender.java | 48 2 files changed, 52 insertions(+), 1 deletion(-) -- http://git-wip-us.apache.org/repos/asf/hbase/blob/e721aa1a/conf/log4j.properties -- diff --git a/conf/log4j.properties b/conf/log4j.properties index a15d575..e527c9b 100644 --- a/conf/log4j.properties +++ b/conf/log4j.properties @@ -80,13 +80,16 @@ log4j.appender.NullAppender=org.apache.log4j.varia.NullAppender # # console -# Add "console" to rootlogger above if you want to use this +# Add "console" to rootlogger above if you want to use this # log4j.appender.console=org.apache.log4j.ConsoleAppender log4j.appender.console.target=System.err log4j.appender.console.layout=org.apache.log4j.PatternLayout log4j.appender.console.layout.ConversionPattern=%d{ISO8601} %-5p [%t] %c{2}: %m%n +log4j.appender.asyncconsole=org.apache.hadoop.hbase.AsyncConsoleAppender +log4j.appender.asyncconsole.target=System.err + # Custom Logging levels log4j.logger.org.apache.zookeeper=INFO http://git-wip-us.apache.org/repos/asf/hbase/blob/e721aa1a/hbase-common/src/main/java/org/apache/hadoop/hbase/AsyncConsoleAppender.java -- diff --git a/hbase-common/src/main/java/org/apache/hadoop/hbase/AsyncConsoleAppender.java b/hbase-common/src/main/java/org/apache/hadoop/hbase/AsyncConsoleAppender.java new file mode 100644 index 000..338265d --- /dev/null +++ b/hbase-common/src/main/java/org/apache/hadoop/hbase/AsyncConsoleAppender.java @@ -0,0 +1,48 @@ +/** + * 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 + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.hadoop.hbase; + +import org.apache.hadoop.hbase.classification.InterfaceAudience; +import org.apache.log4j.AsyncAppender; +import org.apache.log4j.ConsoleAppender; +import org.apache.log4j.PatternLayout; + +/** + * Logger class that buffers before trying to log to the specified console. + */ +@InterfaceAudience.Private +public class AsyncConsoleAppender extends AsyncAppender { + private final ConsoleAppender consoleAppender; + + public AsyncConsoleAppender() { +super(); +consoleAppender = new ConsoleAppender(new PatternLayout( +"%d{ISO8601} %-5p [%t] %c{2}: %m%n")); +this.addAppender(consoleAppender); + } + + public void setTarget(String value) { +consoleAppender.setTarget(value); + } + + public void activateOptions() { +consoleAppender.activateOptions(); +super.activateOptions(); + } + +}
hbase git commit: HBASE-16061 Allow logging to a buffered console
Repository: hbase Updated Branches: refs/heads/master 81a9c1ac3 -> 65a8d7743 HBASE-16061 Allow logging to a buffered console Project: http://git-wip-us.apache.org/repos/asf/hbase/repo Commit: http://git-wip-us.apache.org/repos/asf/hbase/commit/65a8d774 Tree: http://git-wip-us.apache.org/repos/asf/hbase/tree/65a8d774 Diff: http://git-wip-us.apache.org/repos/asf/hbase/diff/65a8d774 Branch: refs/heads/master Commit: 65a8d77433cf72ce67e8b5e2efb35f2c2603c349 Parents: 81a9c1a Author: Elliott ClarkAuthored: Fri Jun 17 16:32:57 2016 -0700 Committer: Elliott Clark Committed: Fri Jun 17 17:06:12 2016 -0700 -- conf/log4j.properties | 5 +- .../hadoop/hbase/AsyncConsoleAppender.java | 48 2 files changed, 52 insertions(+), 1 deletion(-) -- http://git-wip-us.apache.org/repos/asf/hbase/blob/65a8d774/conf/log4j.properties -- diff --git a/conf/log4j.properties b/conf/log4j.properties index d36a22e..74b13b1 100644 --- a/conf/log4j.properties +++ b/conf/log4j.properties @@ -80,13 +80,16 @@ log4j.appender.NullAppender=org.apache.log4j.varia.NullAppender # # console -# Add "console" to rootlogger above if you want to use this +# Add "console" to rootlogger above if you want to use this # log4j.appender.console=org.apache.log4j.ConsoleAppender log4j.appender.console.target=System.err log4j.appender.console.layout=org.apache.log4j.PatternLayout log4j.appender.console.layout.ConversionPattern=%d{ISO8601} %-5p [%t] %c{2}: %m%n +log4j.appender.asyncconsole=org.apache.hadoop.hbase.AsyncConsoleAppender +log4j.appender.asyncconsole.target=System.err + # Custom Logging levels log4j.logger.org.apache.zookeeper=INFO http://git-wip-us.apache.org/repos/asf/hbase/blob/65a8d774/hbase-common/src/main/java/org/apache/hadoop/hbase/AsyncConsoleAppender.java -- diff --git a/hbase-common/src/main/java/org/apache/hadoop/hbase/AsyncConsoleAppender.java b/hbase-common/src/main/java/org/apache/hadoop/hbase/AsyncConsoleAppender.java new file mode 100644 index 000..338265d --- /dev/null +++ b/hbase-common/src/main/java/org/apache/hadoop/hbase/AsyncConsoleAppender.java @@ -0,0 +1,48 @@ +/** + * 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 + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.hadoop.hbase; + +import org.apache.hadoop.hbase.classification.InterfaceAudience; +import org.apache.log4j.AsyncAppender; +import org.apache.log4j.ConsoleAppender; +import org.apache.log4j.PatternLayout; + +/** + * Logger class that buffers before trying to log to the specified console. + */ +@InterfaceAudience.Private +public class AsyncConsoleAppender extends AsyncAppender { + private final ConsoleAppender consoleAppender; + + public AsyncConsoleAppender() { +super(); +consoleAppender = new ConsoleAppender(new PatternLayout( +"%d{ISO8601} %-5p [%t] %c{2}: %m%n")); +this.addAppender(consoleAppender); + } + + public void setTarget(String value) { +consoleAppender.setTarget(value); + } + + public void activateOptions() { +consoleAppender.activateOptions(); +super.activateOptions(); + } + +}
hbase git commit: HBASE-16061 Allow logging to a buffered console
Repository: hbase Updated Branches: refs/heads/branch-1.3 c327d9e38 -> 75fb789a7 HBASE-16061 Allow logging to a buffered console Project: http://git-wip-us.apache.org/repos/asf/hbase/repo Commit: http://git-wip-us.apache.org/repos/asf/hbase/commit/75fb789a Tree: http://git-wip-us.apache.org/repos/asf/hbase/tree/75fb789a Diff: http://git-wip-us.apache.org/repos/asf/hbase/diff/75fb789a Branch: refs/heads/branch-1.3 Commit: 75fb789a797de016217b24f4e6e9e3ef0a868cb3 Parents: c327d9e Author: Elliott ClarkAuthored: Fri Jun 17 16:32:57 2016 -0700 Committer: Elliott Clark Committed: Fri Jun 17 17:06:32 2016 -0700 -- conf/log4j.properties | 5 +- .../hadoop/hbase/AsyncConsoleAppender.java | 48 2 files changed, 52 insertions(+), 1 deletion(-) -- http://git-wip-us.apache.org/repos/asf/hbase/blob/75fb789a/conf/log4j.properties -- diff --git a/conf/log4j.properties b/conf/log4j.properties index a15d575..e527c9b 100644 --- a/conf/log4j.properties +++ b/conf/log4j.properties @@ -80,13 +80,16 @@ log4j.appender.NullAppender=org.apache.log4j.varia.NullAppender # # console -# Add "console" to rootlogger above if you want to use this +# Add "console" to rootlogger above if you want to use this # log4j.appender.console=org.apache.log4j.ConsoleAppender log4j.appender.console.target=System.err log4j.appender.console.layout=org.apache.log4j.PatternLayout log4j.appender.console.layout.ConversionPattern=%d{ISO8601} %-5p [%t] %c{2}: %m%n +log4j.appender.asyncconsole=org.apache.hadoop.hbase.AsyncConsoleAppender +log4j.appender.asyncconsole.target=System.err + # Custom Logging levels log4j.logger.org.apache.zookeeper=INFO http://git-wip-us.apache.org/repos/asf/hbase/blob/75fb789a/hbase-common/src/main/java/org/apache/hadoop/hbase/AsyncConsoleAppender.java -- diff --git a/hbase-common/src/main/java/org/apache/hadoop/hbase/AsyncConsoleAppender.java b/hbase-common/src/main/java/org/apache/hadoop/hbase/AsyncConsoleAppender.java new file mode 100644 index 000..338265d --- /dev/null +++ b/hbase-common/src/main/java/org/apache/hadoop/hbase/AsyncConsoleAppender.java @@ -0,0 +1,48 @@ +/** + * 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 + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.hadoop.hbase; + +import org.apache.hadoop.hbase.classification.InterfaceAudience; +import org.apache.log4j.AsyncAppender; +import org.apache.log4j.ConsoleAppender; +import org.apache.log4j.PatternLayout; + +/** + * Logger class that buffers before trying to log to the specified console. + */ +@InterfaceAudience.Private +public class AsyncConsoleAppender extends AsyncAppender { + private final ConsoleAppender consoleAppender; + + public AsyncConsoleAppender() { +super(); +consoleAppender = new ConsoleAppender(new PatternLayout( +"%d{ISO8601} %-5p [%t] %c{2}: %m%n")); +this.addAppender(consoleAppender); + } + + public void setTarget(String value) { +consoleAppender.setTarget(value); + } + + public void activateOptions() { +consoleAppender.activateOptions(); +super.activateOptions(); + } + +}
hbase git commit: HBASE-16023 Fastpath for the FIFO rpcscheduler Adds an executor that does balanced queue and fast path handing off requests directly to waiting handlers if any present. Idea taken fr
Repository: hbase Updated Branches: refs/heads/branch-1 76cf0d799 -> 411e3cdb6 HBASE-16023 Fastpath for the FIFO rpcscheduler Adds an executor that does balanced queue and fast path handing off requests directly to waiting handlers if any present. Idea taken from Apace Kudu (incubating). See https://gerrit.cloudera.org/#/c/2938/7/src/kudu/rpc/service_queue.h M hbase-server/src/main/java/org/apache/hadoop/hbase/ipc/RpcExecutor.java Refactor which makes a Handler type. Put all 'handler' stuff inside this new type. Also make it so subclass can provide its own Handler type. M hbase-server/src/main/java/org/apache/hadoop/hbase/ipc/SimpleRpcScheduler.java Name the handler threads for their type so can tell if configs are having an effect. Signed-off-by: stackProject: http://git-wip-us.apache.org/repos/asf/hbase/repo Commit: http://git-wip-us.apache.org/repos/asf/hbase/commit/411e3cdb Tree: http://git-wip-us.apache.org/repos/asf/hbase/tree/411e3cdb Diff: http://git-wip-us.apache.org/repos/asf/hbase/diff/411e3cdb Branch: refs/heads/branch-1 Commit: 411e3cdb6d47e622bf3aaec1c19380ba42d22b21 Parents: 76cf0d7 Author: stack Authored: Tue Jun 14 11:18:34 2016 -0700 Committer: stack Committed: Fri Jun 17 17:07:35 2016 -0700 -- .../hbase/ipc/BalancedQueueRpcExecutor.java | 5 +- ...ifoWithFastPathBalancedQueueRpcExecutor.java | 116 ++ .../apache/hadoop/hbase/ipc/RpcExecutor.java| 160 --- .../hadoop/hbase/ipc/SimpleRpcScheduler.java| 32 ++-- .../hbase/ipc/TestSimpleRpcScheduler.java | 10 +- 5 files changed, 237 insertions(+), 86 deletions(-) -- http://git-wip-us.apache.org/repos/asf/hbase/blob/411e3cdb/hbase-server/src/main/java/org/apache/hadoop/hbase/ipc/BalancedQueueRpcExecutor.java -- diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/ipc/BalancedQueueRpcExecutor.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/ipc/BalancedQueueRpcExecutor.java index 3505221..241d36e 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/ipc/BalancedQueueRpcExecutor.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/ipc/BalancedQueueRpcExecutor.java @@ -33,7 +33,8 @@ import org.apache.hadoop.hbase.util.ReflectionUtils; /** * An {@link RpcExecutor} that will balance requests evenly across all its queues, but still remains - * efficient with a single queue via an inlinable queue balancing mechanism. + * efficient with a single queue via an inlinable queue balancing mechanism. Defaults to FIFO but + * you can pass an alternate queue class to use. */ @InterfaceAudience.LimitedPrivate({ HBaseInterfaceAudience.COPROC, HBaseInterfaceAudience.PHOENIX }) @InterfaceStability.Evolving @@ -103,4 +104,4 @@ public class BalancedQueueRpcExecutor extends RpcExecutor { public List getQueues() { return queues; } -} +} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/hbase/blob/411e3cdb/hbase-server/src/main/java/org/apache/hadoop/hbase/ipc/FifoWithFastPathBalancedQueueRpcExecutor.java -- diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/ipc/FifoWithFastPathBalancedQueueRpcExecutor.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/ipc/FifoWithFastPathBalancedQueueRpcExecutor.java new file mode 100644 index 000..1951dd0 --- /dev/null +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/ipc/FifoWithFastPathBalancedQueueRpcExecutor.java @@ -0,0 +1,116 @@ +/** + * 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 + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.hadoop.hbase.ipc; + +import java.util.Deque; +import java.util.concurrent.BlockingQueue; +import java.util.concurrent.ConcurrentLinkedDeque; +import java.util.concurrent.LinkedBlockingQueue; +import java.util.concurrent.Semaphore; + +import org.apache.hadoop.conf.Configuration; +import org.apache.hadoop.hbase.Abortable; +import
hbase git commit: HBASE-15224 Undo "hbase.increment.fast.but.narrow.consistency" option; it is not necessary since HBASE-15213 (stack)
Repository: hbase Updated Branches: refs/heads/branch-1 fb9a8a09f -> 76cf0d799 HBASE-15224 Undo "hbase.increment.fast.but.narrow.consistency" option; it is not necessary since HBASE-15213 (stack) Project: http://git-wip-us.apache.org/repos/asf/hbase/repo Commit: http://git-wip-us.apache.org/repos/asf/hbase/commit/76cf0d79 Tree: http://git-wip-us.apache.org/repos/asf/hbase/tree/76cf0d79 Diff: http://git-wip-us.apache.org/repos/asf/hbase/diff/76cf0d79 Branch: refs/heads/branch-1 Commit: 76cf0d799fe3ad596b9872988c262da0895d59c6 Parents: fb9a8a0 Author: stackAuthored: Mon Feb 8 08:43:11 2016 -0800 Committer: Mikhail Antonov Committed: Fri Jun 17 14:39:45 2016 -0700 -- .../hadoop/hbase/regionserver/HRegion.java | 129 +-- ...tIncrementFromClientSideWithCoprocessor.java | 11 +- .../client/TestIncrementsFromClientSide.java| 60 + .../hbase/regionserver/TestAtomicOperation.java | 34 + .../hbase/regionserver/TestRegionIncrement.java | 24 +--- 5 files changed, 20 insertions(+), 238 deletions(-) -- http://git-wip-us.apache.org/repos/asf/hbase/blob/76cf0d79/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HRegion.java -- diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HRegion.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HRegion.java index 6bf4577..ec0a042 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HRegion.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HRegion.java @@ -219,16 +219,6 @@ public class HRegion implements HeapSize, PropagatingConfigurationObserver, Regi private static final int DEFAULT_MAX_WAIT_FOR_SEQ_ID = 3; /** - * Set region to take the fast increment path. Constraint is that caller can only access the - * Cell via Increment; intermixing Increment with other Mutations will give indeterminate - * results. A Get with {@link IsolationLevel#READ_UNCOMMITTED} will get the latest increment - * or an Increment of zero will do the same. - */ - public static final String INCREMENT_FAST_BUT_NARROW_CONSISTENCY_KEY = - "hbase.increment.fast.but.narrow.consistency"; - private final boolean incrementFastButNarrowConsistency; - - /** * This is the global default value for durability. All tables/mutations not * defining a durability or using USE_DEFAULT will default to this value. */ @@ -759,10 +749,6 @@ public class HRegion implements HeapSize, PropagatingConfigurationObserver, Regi false : conf.getBoolean(HConstants.ENABLE_CLIENT_BACKPRESSURE, HConstants.DEFAULT_ENABLE_CLIENT_BACKPRESSURE); - -// See #INCREMENT_FAST_BUT_NARROW_CONSISTENCY_KEY for what this flag is about. -this.incrementFastButNarrowConsistency = - this.conf.getBoolean(INCREMENT_FAST_BUT_NARROW_CONSISTENCY_KEY, false); } void setHTableSpecificConf() { @@ -7595,125 +7581,14 @@ public class HRegion implements HeapSize, PropagatingConfigurationObserver, Regi // for the constraints that apply when you take this code path; it is correct but only if // Increments are used mutating an Increment Cell; mixing concurrent Put+Delete and Increment // will yield indeterminate results. - return this.incrementFastButNarrowConsistency? -fastAndNarrowConsistencyIncrement(mutation, nonceGroup, nonce): -slowButConsistentIncrement(mutation, nonceGroup, nonce); + return doIncrement(mutation, nonceGroup, nonce); } finally { if (this.metricsRegion != null) this.metricsRegion.updateIncrement(); closeRegionOperation(op); } } - /** - * The bulk of this method is a bulk-and-paste of the slowButConsistentIncrement but with some - * reordering to enable the fast increment (reordering allows us to also drop some state - * carrying Lists and variables so the flow here is more straight-forward). We copy-and-paste - * because cannot break down the method further into smaller pieces. Too much state. Will redo - * in trunk and tip of branch-1 to undo duplication here and in append, checkAnd*, etc. For why - * this route is 'faster' than the alternative slowButConsistentIncrement path, see the comment - * in calling method. - * @return Resulting increment - * @throws IOException - */ - private Result fastAndNarrowConsistencyIncrement(Increment increment, long nonceGroup, - long nonce) - throws IOException { -long accumulatedResultSize = 0; -WALKey walKey = null; -long txid = 0; -// This is all kvs accumulated during this increment processing. Includes increments where the -// increment is zero: i.e. client just wants to
hbase git commit: HBASE-15224 Undo "hbase.increment.fast.but.narrow.consistency" option; it is not necessary since HBASE-15213 (stack)
Repository: hbase Updated Branches: refs/heads/branch-1.3 a9fe7dcf2 -> c327d9e38 HBASE-15224 Undo "hbase.increment.fast.but.narrow.consistency" option; it is not necessary since HBASE-15213 (stack) Project: http://git-wip-us.apache.org/repos/asf/hbase/repo Commit: http://git-wip-us.apache.org/repos/asf/hbase/commit/c327d9e3 Tree: http://git-wip-us.apache.org/repos/asf/hbase/tree/c327d9e3 Diff: http://git-wip-us.apache.org/repos/asf/hbase/diff/c327d9e3 Branch: refs/heads/branch-1.3 Commit: c327d9e380a88b5150c07a348d0f72857d1c14a7 Parents: a9fe7dc Author: stackAuthored: Mon Feb 8 08:43:11 2016 -0800 Committer: Mikhail Antonov Committed: Fri Jun 17 14:36:00 2016 -0700 -- .../hadoop/hbase/regionserver/HRegion.java | 129 +-- ...tIncrementFromClientSideWithCoprocessor.java | 11 +- .../client/TestIncrementsFromClientSide.java| 60 + .../hbase/regionserver/TestAtomicOperation.java | 34 + .../hbase/regionserver/TestRegionIncrement.java | 24 +--- 5 files changed, 20 insertions(+), 238 deletions(-) -- http://git-wip-us.apache.org/repos/asf/hbase/blob/c327d9e3/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HRegion.java -- diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HRegion.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HRegion.java index 04f7f81..b41502e 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HRegion.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HRegion.java @@ -218,16 +218,6 @@ public class HRegion implements HeapSize, PropagatingConfigurationObserver, Regi private static final int DEFAULT_MAX_WAIT_FOR_SEQ_ID = 3; /** - * Set region to take the fast increment path. Constraint is that caller can only access the - * Cell via Increment; intermixing Increment with other Mutations will give indeterminate - * results. A Get with {@link IsolationLevel#READ_UNCOMMITTED} will get the latest increment - * or an Increment of zero will do the same. - */ - public static final String INCREMENT_FAST_BUT_NARROW_CONSISTENCY_KEY = - "hbase.increment.fast.but.narrow.consistency"; - private final boolean incrementFastButNarrowConsistency; - - /** * This is the global default value for durability. All tables/mutations not * defining a durability or using USE_DEFAULT will default to this value. */ @@ -758,10 +748,6 @@ public class HRegion implements HeapSize, PropagatingConfigurationObserver, Regi false : conf.getBoolean(HConstants.ENABLE_CLIENT_BACKPRESSURE, HConstants.DEFAULT_ENABLE_CLIENT_BACKPRESSURE); - -// See #INCREMENT_FAST_BUT_NARROW_CONSISTENCY_KEY for what this flag is about. -this.incrementFastButNarrowConsistency = - this.conf.getBoolean(INCREMENT_FAST_BUT_NARROW_CONSISTENCY_KEY, false); } void setHTableSpecificConf() { @@ -7594,125 +7580,14 @@ public class HRegion implements HeapSize, PropagatingConfigurationObserver, Regi // for the constraints that apply when you take this code path; it is correct but only if // Increments are used mutating an Increment Cell; mixing concurrent Put+Delete and Increment // will yield indeterminate results. - return this.incrementFastButNarrowConsistency? -fastAndNarrowConsistencyIncrement(mutation, nonceGroup, nonce): -slowButConsistentIncrement(mutation, nonceGroup, nonce); + return doIncrement(mutation, nonceGroup, nonce); } finally { if (this.metricsRegion != null) this.metricsRegion.updateIncrement(); closeRegionOperation(op); } } - /** - * The bulk of this method is a bulk-and-paste of the slowButConsistentIncrement but with some - * reordering to enable the fast increment (reordering allows us to also drop some state - * carrying Lists and variables so the flow here is more straight-forward). We copy-and-paste - * because cannot break down the method further into smaller pieces. Too much state. Will redo - * in trunk and tip of branch-1 to undo duplication here and in append, checkAnd*, etc. For why - * this route is 'faster' than the alternative slowButConsistentIncrement path, see the comment - * in calling method. - * @return Resulting increment - * @throws IOException - */ - private Result fastAndNarrowConsistencyIncrement(Increment increment, long nonceGroup, - long nonce) - throws IOException { -long accumulatedResultSize = 0; -WALKey walKey = null; -long txid = 0; -// This is all kvs accumulated during this increment processing. Includes increments where the -// increment is zero: i.e. client just wants
hbase git commit: HBASE-16053 Master code is not setting the table in ENABLING state in create table
Repository: hbase Updated Branches: refs/heads/master 568e37d38 -> 81a9c1ac3 HBASE-16053 Master code is not setting the table in ENABLING state in create table Project: http://git-wip-us.apache.org/repos/asf/hbase/repo Commit: http://git-wip-us.apache.org/repos/asf/hbase/commit/81a9c1ac Tree: http://git-wip-us.apache.org/repos/asf/hbase/tree/81a9c1ac Diff: http://git-wip-us.apache.org/repos/asf/hbase/diff/81a9c1ac Branch: refs/heads/master Commit: 81a9c1ac31333f11ad4a5defb9c625daf492513b Parents: 568e37d Author: Enis SoztutarAuthored: Fri Jun 17 13:29:33 2016 -0700 Committer: Enis Soztutar Committed: Fri Jun 17 13:29:33 2016 -0700 -- .../hadoop/hbase/master/procedure/CreateTableProcedure.java | 4 1 file changed, 4 insertions(+) -- http://git-wip-us.apache.org/repos/asf/hbase/blob/81a9c1ac/hbase-server/src/main/java/org/apache/hadoop/hbase/master/procedure/CreateTableProcedure.java -- diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/master/procedure/CreateTableProcedure.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/master/procedure/CreateTableProcedure.java index 03d433b..da4a732 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/master/procedure/CreateTableProcedure.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/master/procedure/CreateTableProcedure.java @@ -445,6 +445,10 @@ public class CreateTableProcedure final TableName tableName, final List regions) throws IOException { ProcedureSyncWait.waitRegionServers(env); +// Mark the table as Enabling +env.getMasterServices().getTableStateManager() + .setTableState(tableName, TableState.State.ENABLING); + // Trigger immediate assignment of the regions in round-robin fashion final AssignmentManager assignmentManager = env.getMasterServices().getAssignmentManager(); ModifyRegionUtils.assignRegions(assignmentManager, regions);
[1/3] hbase git commit: HBASE-16056 Procedure v2 - fix master crash for FileNotFound
Repository: hbase Updated Branches: refs/heads/branch-1 3723baefe -> fb9a8a09f refs/heads/branch-1.3 b28bb7344 -> a9fe7dcf2 refs/heads/master 61ff6ced5 -> 568e37d38 HBASE-16056 Procedure v2 - fix master crash for FileNotFound Project: http://git-wip-us.apache.org/repos/asf/hbase/repo Commit: http://git-wip-us.apache.org/repos/asf/hbase/commit/fb9a8a09 Tree: http://git-wip-us.apache.org/repos/asf/hbase/tree/fb9a8a09 Diff: http://git-wip-us.apache.org/repos/asf/hbase/diff/fb9a8a09 Branch: refs/heads/branch-1 Commit: fb9a8a09f7e9493f166b3402a5948647c3f28acf Parents: 3723bae Author: Matteo BertozziAuthored: Fri Jun 17 12:43:21 2016 -0700 Committer: Matteo Bertozzi Committed: Fri Jun 17 13:11:07 2016 -0700 -- .../procedure2/store/wal/WALProcedureStore.java | 37 + .../store/wal/TestWALProcedureStore.java| 42 2 files changed, 71 insertions(+), 8 deletions(-) -- http://git-wip-us.apache.org/repos/asf/hbase/blob/fb9a8a09/hbase-procedure/src/main/java/org/apache/hadoop/hbase/procedure2/store/wal/WALProcedureStore.java -- diff --git a/hbase-procedure/src/main/java/org/apache/hadoop/hbase/procedure2/store/wal/WALProcedureStore.java b/hbase-procedure/src/main/java/org/apache/hadoop/hbase/procedure2/store/wal/WALProcedureStore.java index 5ac421c..c8f4946 100644 --- a/hbase-procedure/src/main/java/org/apache/hadoop/hbase/procedure2/store/wal/WALProcedureStore.java +++ b/hbase-procedure/src/main/java/org/apache/hadoop/hbase/procedure2/store/wal/WALProcedureStore.java @@ -23,6 +23,7 @@ import java.io.IOException; import java.util.ArrayList; import java.util.Arrays; import java.util.Collections; +import java.util.Comparator; import java.util.HashSet; import java.util.Iterator; import java.util.LinkedList; @@ -297,7 +298,13 @@ public class WALProcedureStore extends ProcedureStoreBase { FileStatus[] oldLogs = getLogFiles(); while (isRunning()) { // Get Log-MaxID and recover lease on old logs -flushLogId = initOldLogs(oldLogs); +try { + flushLogId = initOldLogs(oldLogs); +} catch (FileNotFoundException e) { + LOG.warn("someone else is active and deleted logs. retrying.", e); + oldLogs = getLogFiles(); + continue; +} // Create new state-log if (!rollWriter(flushLogId + 1)) { @@ -928,15 +935,29 @@ public class WALProcedureStore extends ProcedureStoreBase { return Long.parseLong(name.substring(start, end)); } + private static final PathFilter WALS_PATH_FILTER = new PathFilter() { +@Override +public boolean accept(Path path) { + String name = path.getName(); + return name.startsWith("state-") && name.endsWith(".log"); +} + }; + + private static final Comparator FILE_STATUS_ID_COMPARATOR = + new Comparator() { +@Override +public int compare(FileStatus a, FileStatus b) { + final long aId = getLogIdFromName(a.getPath().getName()); + final long bId = getLogIdFromName(b.getPath().getName()); + return Long.compare(aId, bId); +} + }; + private FileStatus[] getLogFiles() throws IOException { try { - return fs.listStatus(logDir, new PathFilter() { -@Override -public boolean accept(Path path) { - String name = path.getName(); - return name.startsWith("state-") && name.endsWith(".log"); -} - }); + FileStatus[] files = fs.listStatus(logDir, WALS_PATH_FILTER); + Arrays.sort(files, FILE_STATUS_ID_COMPARATOR); + return files; } catch (FileNotFoundException e) { LOG.warn("Log directory not found: " + e.getMessage()); return null; http://git-wip-us.apache.org/repos/asf/hbase/blob/fb9a8a09/hbase-procedure/src/test/java/org/apache/hadoop/hbase/procedure2/store/wal/TestWALProcedureStore.java -- diff --git a/hbase-procedure/src/test/java/org/apache/hadoop/hbase/procedure2/store/wal/TestWALProcedureStore.java b/hbase-procedure/src/test/java/org/apache/hadoop/hbase/procedure2/store/wal/TestWALProcedureStore.java index e97dd2a..e3f6bf2 100644 --- a/hbase-procedure/src/test/java/org/apache/hadoop/hbase/procedure2/store/wal/TestWALProcedureStore.java +++ b/hbase-procedure/src/test/java/org/apache/hadoop/hbase/procedure2/store/wal/TestWALProcedureStore.java @@ -443,6 +443,48 @@ public class TestWALProcedureStore { assertEquals(1, procStore.getActiveLogs().size()); } + @Test + public void testFileNotFoundDuringLeaseRecovery() throws IOException { +TestProcedure[] procs = new TestProcedure[3]; +for (int i = 0; i < procs.length; ++i) { + procs[i] = new
[2/3] hbase git commit: HBASE-16056 Procedure v2 - fix master crash for FileNotFound
HBASE-16056 Procedure v2 - fix master crash for FileNotFound Project: http://git-wip-us.apache.org/repos/asf/hbase/repo Commit: http://git-wip-us.apache.org/repos/asf/hbase/commit/a9fe7dcf Tree: http://git-wip-us.apache.org/repos/asf/hbase/tree/a9fe7dcf Diff: http://git-wip-us.apache.org/repos/asf/hbase/diff/a9fe7dcf Branch: refs/heads/branch-1.3 Commit: a9fe7dcf2c38e783d9651b2e673c6933b5860ce7 Parents: b28bb73 Author: Matteo BertozziAuthored: Fri Jun 17 12:43:21 2016 -0700 Committer: Matteo Bertozzi Committed: Fri Jun 17 13:11:16 2016 -0700 -- .../procedure2/store/wal/WALProcedureStore.java | 37 + .../store/wal/TestWALProcedureStore.java| 42 2 files changed, 71 insertions(+), 8 deletions(-) -- http://git-wip-us.apache.org/repos/asf/hbase/blob/a9fe7dcf/hbase-procedure/src/main/java/org/apache/hadoop/hbase/procedure2/store/wal/WALProcedureStore.java -- diff --git a/hbase-procedure/src/main/java/org/apache/hadoop/hbase/procedure2/store/wal/WALProcedureStore.java b/hbase-procedure/src/main/java/org/apache/hadoop/hbase/procedure2/store/wal/WALProcedureStore.java index 5ac421c..c8f4946 100644 --- a/hbase-procedure/src/main/java/org/apache/hadoop/hbase/procedure2/store/wal/WALProcedureStore.java +++ b/hbase-procedure/src/main/java/org/apache/hadoop/hbase/procedure2/store/wal/WALProcedureStore.java @@ -23,6 +23,7 @@ import java.io.IOException; import java.util.ArrayList; import java.util.Arrays; import java.util.Collections; +import java.util.Comparator; import java.util.HashSet; import java.util.Iterator; import java.util.LinkedList; @@ -297,7 +298,13 @@ public class WALProcedureStore extends ProcedureStoreBase { FileStatus[] oldLogs = getLogFiles(); while (isRunning()) { // Get Log-MaxID and recover lease on old logs -flushLogId = initOldLogs(oldLogs); +try { + flushLogId = initOldLogs(oldLogs); +} catch (FileNotFoundException e) { + LOG.warn("someone else is active and deleted logs. retrying.", e); + oldLogs = getLogFiles(); + continue; +} // Create new state-log if (!rollWriter(flushLogId + 1)) { @@ -928,15 +935,29 @@ public class WALProcedureStore extends ProcedureStoreBase { return Long.parseLong(name.substring(start, end)); } + private static final PathFilter WALS_PATH_FILTER = new PathFilter() { +@Override +public boolean accept(Path path) { + String name = path.getName(); + return name.startsWith("state-") && name.endsWith(".log"); +} + }; + + private static final Comparator FILE_STATUS_ID_COMPARATOR = + new Comparator() { +@Override +public int compare(FileStatus a, FileStatus b) { + final long aId = getLogIdFromName(a.getPath().getName()); + final long bId = getLogIdFromName(b.getPath().getName()); + return Long.compare(aId, bId); +} + }; + private FileStatus[] getLogFiles() throws IOException { try { - return fs.listStatus(logDir, new PathFilter() { -@Override -public boolean accept(Path path) { - String name = path.getName(); - return name.startsWith("state-") && name.endsWith(".log"); -} - }); + FileStatus[] files = fs.listStatus(logDir, WALS_PATH_FILTER); + Arrays.sort(files, FILE_STATUS_ID_COMPARATOR); + return files; } catch (FileNotFoundException e) { LOG.warn("Log directory not found: " + e.getMessage()); return null; http://git-wip-us.apache.org/repos/asf/hbase/blob/a9fe7dcf/hbase-procedure/src/test/java/org/apache/hadoop/hbase/procedure2/store/wal/TestWALProcedureStore.java -- diff --git a/hbase-procedure/src/test/java/org/apache/hadoop/hbase/procedure2/store/wal/TestWALProcedureStore.java b/hbase-procedure/src/test/java/org/apache/hadoop/hbase/procedure2/store/wal/TestWALProcedureStore.java index e97dd2a..e3f6bf2 100644 --- a/hbase-procedure/src/test/java/org/apache/hadoop/hbase/procedure2/store/wal/TestWALProcedureStore.java +++ b/hbase-procedure/src/test/java/org/apache/hadoop/hbase/procedure2/store/wal/TestWALProcedureStore.java @@ -443,6 +443,48 @@ public class TestWALProcedureStore { assertEquals(1, procStore.getActiveLogs().size()); } + @Test + public void testFileNotFoundDuringLeaseRecovery() throws IOException { +TestProcedure[] procs = new TestProcedure[3]; +for (int i = 0; i < procs.length; ++i) { + procs[i] = new TestProcedure(i + 1, 0); + procStore.insert(procs[i], null); +} +procStore.rollWriterForTesting(); +for (int i = 0; i < procs.length; ++i) { +
[3/3] hbase git commit: HBASE-16056 Procedure v2 - fix master crash for FileNotFound
HBASE-16056 Procedure v2 - fix master crash for FileNotFound Project: http://git-wip-us.apache.org/repos/asf/hbase/repo Commit: http://git-wip-us.apache.org/repos/asf/hbase/commit/568e37d3 Tree: http://git-wip-us.apache.org/repos/asf/hbase/tree/568e37d3 Diff: http://git-wip-us.apache.org/repos/asf/hbase/diff/568e37d3 Branch: refs/heads/master Commit: 568e37d3831c65dfe4dc90c72fede2671b89cf7a Parents: 61ff6ce Author: Matteo BertozziAuthored: Fri Jun 17 12:43:21 2016 -0700 Committer: Matteo Bertozzi Committed: Fri Jun 17 13:11:26 2016 -0700 -- .../procedure2/store/wal/WALProcedureStore.java | 37 + .../store/wal/TestWALProcedureStore.java| 42 2 files changed, 71 insertions(+), 8 deletions(-) -- http://git-wip-us.apache.org/repos/asf/hbase/blob/568e37d3/hbase-procedure/src/main/java/org/apache/hadoop/hbase/procedure2/store/wal/WALProcedureStore.java -- diff --git a/hbase-procedure/src/main/java/org/apache/hadoop/hbase/procedure2/store/wal/WALProcedureStore.java b/hbase-procedure/src/main/java/org/apache/hadoop/hbase/procedure2/store/wal/WALProcedureStore.java index 5ac421c..c8f4946 100644 --- a/hbase-procedure/src/main/java/org/apache/hadoop/hbase/procedure2/store/wal/WALProcedureStore.java +++ b/hbase-procedure/src/main/java/org/apache/hadoop/hbase/procedure2/store/wal/WALProcedureStore.java @@ -23,6 +23,7 @@ import java.io.IOException; import java.util.ArrayList; import java.util.Arrays; import java.util.Collections; +import java.util.Comparator; import java.util.HashSet; import java.util.Iterator; import java.util.LinkedList; @@ -297,7 +298,13 @@ public class WALProcedureStore extends ProcedureStoreBase { FileStatus[] oldLogs = getLogFiles(); while (isRunning()) { // Get Log-MaxID and recover lease on old logs -flushLogId = initOldLogs(oldLogs); +try { + flushLogId = initOldLogs(oldLogs); +} catch (FileNotFoundException e) { + LOG.warn("someone else is active and deleted logs. retrying.", e); + oldLogs = getLogFiles(); + continue; +} // Create new state-log if (!rollWriter(flushLogId + 1)) { @@ -928,15 +935,29 @@ public class WALProcedureStore extends ProcedureStoreBase { return Long.parseLong(name.substring(start, end)); } + private static final PathFilter WALS_PATH_FILTER = new PathFilter() { +@Override +public boolean accept(Path path) { + String name = path.getName(); + return name.startsWith("state-") && name.endsWith(".log"); +} + }; + + private static final Comparator FILE_STATUS_ID_COMPARATOR = + new Comparator() { +@Override +public int compare(FileStatus a, FileStatus b) { + final long aId = getLogIdFromName(a.getPath().getName()); + final long bId = getLogIdFromName(b.getPath().getName()); + return Long.compare(aId, bId); +} + }; + private FileStatus[] getLogFiles() throws IOException { try { - return fs.listStatus(logDir, new PathFilter() { -@Override -public boolean accept(Path path) { - String name = path.getName(); - return name.startsWith("state-") && name.endsWith(".log"); -} - }); + FileStatus[] files = fs.listStatus(logDir, WALS_PATH_FILTER); + Arrays.sort(files, FILE_STATUS_ID_COMPARATOR); + return files; } catch (FileNotFoundException e) { LOG.warn("Log directory not found: " + e.getMessage()); return null; http://git-wip-us.apache.org/repos/asf/hbase/blob/568e37d3/hbase-procedure/src/test/java/org/apache/hadoop/hbase/procedure2/store/wal/TestWALProcedureStore.java -- diff --git a/hbase-procedure/src/test/java/org/apache/hadoop/hbase/procedure2/store/wal/TestWALProcedureStore.java b/hbase-procedure/src/test/java/org/apache/hadoop/hbase/procedure2/store/wal/TestWALProcedureStore.java index f964d86..8a244dd 100644 --- a/hbase-procedure/src/test/java/org/apache/hadoop/hbase/procedure2/store/wal/TestWALProcedureStore.java +++ b/hbase-procedure/src/test/java/org/apache/hadoop/hbase/procedure2/store/wal/TestWALProcedureStore.java @@ -468,6 +468,48 @@ public class TestWALProcedureStore { assertEquals(1, procStore.getActiveLogs().size()); } + @Test + public void testFileNotFoundDuringLeaseRecovery() throws IOException { +TestProcedure[] procs = new TestProcedure[3]; +for (int i = 0; i < procs.length; ++i) { + procs[i] = new TestProcedure(i + 1, 0); + procStore.insert(procs[i], null); +} +procStore.rollWriterForTesting(); +for (int i = 0; i < procs.length; ++i) { +
[2/2] hbase git commit: HBASE-16056 Procedure v2 - fix master crash for FileNotFound
HBASE-16056 Procedure v2 - fix master crash for FileNotFound Project: http://git-wip-us.apache.org/repos/asf/hbase/repo Commit: http://git-wip-us.apache.org/repos/asf/hbase/commit/ececf19d Tree: http://git-wip-us.apache.org/repos/asf/hbase/tree/ececf19d Diff: http://git-wip-us.apache.org/repos/asf/hbase/diff/ececf19d Branch: refs/heads/branch-1.1 Commit: ececf19dbaae38773f4b58454439a0914c4f8375 Parents: a0b836e Author: Matteo BertozziAuthored: Fri Jun 17 12:43:21 2016 -0700 Committer: Matteo Bertozzi Committed: Fri Jun 17 13:06:44 2016 -0700 -- .../procedure2/store/wal/WALProcedureStore.java | 37 ++ .../store/wal/TestWALProcedureStore.java| 40 2 files changed, 69 insertions(+), 8 deletions(-) -- http://git-wip-us.apache.org/repos/asf/hbase/blob/ececf19d/hbase-procedure/src/main/java/org/apache/hadoop/hbase/procedure2/store/wal/WALProcedureStore.java -- diff --git a/hbase-procedure/src/main/java/org/apache/hadoop/hbase/procedure2/store/wal/WALProcedureStore.java b/hbase-procedure/src/main/java/org/apache/hadoop/hbase/procedure2/store/wal/WALProcedureStore.java index 0089760..fc993b7 100644 --- a/hbase-procedure/src/main/java/org/apache/hadoop/hbase/procedure2/store/wal/WALProcedureStore.java +++ b/hbase-procedure/src/main/java/org/apache/hadoop/hbase/procedure2/store/wal/WALProcedureStore.java @@ -31,6 +31,7 @@ import java.util.concurrent.TimeUnit; import java.util.Arrays; import java.util.ArrayList; import java.util.Collections; +import java.util.Comparator; import java.util.HashSet; import java.util.Iterator; import java.util.LinkedList; @@ -278,7 +279,13 @@ public class WALProcedureStore implements ProcedureStore { FileStatus[] oldLogs = getLogFiles(); while (isRunning()) { // Get Log-MaxID and recover lease on old logs -flushLogId = initOldLogs(oldLogs); +try { + flushLogId = initOldLogs(oldLogs); +} catch (FileNotFoundException e) { + LOG.warn("someone else is active and deleted logs. retrying.", e); + oldLogs = getLogFiles(); + continue; +} // Create new state-log if (!rollWriter(flushLogId + 1)) { @@ -883,15 +890,29 @@ public class WALProcedureStore implements ProcedureStore { return Long.parseLong(name.substring(start, end)); } + private static final PathFilter WALS_PATH_FILTER = new PathFilter() { +@Override +public boolean accept(Path path) { + String name = path.getName(); + return name.startsWith("state-") && name.endsWith(".log"); +} + }; + + private static final Comparator FILE_STATUS_ID_COMPARATOR = + new Comparator() { +@Override +public int compare(FileStatus a, FileStatus b) { + final long aId = getLogIdFromName(a.getPath().getName()); + final long bId = getLogIdFromName(b.getPath().getName()); + return Long.compare(aId, bId); +} + }; + private FileStatus[] getLogFiles() throws IOException { try { - return fs.listStatus(logDir, new PathFilter() { -@Override -public boolean accept(Path path) { - String name = path.getName(); - return name.startsWith("state-") && name.endsWith(".log"); -} - }); + FileStatus[] files = fs.listStatus(logDir, WALS_PATH_FILTER); + Arrays.sort(files, FILE_STATUS_ID_COMPARATOR); + return files; } catch (FileNotFoundException e) { LOG.warn("Log directory not found: " + e.getMessage()); return null; http://git-wip-us.apache.org/repos/asf/hbase/blob/ececf19d/hbase-procedure/src/test/java/org/apache/hadoop/hbase/procedure2/store/wal/TestWALProcedureStore.java -- diff --git a/hbase-procedure/src/test/java/org/apache/hadoop/hbase/procedure2/store/wal/TestWALProcedureStore.java b/hbase-procedure/src/test/java/org/apache/hadoop/hbase/procedure2/store/wal/TestWALProcedureStore.java index a33f334..62ed0d4 100644 --- a/hbase-procedure/src/test/java/org/apache/hadoop/hbase/procedure2/store/wal/TestWALProcedureStore.java +++ b/hbase-procedure/src/test/java/org/apache/hadoop/hbase/procedure2/store/wal/TestWALProcedureStore.java @@ -320,6 +320,46 @@ public class TestWALProcedureStore { assertEquals(1, procStore.getActiveLogs().size()); } + @Test + public void testFileNotFoundDuringLeaseRecovery() throws IOException { +TestProcedure[] procs = new TestProcedure[3]; +for (int i = 0; i < procs.length; ++i) { + procs[i] = new TestProcedure(i + 1, 0); + procStore.insert(procs[i], null); +} +procStore.rollWriterForTesting(); +for (int i = 0; i < procs.length; ++i) { +
[1/2] hbase git commit: HBASE-16056 Procedure v2 - fix master crash for FileNotFound
Repository: hbase Updated Branches: refs/heads/branch-1.1 a0b836e54 -> ececf19db refs/heads/branch-1.2 9aa65dbca -> 8ea80b455 HBASE-16056 Procedure v2 - fix master crash for FileNotFound Project: http://git-wip-us.apache.org/repos/asf/hbase/repo Commit: http://git-wip-us.apache.org/repos/asf/hbase/commit/8ea80b45 Tree: http://git-wip-us.apache.org/repos/asf/hbase/tree/8ea80b45 Diff: http://git-wip-us.apache.org/repos/asf/hbase/diff/8ea80b45 Branch: refs/heads/branch-1.2 Commit: 8ea80b4556bb82b2c1ae8e31fa8a104264a5c400 Parents: 9aa65db Author: Matteo BertozziAuthored: Fri Jun 17 12:43:21 2016 -0700 Committer: Matteo Bertozzi Committed: Fri Jun 17 12:53:00 2016 -0700 -- .../procedure2/store/wal/WALProcedureStore.java | 37 + .../store/wal/TestWALProcedureStore.java| 42 2 files changed, 71 insertions(+), 8 deletions(-) -- http://git-wip-us.apache.org/repos/asf/hbase/blob/8ea80b45/hbase-procedure/src/main/java/org/apache/hadoop/hbase/procedure2/store/wal/WALProcedureStore.java -- diff --git a/hbase-procedure/src/main/java/org/apache/hadoop/hbase/procedure2/store/wal/WALProcedureStore.java b/hbase-procedure/src/main/java/org/apache/hadoop/hbase/procedure2/store/wal/WALProcedureStore.java index a8d2db0..31efda6 100644 --- a/hbase-procedure/src/main/java/org/apache/hadoop/hbase/procedure2/store/wal/WALProcedureStore.java +++ b/hbase-procedure/src/main/java/org/apache/hadoop/hbase/procedure2/store/wal/WALProcedureStore.java @@ -30,6 +30,7 @@ import java.util.concurrent.TimeUnit; import java.util.Arrays; import java.util.ArrayList; import java.util.Collections; +import java.util.Comparator; import java.util.HashSet; import java.util.Iterator; import java.util.LinkedList; @@ -257,7 +258,13 @@ public class WALProcedureStore extends ProcedureStoreBase { FileStatus[] oldLogs = getLogFiles(); while (isRunning()) { // Get Log-MaxID and recover lease on old logs -flushLogId = initOldLogs(oldLogs); +try { + flushLogId = initOldLogs(oldLogs); +} catch (FileNotFoundException e) { + LOG.warn("someone else is active and deleted logs. retrying.", e); + oldLogs = getLogFiles(); + continue; +} // Create new state-log if (!rollWriter(flushLogId + 1)) { @@ -862,15 +869,29 @@ public class WALProcedureStore extends ProcedureStoreBase { return Long.parseLong(name.substring(start, end)); } + private static final PathFilter WALS_PATH_FILTER = new PathFilter() { +@Override +public boolean accept(Path path) { + String name = path.getName(); + return name.startsWith("state-") && name.endsWith(".log"); +} + }; + + private static final Comparator FILE_STATUS_ID_COMPARATOR = + new Comparator() { +@Override +public int compare(FileStatus a, FileStatus b) { + final long aId = getLogIdFromName(a.getPath().getName()); + final long bId = getLogIdFromName(b.getPath().getName()); + return Long.compare(aId, bId); +} + }; + private FileStatus[] getLogFiles() throws IOException { try { - return fs.listStatus(logDir, new PathFilter() { -@Override -public boolean accept(Path path) { - String name = path.getName(); - return name.startsWith("state-") && name.endsWith(".log"); -} - }); + FileStatus[] files = fs.listStatus(logDir, WALS_PATH_FILTER); + Arrays.sort(files, FILE_STATUS_ID_COMPARATOR); + return files; } catch (FileNotFoundException e) { LOG.warn("Log directory not found: " + e.getMessage()); return null; http://git-wip-us.apache.org/repos/asf/hbase/blob/8ea80b45/hbase-procedure/src/test/java/org/apache/hadoop/hbase/procedure2/store/wal/TestWALProcedureStore.java -- diff --git a/hbase-procedure/src/test/java/org/apache/hadoop/hbase/procedure2/store/wal/TestWALProcedureStore.java b/hbase-procedure/src/test/java/org/apache/hadoop/hbase/procedure2/store/wal/TestWALProcedureStore.java index e97dd2a..e3f6bf2 100644 --- a/hbase-procedure/src/test/java/org/apache/hadoop/hbase/procedure2/store/wal/TestWALProcedureStore.java +++ b/hbase-procedure/src/test/java/org/apache/hadoop/hbase/procedure2/store/wal/TestWALProcedureStore.java @@ -443,6 +443,48 @@ public class TestWALProcedureStore { assertEquals(1, procStore.getActiveLogs().size()); } + @Test + public void testFileNotFoundDuringLeaseRecovery() throws IOException { +TestProcedure[] procs = new TestProcedure[3]; +for (int i = 0; i < procs.length; ++i) { + procs[i] = new TestProcedure(i + 1, 0); +
hbase git commit: HBASE-16018 Refactored the ReplicationPeers interface to clear up what some methods do and move away from a ZooKeeper-specific implementation.
Repository: hbase Updated Branches: refs/heads/master 5147fb12a -> 61ff6ced5 HBASE-16018 Refactored the ReplicationPeers interface to clear up what some methods do and move away from a ZooKeeper-specific implementation. Also added some documentation for undocumented methods. Signed-off-by: Elliott ClarkProject: http://git-wip-us.apache.org/repos/asf/hbase/repo Commit: http://git-wip-us.apache.org/repos/asf/hbase/commit/61ff6ced Tree: http://git-wip-us.apache.org/repos/asf/hbase/tree/61ff6ced Diff: http://git-wip-us.apache.org/repos/asf/hbase/diff/61ff6ced Branch: refs/heads/master Commit: 61ff6ced5bea3586129fb0844bbf64b122775b42 Parents: 5147fb1 Author: Joseph Hwang Authored: Tue Jun 14 08:58:49 2016 -0700 Committer: Elliott Clark Committed: Fri Jun 17 13:04:21 2016 -0700 -- .../client/replication/ReplicationAdmin.java| 8 ++-- .../hbase/replication/ReplicationPeers.java | 41 +++- .../replication/ReplicationPeersZKImpl.java | 17 .../regionserver/ReplicationSource.java | 2 +- .../regionserver/ReplicationSourceManager.java | 14 +++ .../cleaner/TestReplicationHFileCleaner.java| 4 +- .../replication/TestReplicationStateBasic.java | 40 +-- .../TestReplicationStateHBaseImpl.java | 6 +-- .../TestReplicationTrackerZKImpl.java | 18 - 9 files changed, 85 insertions(+), 65 deletions(-) -- http://git-wip-us.apache.org/repos/asf/hbase/blob/61ff6ced/hbase-client/src/main/java/org/apache/hadoop/hbase/client/replication/ReplicationAdmin.java -- diff --git a/hbase-client/src/main/java/org/apache/hadoop/hbase/client/replication/ReplicationAdmin.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/replication/ReplicationAdmin.java index e0985bd..b04d317 100644 --- a/hbase-client/src/main/java/org/apache/hadoop/hbase/client/replication/ReplicationAdmin.java +++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/replication/ReplicationAdmin.java @@ -183,7 +183,7 @@ public class ReplicationAdmin implements Closeable { if (tableCfs != null) { peerConfig.setTableCFsMap(tableCfs); } -this.replicationPeers.addPeer(id, peerConfig); +this.replicationPeers.registerPeer(id, peerConfig); } /** @@ -192,7 +192,7 @@ public class ReplicationAdmin implements Closeable { * @param peerConfig configuration for the replication slave cluster */ public void addPeer(String id, ReplicationPeerConfig peerConfig) throws ReplicationException { -this.replicationPeers.addPeer(id, peerConfig); +this.replicationPeers.registerPeer(id, peerConfig); } /** @@ -212,7 +212,7 @@ public class ReplicationAdmin implements Closeable { * @param id a short name that identifies the cluster */ public void removePeer(String id) throws ReplicationException { -this.replicationPeers.removePeer(id); +this.replicationPeers.unregisterPeer(id); } /** @@ -556,7 +556,7 @@ public class ReplicationAdmin implements Closeable { @VisibleForTesting public void peerAdded(String id) throws ReplicationException { -this.replicationPeers.peerAdded(id); +this.replicationPeers.peerConnected(id); } @VisibleForTesting http://git-wip-us.apache.org/repos/asf/hbase/blob/61ff6ced/hbase-client/src/main/java/org/apache/hadoop/hbase/replication/ReplicationPeers.java -- diff --git a/hbase-client/src/main/java/org/apache/hadoop/hbase/replication/ReplicationPeers.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/replication/ReplicationPeers.java index 9f70d95..2a7963a 100644 --- a/hbase-client/src/main/java/org/apache/hadoop/hbase/replication/ReplicationPeers.java +++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/replication/ReplicationPeers.java @@ -51,18 +51,30 @@ public interface ReplicationPeers { * @param peerId a short that identifies the cluster * @param peerConfig configuration for the replication slave cluster */ - void addPeer(String peerId, ReplicationPeerConfig peerConfig) + void registerPeer(String peerId, ReplicationPeerConfig peerConfig) throws ReplicationException; /** * Removes a remote slave cluster and stops the replication to it. * @param peerId a short that identifies the cluster */ - void removePeer(String peerId) throws ReplicationException; + void unregisterPeer(String peerId) throws ReplicationException; - boolean peerAdded(String peerId) throws ReplicationException; + /** + * Method called after a peer has been connected. It will create a ReplicationPeer to track the + * newly connected cluster. + * @param peerId a short that
hbase git commit: HBASE-14915 Hanging test : org.apache.hadoop.hbase.mapreduce.TestImportExport (Heng Chen)
Repository: hbase Updated Branches: refs/heads/branch-1.3 39ee3091a -> b28bb7344 HBASE-14915 Hanging test : org.apache.hadoop.hbase.mapreduce.TestImportExport (Heng Chen) Project: http://git-wip-us.apache.org/repos/asf/hbase/repo Commit: http://git-wip-us.apache.org/repos/asf/hbase/commit/b28bb734 Tree: http://git-wip-us.apache.org/repos/asf/hbase/tree/b28bb734 Diff: http://git-wip-us.apache.org/repos/asf/hbase/diff/b28bb734 Branch: refs/heads/branch-1.3 Commit: b28bb7344d46d7937ddb7d08a8b323a9885f9acd Parents: 39ee309 Author: chenhengAuthored: Sat Dec 12 11:28:14 2015 +0800 Committer: Mikhail Antonov Committed: Fri Jun 17 12:37:39 2016 -0700 -- .../apache/hadoop/hbase/mapreduce/TestImportExport.java | 12 ++-- 1 file changed, 10 insertions(+), 2 deletions(-) -- http://git-wip-us.apache.org/repos/asf/hbase/blob/b28bb734/hbase-server/src/test/java/org/apache/hadoop/hbase/mapreduce/TestImportExport.java -- diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/mapreduce/TestImportExport.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/mapreduce/TestImportExport.java index e2131e9..1ed99e5 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/mapreduce/TestImportExport.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/mapreduce/TestImportExport.java @@ -43,6 +43,7 @@ import org.apache.hadoop.fs.Path; import org.apache.hadoop.hbase.HConstants; import org.apache.hadoop.hbase.Cell; import org.apache.hadoop.hbase.CellUtil; +import org.apache.hadoop.hbase.CategoryBasedTimeout; import org.apache.hadoop.hbase.HBaseTestingUtility; import org.apache.hadoop.hbase.HColumnDescriptor; import org.apache.hadoop.hbase.HRegionInfo; @@ -78,8 +79,10 @@ import org.junit.AfterClass; import org.junit.Assert; import org.junit.Before; import org.junit.BeforeClass; +import org.junit.Rule; import org.junit.Test; import org.junit.experimental.categories.Category; +import org.junit.rules.TestRule; import org.mockito.invocation.InvocationOnMock; import org.mockito.stubbing.Answer; @@ -104,9 +107,14 @@ public class TestImportExport { private static long now = System.currentTimeMillis(); + @Rule + public final TestRule timeout = CategoryBasedTimeout.builder().withTimeout(this.getClass()). + withLookingForStuckThread(true).build(); + @BeforeClass public static void beforeClass() throws Exception { // Up the handlers; this test needs more than usual. + UTIL.getConfiguration().setBoolean(HBaseTestingUtility.USE_LOCAL_FILESYSTEM, true); UTIL.getConfiguration().setInt(HConstants.REGION_SERVER_HIGH_PRIORITY_HANDLER_COUNT, 10); UTIL.setJobWithoutMRCluster(); UTIL.startMiniCluster(); @@ -376,7 +384,7 @@ public class TestImportExport { HTable exportT = new HTable(UTIL.getConfiguration(), EXPORT_TABLE); //Add first version of QUAL Put p = new Put(ROW1); - p.add(FAMILYA, QUAL, now, QUAL); +p.add(FAMILYA, QUAL, now, QUAL); exportT.put(p); //Add Delete family marker @@ -385,7 +393,7 @@ public class TestImportExport { //Add second version of QUAL p = new Put(ROW1); -p.add(FAMILYA, QUAL, now+5, "s".getBytes()); +p.add(FAMILYA, QUAL, now + 5, "s".getBytes()); exportT.put(p); //Add second Delete family marker
hbase git commit: HBASE-14915 Hanging test : org.apache.hadoop.hbase.mapreduce.TestImportExport (Heng Chen)
Repository: hbase Updated Branches: refs/heads/branch-1 1f37cdfb4 -> 3723baefe HBASE-14915 Hanging test : org.apache.hadoop.hbase.mapreduce.TestImportExport (Heng Chen) Project: http://git-wip-us.apache.org/repos/asf/hbase/repo Commit: http://git-wip-us.apache.org/repos/asf/hbase/commit/3723baef Tree: http://git-wip-us.apache.org/repos/asf/hbase/tree/3723baef Diff: http://git-wip-us.apache.org/repos/asf/hbase/diff/3723baef Branch: refs/heads/branch-1 Commit: 3723baefe35035d4692cf902d026156341924d98 Parents: 1f37cdf Author: chenhengAuthored: Sat Dec 12 11:28:14 2015 +0800 Committer: Mikhail Antonov Committed: Fri Jun 17 12:35:36 2016 -0700 -- .../apache/hadoop/hbase/mapreduce/TestImportExport.java | 12 ++-- 1 file changed, 10 insertions(+), 2 deletions(-) -- http://git-wip-us.apache.org/repos/asf/hbase/blob/3723baef/hbase-server/src/test/java/org/apache/hadoop/hbase/mapreduce/TestImportExport.java -- diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/mapreduce/TestImportExport.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/mapreduce/TestImportExport.java index e2131e9..1ed99e5 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/mapreduce/TestImportExport.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/mapreduce/TestImportExport.java @@ -43,6 +43,7 @@ import org.apache.hadoop.fs.Path; import org.apache.hadoop.hbase.HConstants; import org.apache.hadoop.hbase.Cell; import org.apache.hadoop.hbase.CellUtil; +import org.apache.hadoop.hbase.CategoryBasedTimeout; import org.apache.hadoop.hbase.HBaseTestingUtility; import org.apache.hadoop.hbase.HColumnDescriptor; import org.apache.hadoop.hbase.HRegionInfo; @@ -78,8 +79,10 @@ import org.junit.AfterClass; import org.junit.Assert; import org.junit.Before; import org.junit.BeforeClass; +import org.junit.Rule; import org.junit.Test; import org.junit.experimental.categories.Category; +import org.junit.rules.TestRule; import org.mockito.invocation.InvocationOnMock; import org.mockito.stubbing.Answer; @@ -104,9 +107,14 @@ public class TestImportExport { private static long now = System.currentTimeMillis(); + @Rule + public final TestRule timeout = CategoryBasedTimeout.builder().withTimeout(this.getClass()). + withLookingForStuckThread(true).build(); + @BeforeClass public static void beforeClass() throws Exception { // Up the handlers; this test needs more than usual. + UTIL.getConfiguration().setBoolean(HBaseTestingUtility.USE_LOCAL_FILESYSTEM, true); UTIL.getConfiguration().setInt(HConstants.REGION_SERVER_HIGH_PRIORITY_HANDLER_COUNT, 10); UTIL.setJobWithoutMRCluster(); UTIL.startMiniCluster(); @@ -376,7 +384,7 @@ public class TestImportExport { HTable exportT = new HTable(UTIL.getConfiguration(), EXPORT_TABLE); //Add first version of QUAL Put p = new Put(ROW1); - p.add(FAMILYA, QUAL, now, QUAL); +p.add(FAMILYA, QUAL, now, QUAL); exportT.put(p); //Add Delete family marker @@ -385,7 +393,7 @@ public class TestImportExport { //Add second version of QUAL p = new Put(ROW1); -p.add(FAMILYA, QUAL, now+5, "s".getBytes()); +p.add(FAMILYA, QUAL, now + 5, "s".getBytes()); exportT.put(p); //Add second Delete family marker
hbase git commit: HBASE-14730 region server needs to log warnings when there are attributes configured for cells with hfile v2 (huaxiang sun)
Repository: hbase Updated Branches: refs/heads/branch-1.3 083dc5abc -> 39ee3091a HBASE-14730 region server needs to log warnings when there are attributes configured for cells with hfile v2 (huaxiang sun) Project: http://git-wip-us.apache.org/repos/asf/hbase/repo Commit: http://git-wip-us.apache.org/repos/asf/hbase/commit/39ee3091 Tree: http://git-wip-us.apache.org/repos/asf/hbase/tree/39ee3091 Diff: http://git-wip-us.apache.org/repos/asf/hbase/diff/39ee3091 Branch: refs/heads/branch-1.3 Commit: 39ee3091a149dc85141b80a34a74f8f6283c4011 Parents: 083dc5a Author: Matteo BertozziAuthored: Thu Dec 17 09:31:04 2015 -0800 Committer: Mikhail Antonov Committed: Fri Jun 17 11:39:46 2016 -0700 -- .../org/apache/hadoop/hbase/io/hfile/HFileWriterV2.java | 10 ++ 1 file changed, 10 insertions(+) -- http://git-wip-us.apache.org/repos/asf/hbase/blob/39ee3091/hbase-server/src/main/java/org/apache/hadoop/hbase/io/hfile/HFileWriterV2.java -- diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/io/hfile/HFileWriterV2.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/io/hfile/HFileWriterV2.java index 4c8092f..47e7952 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/io/hfile/HFileWriterV2.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/io/hfile/HFileWriterV2.java @@ -88,6 +88,9 @@ public class HFileWriterV2 extends AbstractHFileWriter { protected long maxMemstoreTS = 0; + /** warn on cell with tags */ + private static boolean warnCellWithTags = true; + static class WriterFactoryV2 extends HFile.WriterFactory { WriterFactoryV2(Configuration conf, CacheConfig cacheConf) { super(conf, cacheConf); @@ -267,6 +270,13 @@ public class HFileWriterV2 extends AbstractHFileWriter { newBlock(); } +if (warnCellWithTags && getFileContext().isIncludesTags()) { + LOG.warn("A minimum HFile version of " + HFile.MIN_FORMAT_VERSION_WITH_TAGS + + " is required to support cell attributes/tags. Consider setting " + + HFile.FORMAT_VERSION_KEY + " accordingly."); + warnCellWithTags = false; +} + fsBlockWriter.write(cell); totalKeyLength += CellUtil.estimatedSerializedSizeOfKey(cell);
hbase git commit: HBASE-14730 region server needs to log warnings when there are attributes configured for cells with hfile v2 (huaxiang sun)
Repository: hbase Updated Branches: refs/heads/branch-1 d4a842948 -> 1f37cdfb4 HBASE-14730 region server needs to log warnings when there are attributes configured for cells with hfile v2 (huaxiang sun) Project: http://git-wip-us.apache.org/repos/asf/hbase/repo Commit: http://git-wip-us.apache.org/repos/asf/hbase/commit/1f37cdfb Tree: http://git-wip-us.apache.org/repos/asf/hbase/tree/1f37cdfb Diff: http://git-wip-us.apache.org/repos/asf/hbase/diff/1f37cdfb Branch: refs/heads/branch-1 Commit: 1f37cdfb4b970649d30a6ff41f00c7cf0b46aabc Parents: d4a8429 Author: Matteo BertozziAuthored: Thu Dec 17 09:31:04 2015 -0800 Committer: Mikhail Antonov Committed: Fri Jun 17 11:26:53 2016 -0700 -- .../org/apache/hadoop/hbase/io/hfile/HFileWriterV2.java | 10 ++ 1 file changed, 10 insertions(+) -- http://git-wip-us.apache.org/repos/asf/hbase/blob/1f37cdfb/hbase-server/src/main/java/org/apache/hadoop/hbase/io/hfile/HFileWriterV2.java -- diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/io/hfile/HFileWriterV2.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/io/hfile/HFileWriterV2.java index 4c8092f..47e7952 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/io/hfile/HFileWriterV2.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/io/hfile/HFileWriterV2.java @@ -88,6 +88,9 @@ public class HFileWriterV2 extends AbstractHFileWriter { protected long maxMemstoreTS = 0; + /** warn on cell with tags */ + private static boolean warnCellWithTags = true; + static class WriterFactoryV2 extends HFile.WriterFactory { WriterFactoryV2(Configuration conf, CacheConfig cacheConf) { super(conf, cacheConf); @@ -267,6 +270,13 @@ public class HFileWriterV2 extends AbstractHFileWriter { newBlock(); } +if (warnCellWithTags && getFileContext().isIncludesTags()) { + LOG.warn("A minimum HFile version of " + HFile.MIN_FORMAT_VERSION_WITH_TAGS + + " is required to support cell attributes/tags. Consider setting " + + HFile.FORMAT_VERSION_KEY + " accordingly."); + warnCellWithTags = false; +} + fsBlockWriter.write(cell); totalKeyLength += CellUtil.estimatedSerializedSizeOfKey(cell);
hbase git commit: HBASE-14581 Znode cleanup throws auth exception in secure mode
Repository: hbase Updated Branches: refs/heads/branch-1.3 f632b5329 -> 083dc5abc HBASE-14581 Znode cleanup throws auth exception in secure mode Project: http://git-wip-us.apache.org/repos/asf/hbase/repo Commit: http://git-wip-us.apache.org/repos/asf/hbase/commit/083dc5ab Tree: http://git-wip-us.apache.org/repos/asf/hbase/tree/083dc5ab Diff: http://git-wip-us.apache.org/repos/asf/hbase/diff/083dc5ab Branch: refs/heads/branch-1.3 Commit: 083dc5abc443091a9d7ab4ee0c9fb15b8a20c6ab Parents: f632b53 Author: tedyuAuthored: Sat Oct 10 01:59:57 2015 -0700 Committer: Mikhail Antonov Committed: Fri Jun 17 10:59:06 2016 -0700 -- bin/hbase-daemon.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) -- http://git-wip-us.apache.org/repos/asf/hbase/blob/083dc5ab/bin/hbase-daemon.sh -- diff --git a/bin/hbase-daemon.sh b/bin/hbase-daemon.sh index 6f0a524..3d1c4b0 100755 --- a/bin/hbase-daemon.sh +++ b/bin/hbase-daemon.sh @@ -81,11 +81,11 @@ cleanAfterRun() { if [ -f ${HBASE_ZNODE_FILE} ]; then if [ "$command" = "master" ]; then - $bin/hbase master clear > /dev/null 2>&1 + HBASE_OPTS="$HBASE_OPTS $HBASE_MASTER_OPTS" $bin/hbase master clear > /dev/null 2>&1 else #call ZK to delete the node ZNODE=`cat ${HBASE_ZNODE_FILE}` - $bin/hbase zkcli delete ${ZNODE} > /dev/null 2>&1 + HBASE_OPTS="$HBASE_OPTS $HBASE_REGIONSERVER_OPTS" $bin/hbase zkcli delete ${ZNODE} > /dev/null 2>&1 fi rm ${HBASE_ZNODE_FILE} fi
hbase git commit: HBASE-14581 Znode cleanup throws auth exception in secure mode
Repository: hbase Updated Branches: refs/heads/branch-1 419d15f83 -> d4a842948 HBASE-14581 Znode cleanup throws auth exception in secure mode Project: http://git-wip-us.apache.org/repos/asf/hbase/repo Commit: http://git-wip-us.apache.org/repos/asf/hbase/commit/d4a84294 Tree: http://git-wip-us.apache.org/repos/asf/hbase/tree/d4a84294 Diff: http://git-wip-us.apache.org/repos/asf/hbase/diff/d4a84294 Branch: refs/heads/branch-1 Commit: d4a842948a0c92ab5518d38a21b03d36359d4a4f Parents: 419d15f Author: tedyuAuthored: Sat Oct 10 01:59:57 2015 -0700 Committer: Mikhail Antonov Committed: Fri Jun 17 10:57:08 2016 -0700 -- bin/hbase-daemon.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) -- http://git-wip-us.apache.org/repos/asf/hbase/blob/d4a84294/bin/hbase-daemon.sh -- diff --git a/bin/hbase-daemon.sh b/bin/hbase-daemon.sh index 6f0a524..3d1c4b0 100755 --- a/bin/hbase-daemon.sh +++ b/bin/hbase-daemon.sh @@ -81,11 +81,11 @@ cleanAfterRun() { if [ -f ${HBASE_ZNODE_FILE} ]; then if [ "$command" = "master" ]; then - $bin/hbase master clear > /dev/null 2>&1 + HBASE_OPTS="$HBASE_OPTS $HBASE_MASTER_OPTS" $bin/hbase master clear > /dev/null 2>&1 else #call ZK to delete the node ZNODE=`cat ${HBASE_ZNODE_FILE}` - $bin/hbase zkcli delete ${ZNODE} > /dev/null 2>&1 + HBASE_OPTS="$HBASE_OPTS $HBASE_REGIONSERVER_OPTS" $bin/hbase zkcli delete ${ZNODE} > /dev/null 2>&1 fi rm ${HBASE_ZNODE_FILE} fi
hbase git commit: HBASE-14277 TestRegionServerHostname.testRegionServerHostname may fail at host with a case sensitive name
Repository: hbase Updated Branches: refs/heads/branch-1.3 c5f71f96e -> f632b5329 HBASE-14277 TestRegionServerHostname.testRegionServerHostname may fail at host with a case sensitive name Project: http://git-wip-us.apache.org/repos/asf/hbase/repo Commit: http://git-wip-us.apache.org/repos/asf/hbase/commit/f632b532 Tree: http://git-wip-us.apache.org/repos/asf/hbase/tree/f632b532 Diff: http://git-wip-us.apache.org/repos/asf/hbase/diff/f632b532 Branch: refs/heads/branch-1.3 Commit: f632b5329f39a3df9e18ac3fd3819904dee6c56e Parents: c5f71f9 Author: Liu ShaohuiAuthored: Mon Aug 24 09:59:32 2015 +0800 Committer: Mikhail Antonov Committed: Fri Jun 17 10:50:09 2016 -0700 -- .../apache/hadoop/hbase/regionserver/TestRegionServerHostname.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- http://git-wip-us.apache.org/repos/asf/hbase/blob/f632b532/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestRegionServerHostname.java -- diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestRegionServerHostname.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestRegionServerHostname.java index 29af324..ab1f253 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestRegionServerHostname.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestRegionServerHostname.java @@ -92,7 +92,7 @@ public class TestRegionServerHostname { } assertTrue(servers.size() == NUM_RS); for (String server : servers) { -assertTrue(server.startsWith(hostName+",")); +assertTrue(server.startsWith(hostName.toLowerCase()+",")); } zkw.close(); } finally {
hbase git commit: HBASE-14277 TestRegionServerHostname.testRegionServerHostname may fail at host with a case sensitive name
Repository: hbase Updated Branches: refs/heads/branch-1 755a5de47 -> 419d15f83 HBASE-14277 TestRegionServerHostname.testRegionServerHostname may fail at host with a case sensitive name Project: http://git-wip-us.apache.org/repos/asf/hbase/repo Commit: http://git-wip-us.apache.org/repos/asf/hbase/commit/419d15f8 Tree: http://git-wip-us.apache.org/repos/asf/hbase/tree/419d15f8 Diff: http://git-wip-us.apache.org/repos/asf/hbase/diff/419d15f8 Branch: refs/heads/branch-1 Commit: 419d15f834773b37cabd1494dad8e49dbe3082c5 Parents: 755a5de Author: Liu ShaohuiAuthored: Mon Aug 24 09:59:32 2015 +0800 Committer: Mikhail Antonov Committed: Fri Jun 17 10:49:21 2016 -0700 -- .../apache/hadoop/hbase/regionserver/TestRegionServerHostname.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- http://git-wip-us.apache.org/repos/asf/hbase/blob/419d15f8/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestRegionServerHostname.java -- diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestRegionServerHostname.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestRegionServerHostname.java index 29af324..ab1f253 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestRegionServerHostname.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestRegionServerHostname.java @@ -92,7 +92,7 @@ public class TestRegionServerHostname { } assertTrue(servers.size() == NUM_RS); for (String server : servers) { -assertTrue(server.startsWith(hostName+",")); +assertTrue(server.startsWith(hostName.toLowerCase()+",")); } zkw.close(); } finally {
hbase git commit: HBASE-15990 The priority value of subsequent coprocessors in the Coprocessor.Priority.SYSTEM list are not incremented by one (ChiaPing Tsai)
Repository: hbase Updated Branches: refs/heads/0.98 42de85763 -> a35162aff HBASE-15990 The priority value of subsequent coprocessors in the Coprocessor.Priority.SYSTEM list are not incremented by one (ChiaPing Tsai) Project: http://git-wip-us.apache.org/repos/asf/hbase/repo Commit: http://git-wip-us.apache.org/repos/asf/hbase/commit/a35162af Tree: http://git-wip-us.apache.org/repos/asf/hbase/tree/a35162af Diff: http://git-wip-us.apache.org/repos/asf/hbase/diff/a35162af Branch: refs/heads/0.98 Commit: a35162afff4b99dfbbb85e7b7354031dfb2919a7 Parents: 42de857 Author: tedyuAuthored: Thu Jun 9 11:20:33 2016 -0700 Committer: Andrew Purtell Committed: Fri Jun 17 09:57:01 2016 -0700 -- .../hbase/coprocessor/CoprocessorHost.java | 5 ++-- .../hbase/coprocessor/TestCoprocessorHost.java | 26 ++-- 2 files changed, 21 insertions(+), 10 deletions(-) -- http://git-wip-us.apache.org/repos/asf/hbase/blob/a35162af/hbase-server/src/main/java/org/apache/hadoop/hbase/coprocessor/CoprocessorHost.java -- diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/coprocessor/CoprocessorHost.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/coprocessor/CoprocessorHost.java index 2e3d0a5..ac35b4f 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/coprocessor/CoprocessorHost.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/coprocessor/CoprocessorHost.java @@ -182,9 +182,10 @@ public abstract class CoprocessorHost { implClass = cl.loadClass(className); // Add coprocessors as we go to guard against case where a coprocessor is specified twice // in the configuration -this.coprocessors.add(loadInstance(implClass, Coprocessor.PRIORITY_SYSTEM, conf)); +this.coprocessors.add(loadInstance(implClass, priority, conf)); LOG.info("System coprocessor " + className + " was loaded " + -"successfully with priority (" + priority++ + ")."); +"successfully with priority (" + priority + ")."); +++priority; } catch (Throwable t) { // We always abort if system coprocessors cannot be loaded abortServer(className, t); http://git-wip-us.apache.org/repos/asf/hbase/blob/a35162af/hbase-server/src/test/java/org/apache/hadoop/hbase/coprocessor/TestCoprocessorHost.java -- diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/coprocessor/TestCoprocessorHost.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/coprocessor/TestCoprocessorHost.java index 2faaf74..17d0b8e 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/coprocessor/TestCoprocessorHost.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/coprocessor/TestCoprocessorHost.java @@ -29,6 +29,8 @@ import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.client.HTableInterface; import org.apache.hadoop.hbase.testclassification.SmallTests; import org.junit.Assert; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNotNull; import org.junit.Test; import org.junit.experimental.categories.Category; @@ -51,9 +53,8 @@ public class TestCoprocessorHost { return this.aborted; } } - @Test - public void testDoubleLoading() { + public void testDoubleLoadingAndPriorityValue() { final Configuration conf = HBaseConfiguration.create(); CoprocessorHost host = new CoprocessorHost(new TestAbortable()) { @@ -61,7 +62,7 @@ public class TestCoprocessorHost { @Override public CoprocessorEnvironment createEnvironment(Class implClass, - final Coprocessor instance, int priority, int sequence, Configuration conf) { + final Coprocessor instance, final int priority, int sequence, Configuration conf) { return new CoprocessorEnvironment() { final Coprocessor envInstance = instance; @@ -82,7 +83,7 @@ public class TestCoprocessorHost { @Override public int getPriority() { -return 0; +return priority; } @Override @@ -115,10 +116,19 @@ public class TestCoprocessorHost { }; final String key = "KEY"; final String coprocessor = "org.apache.hadoop.hbase.coprocessor.SimpleRegionObserver"; -// Try and load coprocessor three times. -conf.setStrings(key, coprocessor, coprocessor, coprocessor); +// Try and load a coprocessor three times +conf.setStrings(key, coprocessor, coprocessor, coprocessor, SimpleRegionObserverV2.class.getName()); host.loadSystemCoprocessors(conf, key); -// Only one coprocessor loaded -Assert.assertEquals(1,
hbase git commit: HBASE-16048 Tag InternalScanner with LimitedPrivate(HBaseInterfaceAudience.COPROC)
Repository: hbase Updated Branches: refs/heads/0.98 394d3f023 -> 42de85763 HBASE-16048 Tag InternalScanner with LimitedPrivate(HBaseInterfaceAudience.COPROC) Project: http://git-wip-us.apache.org/repos/asf/hbase/repo Commit: http://git-wip-us.apache.org/repos/asf/hbase/commit/42de8576 Tree: http://git-wip-us.apache.org/repos/asf/hbase/tree/42de8576 Diff: http://git-wip-us.apache.org/repos/asf/hbase/diff/42de8576 Branch: refs/heads/0.98 Commit: 42de857632557ab810d58aa7191a34afd90a8d9b Parents: 394d3f0 Author: tedyuAuthored: Fri Jun 17 07:30:43 2016 -0700 Committer: Andrew Purtell Committed: Fri Jun 17 09:51:33 2016 -0700 -- .../org/apache/hadoop/hbase/regionserver/InternalScanner.java | 7 +-- 1 file changed, 5 insertions(+), 2 deletions(-) -- http://git-wip-us.apache.org/repos/asf/hbase/blob/42de8576/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/InternalScanner.java -- diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/InternalScanner.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/InternalScanner.java index 41708c0..2de62f8 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/InternalScanner.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/InternalScanner.java @@ -22,8 +22,10 @@ import java.io.Closeable; import java.io.IOException; import java.util.List; -import org.apache.hadoop.hbase.classification.InterfaceAudience; import org.apache.hadoop.hbase.Cell; +import org.apache.hadoop.hbase.HBaseInterfaceAudience; +import org.apache.hadoop.hbase.classification.InterfaceAudience; +import org.apache.hadoop.hbase.classification.InterfaceStability; /** * Internal scanners differ from client-side scanners in that they operate on @@ -39,7 +41,8 @@ import org.apache.hadoop.hbase.Cell; * all the family members, as they may have been last updated at different * times. */ -@InterfaceAudience.Private +@InterfaceAudience.LimitedPrivate(HBaseInterfaceAudience.COPROC) +@InterfaceStability.Evolving public interface InternalScanner extends Closeable { /** * Grab the next row's worth of values.
hbase git commit: HBASE-16048 Tag InternalScanner with LimitedPrivate(HBaseInterfaceAudience.COPROC)
Repository: hbase Updated Branches: refs/heads/branch-1 45a0fc531 -> 755a5de47 HBASE-16048 Tag InternalScanner with LimitedPrivate(HBaseInterfaceAudience.COPROC) Project: http://git-wip-us.apache.org/repos/asf/hbase/repo Commit: http://git-wip-us.apache.org/repos/asf/hbase/commit/755a5de4 Tree: http://git-wip-us.apache.org/repos/asf/hbase/tree/755a5de4 Diff: http://git-wip-us.apache.org/repos/asf/hbase/diff/755a5de4 Branch: refs/heads/branch-1 Commit: 755a5de4700dcaa801319ee61fbbe4bb9f4ecb0a Parents: 45a0fc5 Author: tedyuAuthored: Fri Jun 17 07:30:43 2016 -0700 Committer: tedyu Committed: Fri Jun 17 07:30:43 2016 -0700 -- .../org/apache/hadoop/hbase/regionserver/InternalScanner.java | 5 - 1 file changed, 4 insertions(+), 1 deletion(-) -- http://git-wip-us.apache.org/repos/asf/hbase/blob/755a5de4/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/InternalScanner.java -- diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/InternalScanner.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/InternalScanner.java index f73e363..a255b85 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/InternalScanner.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/InternalScanner.java @@ -23,7 +23,9 @@ import java.io.IOException; import java.util.List; import org.apache.hadoop.hbase.Cell; +import org.apache.hadoop.hbase.HBaseInterfaceAudience; import org.apache.hadoop.hbase.classification.InterfaceAudience; +import org.apache.hadoop.hbase.classification.InterfaceStability; /** * Internal scanners differ from client-side scanners in that they operate on @@ -39,7 +41,8 @@ import org.apache.hadoop.hbase.classification.InterfaceAudience; * all the family members, as they may have been last updated at different * times. */ -@InterfaceAudience.Private +@InterfaceAudience.LimitedPrivate(HBaseInterfaceAudience.COPROC) +@InterfaceStability.Evolving public interface InternalScanner extends Closeable { /** * Grab the next row's worth of values.
hbase git commit: HBASE-16048 Tag InternalScanner with LimitedPrivate(HBaseInterfaceAudience.COPROC)
Repository: hbase Updated Branches: refs/heads/branch-1.3 9fde544b0 -> c5f71f96e HBASE-16048 Tag InternalScanner with LimitedPrivate(HBaseInterfaceAudience.COPROC) Project: http://git-wip-us.apache.org/repos/asf/hbase/repo Commit: http://git-wip-us.apache.org/repos/asf/hbase/commit/c5f71f96 Tree: http://git-wip-us.apache.org/repos/asf/hbase/tree/c5f71f96 Diff: http://git-wip-us.apache.org/repos/asf/hbase/diff/c5f71f96 Branch: refs/heads/branch-1.3 Commit: c5f71f96e79903c1fcaf334979b01d8cee56c90a Parents: 9fde544 Author: tedyuAuthored: Fri Jun 17 07:28:58 2016 -0700 Committer: tedyu Committed: Fri Jun 17 07:28:58 2016 -0700 -- .../org/apache/hadoop/hbase/regionserver/InternalScanner.java | 5 - 1 file changed, 4 insertions(+), 1 deletion(-) -- http://git-wip-us.apache.org/repos/asf/hbase/blob/c5f71f96/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/InternalScanner.java -- diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/InternalScanner.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/InternalScanner.java index f73e363..a255b85 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/InternalScanner.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/InternalScanner.java @@ -23,7 +23,9 @@ import java.io.IOException; import java.util.List; import org.apache.hadoop.hbase.Cell; +import org.apache.hadoop.hbase.HBaseInterfaceAudience; import org.apache.hadoop.hbase.classification.InterfaceAudience; +import org.apache.hadoop.hbase.classification.InterfaceStability; /** * Internal scanners differ from client-side scanners in that they operate on @@ -39,7 +41,8 @@ import org.apache.hadoop.hbase.classification.InterfaceAudience; * all the family members, as they may have been last updated at different * times. */ -@InterfaceAudience.Private +@InterfaceAudience.LimitedPrivate(HBaseInterfaceAudience.COPROC) +@InterfaceStability.Evolving public interface InternalScanner extends Closeable { /** * Grab the next row's worth of values.
hbase git commit: HBASE-16048 Tag InternalScanner with LimitedPrivate(HBaseInterfaceAudience.COPROC)
Repository: hbase Updated Branches: refs/heads/master 3abd52bdc -> 5147fb12a HBASE-16048 Tag InternalScanner with LimitedPrivate(HBaseInterfaceAudience.COPROC) Project: http://git-wip-us.apache.org/repos/asf/hbase/repo Commit: http://git-wip-us.apache.org/repos/asf/hbase/commit/5147fb12 Tree: http://git-wip-us.apache.org/repos/asf/hbase/tree/5147fb12 Diff: http://git-wip-us.apache.org/repos/asf/hbase/diff/5147fb12 Branch: refs/heads/master Commit: 5147fb12a5b7f6ba6a59e05cf07e847340cc8b66 Parents: 3abd52b Author: tedyuAuthored: Fri Jun 17 07:27:52 2016 -0700 Committer: tedyu Committed: Fri Jun 17 07:27:52 2016 -0700 -- .../org/apache/hadoop/hbase/regionserver/InternalScanner.java | 5 - 1 file changed, 4 insertions(+), 1 deletion(-) -- http://git-wip-us.apache.org/repos/asf/hbase/blob/5147fb12/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/InternalScanner.java -- diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/InternalScanner.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/InternalScanner.java index f73e363..a255b85 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/InternalScanner.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/InternalScanner.java @@ -23,7 +23,9 @@ import java.io.IOException; import java.util.List; import org.apache.hadoop.hbase.Cell; +import org.apache.hadoop.hbase.HBaseInterfaceAudience; import org.apache.hadoop.hbase.classification.InterfaceAudience; +import org.apache.hadoop.hbase.classification.InterfaceStability; /** * Internal scanners differ from client-side scanners in that they operate on @@ -39,7 +41,8 @@ import org.apache.hadoop.hbase.classification.InterfaceAudience; * all the family members, as they may have been last updated at different * times. */ -@InterfaceAudience.Private +@InterfaceAudience.LimitedPrivate(HBaseInterfaceAudience.COPROC) +@InterfaceStability.Evolving public interface InternalScanner extends Closeable { /** * Grab the next row's worth of values.