From commits-return-65150-archive-asf-public=cust-asf.ponee.io@hbase.apache.org Thu Jan 11 16:31:03 2018 Return-Path: X-Original-To: archive-asf-public@eu.ponee.io Delivered-To: archive-asf-public@eu.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by mx-eu-01.ponee.io (Postfix) with ESMTP id 473AD180656 for ; Thu, 11 Jan 2018 16:31:03 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id 36F39160C4E; Thu, 11 Jan 2018 15:31:03 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 2FC6D160C49 for ; Thu, 11 Jan 2018 16:31:00 +0100 (CET) Received: (qmail 3347 invoked by uid 500); 11 Jan 2018 15:30:57 -0000 Mailing-List: contact commits-help@hbase.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@hbase.apache.org Delivered-To: mailing list commits@hbase.apache.org Received: (qmail 1982 invoked by uid 99); 11 Jan 2018 15:30:56 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 11 Jan 2018 15:30:56 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id E9D1BF3303; Thu, 11 Jan 2018 15:30:51 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: git-site-role@apache.org To: commits@hbase.apache.org Date: Thu, 11 Jan 2018 15:31:23 -0000 Message-Id: In-Reply-To: References: X-Mailer: ASF-Git Admin Mailer Subject: [34/51] [partial] hbase-site git commit: Published site at . http://git-wip-us.apache.org/repos/asf/hbase-site/blob/f183e80f/devapidocs/src-html/org/apache/hadoop/hbase/regionserver/querymatcher/UserScanQueryMatcher.html ---------------------------------------------------------------------- diff --git a/devapidocs/src-html/org/apache/hadoop/hbase/regionserver/querymatcher/UserScanQueryMatcher.html b/devapidocs/src-html/org/apache/hadoop/hbase/regionserver/querymatcher/UserScanQueryMatcher.html index 6096dcc..3cb24fc 100644 --- a/devapidocs/src-html/org/apache/hadoop/hbase/regionserver/querymatcher/UserScanQueryMatcher.html +++ b/devapidocs/src-html/org/apache/hadoop/hbase/regionserver/querymatcher/UserScanQueryMatcher.html @@ -245,56 +245,62 @@ 237 count += 1; 238 239 if (count > versionsAfterFilter) { -240 return MatchCode.SEEK_NEXT_COL; -241 } else { -242 if (matchCode == MatchCode.INCLUDE_AND_SEEK_NEXT_COL) { -243 // Update column tracker to next column, As we use the column hint from the tracker to seek -244 // to next cell -245 columns.doneWithColumn(cell); -246 } -247 return matchCode; +240 // when the number of cells exceed max version in scan, we should return SEEK_NEXT_COL match +241 // code, but if current code is INCLUDE_AND_SEEK_NEXT_ROW, we can optimize to choose the max +242 // step between SEEK_NEXT_COL and INCLUDE_AND_SEEK_NEXT_ROW, which is SEEK_NEXT_ROW. +243 if (matchCode == MatchCode.INCLUDE_AND_SEEK_NEXT_ROW) { +244 matchCode = MatchCode.SEEK_NEXT_ROW; +245 } else { +246 matchCode = MatchCode.SEEK_NEXT_COL; +247 } 248 } -249 } -250 -251 protected abstract boolean isGet(); -252 -253 protected abstract boolean moreRowsMayExistsAfter(int cmpToStopRow); -254 -255 @Override -256 public boolean moreRowsMayExistAfter(Cell cell) { -257 // If a 'get' Scan -- we are doing a Get (every Get is a single-row Scan in implementation) -- -258 // then we are looking at one row only, the one specified in the Get coordinate..so we know -259 // for sure that there are no more rows on this Scan -260 if (isGet()) { -261 return false; -262 } -263 // If no stopRow, return that there may be more rows. The tests that follow depend on a -264 // non-empty, non-default stopRow so this little test below short-circuits out doing the -265 // following compares. -266 if (this.stopRow == null || this.stopRow.length == 0) { -267 return true; +249 if (matchCode == MatchCode.INCLUDE_AND_SEEK_NEXT_COL || matchCode == MatchCode.SEEK_NEXT_COL) { +250 // Update column tracker to next column, As we use the column hint from the tracker to seek +251 // to next cell (HBASE-19749) +252 columns.doneWithColumn(cell); +253 } +254 return matchCode; +255 } +256 +257 protected abstract boolean isGet(); +258 +259 protected abstract boolean moreRowsMayExistsAfter(int cmpToStopRow); +260 +261 @Override +262 public boolean moreRowsMayExistAfter(Cell cell) { +263 // If a 'get' Scan -- we are doing a Get (every Get is a single-row Scan in implementation) -- +264 // then we are looking at one row only, the one specified in the Get coordinate..so we know +265 // for sure that there are no more rows on this Scan +266 if (isGet()) { +267 return false; 268 } -269 return moreRowsMayExistsAfter(rowComparator.compareRows(cell, stopRow, 0, stopRow.length)); -270 } -271 -272 public static UserScanQueryMatcher create(Scan scan, ScanInfo scanInfo, -273 NavigableSet<byte[]> columns, long oldestUnexpiredTS, long now, -274 RegionCoprocessorHost regionCoprocessorHost) throws IOException { -275 boolean hasNullColumn = -276 !(columns != null && columns.size() != 0 && columns.first().length != 0); -277 Pair<DeleteTracker, ColumnTracker> trackers = getTrackers(regionCoprocessorHost, columns, -278 scanInfo, oldestUnexpiredTS, scan); -279 DeleteTracker deleteTracker = trackers.getFirst(); -280 ColumnTracker columnTracker = trackers.getSecond(); -281 if (scan.isRaw()) { -282 return RawScanQueryMatcher.create(scan, scanInfo, columnTracker, hasNullColumn, -283 oldestUnexpiredTS, now); -284 } else { -285 return NormalUserScanQueryMatcher.create(scan, scanInfo, columnTracker, deleteTracker, -286 hasNullColumn, oldestUnexpiredTS, now); -287 } -288 } -289} +269 // If no stopRow, return that there may be more rows. The tests that follow depend on a +270 // non-empty, non-default stopRow so this little test below short-circuits out doing the +271 // following compares. +272 if (this.stopRow == null || this.stopRow.length == 0) { +273 return true; +274 } +275 return moreRowsMayExistsAfter(rowComparator.compareRows(cell, stopRow, 0, stopRow.length)); +276 } +277 +278 public static UserScanQueryMatcher create(Scan scan, ScanInfo scanInfo, +279 NavigableSet<byte[]> columns, long oldestUnexpiredTS, long now, +280 RegionCoprocessorHost regionCoprocessorHost) throws IOException { +281 boolean hasNullColumn = +282 !(columns != null && columns.size() != 0 && columns.first().length != 0); +283 Pair<DeleteTracker, ColumnTracker> trackers = getTrackers(regionCoprocessorHost, columns, +284 scanInfo, oldestUnexpiredTS, scan); +285 DeleteTracker deleteTracker = trackers.getFirst(); +286 ColumnTracker columnTracker = trackers.getSecond(); +287 if (scan.isRaw()) { +288 return RawScanQueryMatcher.create(scan, scanInfo, columnTracker, hasNullColumn, +289 oldestUnexpiredTS, now); +290 } else { +291 return NormalUserScanQueryMatcher.create(scan, scanInfo, columnTracker, deleteTracker, +292 hasNullColumn, oldestUnexpiredTS, now); +293 } +294 } +295} http://git-wip-us.apache.org/repos/asf/hbase-site/blob/f183e80f/devapidocs/src-html/org/apache/hadoop/hbase/replication/ReplicationPeerConfig.ReplicationPeerConfigBuilderImpl.html ---------------------------------------------------------------------- diff --git a/devapidocs/src-html/org/apache/hadoop/hbase/replication/ReplicationPeerConfig.ReplicationPeerConfigBuilderImpl.html b/devapidocs/src-html/org/apache/hadoop/hbase/replication/ReplicationPeerConfig.ReplicationPeerConfigBuilderImpl.html index af76dd3..bce1a69 100644 --- a/devapidocs/src-html/org/apache/hadoop/hbase/replication/ReplicationPeerConfig.ReplicationPeerConfigBuilderImpl.html +++ b/devapidocs/src-html/org/apache/hadoop/hbase/replication/ReplicationPeerConfig.ReplicationPeerConfigBuilderImpl.html @@ -322,59 +322,61 @@ 314 315 @Override 316 public ReplicationPeerConfig build() { -317 return new ReplicationPeerConfig(this); -318 } -319 } -320 -321 @Override -322 public String toString() { -323 StringBuilder builder = new StringBuilder("clusterKey=").append(clusterKey).append(","); -324 builder.append("replicationEndpointImpl=").append(replicationEndpointImpl).append(","); -325 builder.append("replicateAllUserTables=").append(replicateAllUserTables).append(","); -326 if (replicateAllUserTables) { -327 if (excludeNamespaces != null) { -328 builder.append("excludeNamespaces=").append(excludeNamespaces.toString()).append(","); -329 } -330 if (excludeTableCFsMap != null) { -331 builder.append("excludeTableCFsMap=").append(excludeTableCFsMap.toString()).append(","); -332 } -333 } else { -334 if (namespaces != null) { -335 builder.append("namespaces=").append(namespaces.toString()).append(","); -336 } -337 if (tableCFsMap != null) { -338 builder.append("tableCFs=").append(tableCFsMap.toString()).append(","); -339 } -340 } -341 builder.append("bandwidth=").append(bandwidth); -342 return builder.toString(); -343 } -344 -345 /** -346 * Decide whether the table need replicate to the peer cluster -347 * @param table name of the table -348 * @return true if the table need replicate to the peer cluster -349 */ -350 public boolean needToReplicate(TableName table) { -351 if (replicateAllUserTables) { -352 if (excludeNamespaces != null && excludeNamespaces.contains(table.getNamespaceAsString())) { -353 return false; -354 } -355 if (excludeTableCFsMap != null && excludeTableCFsMap.containsKey(table)) { -356 return false; -357 } -358 return true; -359 } else { -360 if (namespaces != null && namespaces.contains(table.getNamespaceAsString())) { -361 return true; -362 } -363 if (tableCFsMap != null && tableCFsMap.containsKey(table)) { -364 return true; -365 } -366 return false; -367 } -368 } -369} +317 // It would be nice to validate the configuration, but we have to work with "old" data +318 // from ZK which makes it much more difficult. +319 return new ReplicationPeerConfig(this); +320 } +321 } +322 +323 @Override +324 public String toString() { +325 StringBuilder builder = new StringBuilder("clusterKey=").append(clusterKey).append(","); +326 builder.append("replicationEndpointImpl=").append(replicationEndpointImpl).append(","); +327 builder.append("replicateAllUserTables=").append(replicateAllUserTables).append(","); +328 if (replicateAllUserTables) { +329 if (excludeNamespaces != null) { +330 builder.append("excludeNamespaces=").append(excludeNamespaces.toString()).append(","); +331 } +332 if (excludeTableCFsMap != null) { +333 builder.append("excludeTableCFsMap=").append(excludeTableCFsMap.toString()).append(","); +334 } +335 } else { +336 if (namespaces != null) { +337 builder.append("namespaces=").append(namespaces.toString()).append(","); +338 } +339 if (tableCFsMap != null) { +340 builder.append("tableCFs=").append(tableCFsMap.toString()).append(","); +341 } +342 } +343 builder.append("bandwidth=").append(bandwidth); +344 return builder.toString(); +345 } +346 +347 /** +348 * Decide whether the table need replicate to the peer cluster +349 * @param table name of the table +350 * @return true if the table need replicate to the peer cluster +351 */ +352 public boolean needToReplicate(TableName table) { +353 if (replicateAllUserTables) { +354 if (excludeNamespaces != null && excludeNamespaces.contains(table.getNamespaceAsString())) { +355 return false; +356 } +357 if (excludeTableCFsMap != null && excludeTableCFsMap.containsKey(table)) { +358 return false; +359 } +360 return true; +361 } else { +362 if (namespaces != null && namespaces.contains(table.getNamespaceAsString())) { +363 return true; +364 } +365 if (tableCFsMap != null && tableCFsMap.containsKey(table)) { +366 return true; +367 } +368 return false; +369 } +370 } +371} http://git-wip-us.apache.org/repos/asf/hbase-site/blob/f183e80f/devapidocs/src-html/org/apache/hadoop/hbase/replication/ReplicationPeerConfig.html ---------------------------------------------------------------------- diff --git a/devapidocs/src-html/org/apache/hadoop/hbase/replication/ReplicationPeerConfig.html b/devapidocs/src-html/org/apache/hadoop/hbase/replication/ReplicationPeerConfig.html index af76dd3..bce1a69 100644 --- a/devapidocs/src-html/org/apache/hadoop/hbase/replication/ReplicationPeerConfig.html +++ b/devapidocs/src-html/org/apache/hadoop/hbase/replication/ReplicationPeerConfig.html @@ -322,59 +322,61 @@ 314 315 @Override 316 public ReplicationPeerConfig build() { -317 return new ReplicationPeerConfig(this); -318 } -319 } -320 -321 @Override -322 public String toString() { -323 StringBuilder builder = new StringBuilder("clusterKey=").append(clusterKey).append(","); -324 builder.append("replicationEndpointImpl=").append(replicationEndpointImpl).append(","); -325 builder.append("replicateAllUserTables=").append(replicateAllUserTables).append(","); -326 if (replicateAllUserTables) { -327 if (excludeNamespaces != null) { -328 builder.append("excludeNamespaces=").append(excludeNamespaces.toString()).append(","); -329 } -330 if (excludeTableCFsMap != null) { -331 builder.append("excludeTableCFsMap=").append(excludeTableCFsMap.toString()).append(","); -332 } -333 } else { -334 if (namespaces != null) { -335 builder.append("namespaces=").append(namespaces.toString()).append(","); -336 } -337 if (tableCFsMap != null) { -338 builder.append("tableCFs=").append(tableCFsMap.toString()).append(","); -339 } -340 } -341 builder.append("bandwidth=").append(bandwidth); -342 return builder.toString(); -343 } -344 -345 /** -346 * Decide whether the table need replicate to the peer cluster -347 * @param table name of the table -348 * @return true if the table need replicate to the peer cluster -349 */ -350 public boolean needToReplicate(TableName table) { -351 if (replicateAllUserTables) { -352 if (excludeNamespaces != null && excludeNamespaces.contains(table.getNamespaceAsString())) { -353 return false; -354 } -355 if (excludeTableCFsMap != null && excludeTableCFsMap.containsKey(table)) { -356 return false; -357 } -358 return true; -359 } else { -360 if (namespaces != null && namespaces.contains(table.getNamespaceAsString())) { -361 return true; -362 } -363 if (tableCFsMap != null && tableCFsMap.containsKey(table)) { -364 return true; -365 } -366 return false; -367 } -368 } -369} +317 // It would be nice to validate the configuration, but we have to work with "old" data +318 // from ZK which makes it much more difficult. +319 return new ReplicationPeerConfig(this); +320 } +321 } +322 +323 @Override +324 public String toString() { +325 StringBuilder builder = new StringBuilder("clusterKey=").append(clusterKey).append(","); +326 builder.append("replicationEndpointImpl=").append(replicationEndpointImpl).append(","); +327 builder.append("replicateAllUserTables=").append(replicateAllUserTables).append(","); +328 if (replicateAllUserTables) { +329 if (excludeNamespaces != null) { +330 builder.append("excludeNamespaces=").append(excludeNamespaces.toString()).append(","); +331 } +332 if (excludeTableCFsMap != null) { +333 builder.append("excludeTableCFsMap=").append(excludeTableCFsMap.toString()).append(","); +334 } +335 } else { +336 if (namespaces != null) { +337 builder.append("namespaces=").append(namespaces.toString()).append(","); +338 } +339 if (tableCFsMap != null) { +340 builder.append("tableCFs=").append(tableCFsMap.toString()).append(","); +341 } +342 } +343 builder.append("bandwidth=").append(bandwidth); +344 return builder.toString(); +345 } +346 +347 /** +348 * Decide whether the table need replicate to the peer cluster +349 * @param table name of the table +350 * @return true if the table need replicate to the peer cluster +351 */ +352 public boolean needToReplicate(TableName table) { +353 if (replicateAllUserTables) { +354 if (excludeNamespaces != null && excludeNamespaces.contains(table.getNamespaceAsString())) { +355 return false; +356 } +357 if (excludeTableCFsMap != null && excludeTableCFsMap.containsKey(table)) { +358 return false; +359 } +360 return true; +361 } else { +362 if (namespaces != null && namespaces.contains(table.getNamespaceAsString())) { +363 return true; +364 } +365 if (tableCFsMap != null && tableCFsMap.containsKey(table)) { +366 return true; +367 } +368 return false; +369 } +370 } +371} http://git-wip-us.apache.org/repos/asf/hbase-site/blob/f183e80f/devapidocs/src-html/org/apache/hadoop/hbase/replication/ReplicationPeerConfigBuilder.html ---------------------------------------------------------------------- diff --git a/devapidocs/src-html/org/apache/hadoop/hbase/replication/ReplicationPeerConfigBuilder.html b/devapidocs/src-html/org/apache/hadoop/hbase/replication/ReplicationPeerConfigBuilder.html index 03841fd..d5f38b8 100644 --- a/devapidocs/src-html/org/apache/hadoop/hbase/replication/ReplicationPeerConfigBuilder.html +++ b/devapidocs/src-html/org/apache/hadoop/hbase/replication/ReplicationPeerConfigBuilder.html @@ -51,35 +51,106 @@ 043 */ 044 ReplicationPeerConfigBuilder setReplicationEndpointImpl(String replicationEndpointImpl); 045 -046 ReplicationPeerConfigBuilder putConfiguration(String key, String value); -047 -048 default ReplicationPeerConfigBuilder putAllConfiguration(Map<String, String> configuration) { -049 configuration.forEach(this::putConfiguration); -050 return this; -051 } -052 -053 ReplicationPeerConfigBuilder putPeerData(byte[] key, byte[] value); +046 /** +047 * Sets a "raw" configuration property for this replication peer. For experts only. +048 * @param key Configuration property key +049 * @param value Configuration property value +050 * @return {@code this} +051 */ +052 @InterfaceAudience.Private +053 ReplicationPeerConfigBuilder putConfiguration(String key, String value); 054 -055 default ReplicationPeerConfigBuilder putAllPeerData(Map<byte[], byte[]> peerData) { -056 peerData.forEach(this::putPeerData); -057 return this; -058 } -059 -060 ReplicationPeerConfigBuilder -061 setTableCFsMap(Map<TableName, List<String>> tableCFsMap); -062 -063 ReplicationPeerConfigBuilder setNamespaces(Set<String> namespaces); -064 -065 ReplicationPeerConfigBuilder setBandwidth(long bandwidth); -066 -067 ReplicationPeerConfigBuilder setReplicateAllUserTables(boolean replicateAllUserTables); -068 -069 ReplicationPeerConfigBuilder setExcludeTableCFsMap(Map<TableName, List<String>> tableCFsMap); -070 -071 ReplicationPeerConfigBuilder setExcludeNamespaces(Set<String> namespaces); +055 /** +056 * Adds all of the provided "raw" configuration entries to {@code this}. +057 * @param configuration A collection of raw configuration entries +058 * @return {@code this} +059 */ +060 @InterfaceAudience.Private +061 default ReplicationPeerConfigBuilder putAllConfiguration(Map<String, String> configuration) { +062 configuration.forEach(this::putConfiguration); +063 return this; +064 } +065 +066 /** +067 * Sets the serialized peer configuration data +068 * @return {@code this} +069 */ +070 @InterfaceAudience.Private +071 ReplicationPeerConfigBuilder putPeerData(byte[] key, byte[] value); 072 -073 ReplicationPeerConfig build(); -074} +073 /** +074 * Sets all of the provided serialized peer configuration data. +075 * @return {@code this} +076 */ +077 @InterfaceAudience.Private +078 default ReplicationPeerConfigBuilder putAllPeerData(Map<byte[], byte[]> peerData) { +079 peerData.forEach(this::putPeerData); +080 return this; +081 } +082 +083 /** +084 * Sets an explicit map of tables and column families in those tables that should be replicated +085 * to the given peer. Use {@link #setReplicateAllUserTables(boolean)} to replicate all tables +086 * to a peer. +087 * +088 * @param tableCFsMap A map from tableName to column family names. An empty collection can be +089 * passed to indicate replicating all column families. +090 * @return {@code this} +091 * @see #setReplicateAllUserTables(boolean) +092 */ +093 ReplicationPeerConfigBuilder +094 setTableCFsMap(Map<TableName, List<String>> tableCFsMap); +095 +096 /** +097 * Sets a unique collection of HBase namespaces that should be replicated to this peer. +098 * @param namespaces A set of namespaces to be replicated to this peer. +099 * @return {@code this} +100 */ +101 ReplicationPeerConfigBuilder setNamespaces(Set<String> namespaces); +102 +103 /** +104 * Sets the speed, in bytes per second, for any one RegionServer to replicate data to the peer. +105 * @param bandwidth Bytes per second +106 * @return {@code this}. +107 */ +108 ReplicationPeerConfigBuilder setBandwidth(long bandwidth); +109 +110 /** +111 * Configures HBase to replicate all user tables (not system tables) to the peer. Default is +112 * {@code true}. +113 * @param replicateAllUserTables True if all user tables should be replicated, else false. +114 * @return {@code this} +115 */ +116 ReplicationPeerConfigBuilder setReplicateAllUserTables(boolean replicateAllUserTables); +117 +118 /** +119 * Sets the mapping of table name to column families which should not be replicated. This +120 * method sets state which is mutually exclusive to {@link #setTableCFsMap(Map)}. Invoking this +121 * method is only relevant when all user tables are being replicated. +122 * +123 * @param tableCFsMap A mapping of table names to column families which should not be +124 * replicated. An empty list of column families implies all families for the table. +125 * @return {@code this}. +126 */ +127 ReplicationPeerConfigBuilder setExcludeTableCFsMap(Map<TableName, List<String>> tableCFsMap); +128 +129 /** +130 * Sets the collection of namespaces which should not be replicated when all user tables are +131 * configured to be replicated. This method sets state which is mutually exclusive to +132 * {@link #setNamespaces(Set)}. Invoking this method is only relevant when all user tables are +133 * being replicated. +134 * +135 * @param namespaces A set of namespaces whose tables should not be replicated. +136 * @return {@code this} +137 */ +138 ReplicationPeerConfigBuilder setExcludeNamespaces(Set<String> namespaces); +139 +140 /** +141 * Builds the configuration object from the current state of {@code this}. +142 * @return A {@link ReplicationPeerConfig} instance. +143 */ +144 ReplicationPeerConfig build(); +145}