HBASE-27401 Clean up current broken 'n's in our javadoc (#4812)
Signed-off-by: Andrew Purtell <apurtell@apache.org>
This commit is contained in:
parent
feccf958e1
commit
63cdd026f0
|
@ -368,7 +368,7 @@ public final class FanOutOneBlockAsyncDFSOutputSaslHelper {
|
|||
* Create a ByteString from byte array without copying (wrap), and then set it as the payload
|
||||
* for the builder.
|
||||
* @param builder builder for HDFS DataTransferEncryptorMessage.
|
||||
* @param payload byte array of payload. n
|
||||
* @param payload byte array of payload.
|
||||
*/
|
||||
static void wrapAndSetPayload(DataTransferEncryptorMessageProto.Builder builder,
|
||||
byte[] payload) throws IOException {
|
||||
|
|
|
@ -165,7 +165,7 @@ public class BackupManager implements Closeable {
|
|||
}
|
||||
|
||||
/**
|
||||
* Get configuration n
|
||||
* Get configuration
|
||||
*/
|
||||
Configuration getConf() {
|
||||
return conf;
|
||||
|
@ -192,7 +192,8 @@ public class BackupManager implements Closeable {
|
|||
* @param tableList table list
|
||||
* @param targetRootDir root dir
|
||||
* @param workers number of parallel workers
|
||||
* @param bandwidth bandwidth per worker in MB per sec n * @throws BackupException exception
|
||||
* @param bandwidth bandwidth per worker in MB per sec
|
||||
* @throws BackupException exception
|
||||
*/
|
||||
public BackupInfo createBackupInfo(String backupId, BackupType type, List<TableName> tableList,
|
||||
String targetRootDir, int workers, long bandwidth) throws BackupException {
|
||||
|
|
|
@ -184,9 +184,7 @@ public class FavoredNodeAssignmentHelper {
|
|||
return servers;
|
||||
}
|
||||
|
||||
/**
|
||||
* n * @return PB'ed bytes of {@link FavoredNodes} generated by the server list.
|
||||
*/
|
||||
/** Returns PB'ed bytes of {@link FavoredNodes} generated by the server list. */
|
||||
public static byte[] getFavoredNodes(List<ServerName> serverAddrList) {
|
||||
FavoredNodes.Builder f = FavoredNodes.newBuilder();
|
||||
for (ServerName s : serverAddrList) {
|
||||
|
@ -319,8 +317,8 @@ public class FavoredNodeAssignmentHelper {
|
|||
|
||||
/**
|
||||
* For regions that share the primary, avoid placing the secondary and tertiary on a same RS. Used
|
||||
* for generating new assignments for the primary/secondary/tertiary RegionServers n * @return the
|
||||
* map of regions to the servers the region-files should be hosted on
|
||||
* for generating new assignments for the primary/secondary/tertiary RegionServers
|
||||
* @return the map of regions to the servers the region-files should be hosted on
|
||||
*/
|
||||
public Map<RegionInfo, ServerName[]>
|
||||
placeSecondaryAndTertiaryWithRestrictions(Map<RegionInfo, ServerName> primaryRSMap) {
|
||||
|
|
|
@ -80,7 +80,7 @@ public class FavoredNodesPlan {
|
|||
|
||||
/**
|
||||
* Return the position of the server in the favoredNodes list. Assumes the favoredNodes list is of
|
||||
* size 3. n
|
||||
* size 3.
|
||||
*/
|
||||
public static Position getFavoredServerPosition(List<ServerName> favoredNodes,
|
||||
ServerName server) {
|
||||
|
|
|
@ -294,7 +294,7 @@ public class AssignmentVerificationReport {
|
|||
}
|
||||
|
||||
/**
|
||||
* Use this to project the dispersion scores nnn
|
||||
* Use this to project the dispersion scores
|
||||
*/
|
||||
public void fillUpDispersion(TableName tableName, SnapshotOfRegionAssignmentFromMeta snapshot,
|
||||
FavoredNodesPlan newPlan) {
|
||||
|
@ -566,7 +566,8 @@ public class AssignmentVerificationReport {
|
|||
|
||||
/**
|
||||
* Return the number of regions based on the position (primary/secondary/ tertiary) assigned to
|
||||
* their favored nodes n * @return the number of regions
|
||||
* their favored nodes
|
||||
* @return the number of regions
|
||||
*/
|
||||
int getNumRegionsOnFavoredNodeByPosition(FavoredNodesPlan.Position position) {
|
||||
return favoredNodes[position.ordinal()];
|
||||
|
|
|
@ -53,7 +53,8 @@ public class ClusterId {
|
|||
/**
|
||||
* Parse the serialized representation of the {@link ClusterId}
|
||||
* @param bytes A pb serialized {@link ClusterId} instance with pb magic prefix
|
||||
* @return An instance of {@link ClusterId} made from <code>bytes</code> n * @see #toByteArray()
|
||||
* @return An instance of {@link ClusterId} made from <code>bytes</code>
|
||||
* @see #toByteArray()
|
||||
*/
|
||||
public static ClusterId parseFrom(final byte[] bytes) throws DeserializationException {
|
||||
if (ProtobufUtil.isPBMagicPrefix(bytes)) {
|
||||
|
@ -79,9 +80,7 @@ public class ClusterId {
|
|||
return builder.setClusterId(this.id).build();
|
||||
}
|
||||
|
||||
/**
|
||||
* n * @return A {@link ClusterId} made from the passed in <code>cid</code>
|
||||
*/
|
||||
/** Returns A {@link ClusterId} made from the passed in <code>cid</code> */
|
||||
public static ClusterId convert(final ClusterIdProtos.ClusterId cid) {
|
||||
return new ClusterId(cid.getClusterId());
|
||||
}
|
||||
|
|
|
@ -80,9 +80,7 @@ public class HRegionLocation implements Comparable<HRegionLocation> {
|
|||
return this.serverName.hashCode();
|
||||
}
|
||||
|
||||
/**
|
||||
* n
|
||||
*/
|
||||
/** Returns regionInfo */
|
||||
public RegionInfo getRegion() {
|
||||
return regionInfo;
|
||||
}
|
||||
|
|
|
@ -34,8 +34,7 @@ public class NotAllMetaRegionsOnlineException extends DoNotRetryIOException {
|
|||
}
|
||||
|
||||
/**
|
||||
* n
|
||||
*/
|
||||
* */
|
||||
public NotAllMetaRegionsOnlineException(String message) {
|
||||
super(message);
|
||||
}
|
||||
|
|
|
@ -76,7 +76,7 @@ public interface ServerMetrics {
|
|||
Map<String, List<ReplicationLoadSource>> getReplicationLoadSourceMap();
|
||||
|
||||
/**
|
||||
* Call directly from client such as hbase shell n
|
||||
* Call directly from client such as hbase shell
|
||||
*/
|
||||
@Nullable
|
||||
ReplicationLoadSink getReplicationLoadSink();
|
||||
|
|
|
@ -373,9 +373,10 @@ public interface Admin extends Abortable, Closeable {
|
|||
* Disable table and wait on completion. May timeout eventually. Use
|
||||
* {@link #disableTableAsync(org.apache.hadoop.hbase.TableName)} and
|
||||
* {@link #isTableDisabled(org.apache.hadoop.hbase.TableName)} instead. The table has to be in
|
||||
* enabled state for it to be disabled. n * @throws IOException There could be couple types of
|
||||
* IOException TableNotFoundException means the table doesn't exist. TableNotEnabledException
|
||||
* means the table isn't in enabled state.
|
||||
* enabled state for it to be disabled.
|
||||
* @throws IOException There could be couple types of IOException TableNotFoundException means the
|
||||
* table doesn't exist. TableNotEnabledException means the table isn't in
|
||||
* enabled state.
|
||||
*/
|
||||
default void disableTable(TableName tableName) throws IOException {
|
||||
get(disableTableAsync(tableName), getSyncWaitTimeout(), TimeUnit.MILLISECONDS);
|
||||
|
@ -598,7 +599,7 @@ public interface Admin extends Abortable, Closeable {
|
|||
* then it returns. It does not wait on the completion of Compaction (it can take a while).
|
||||
* @param tableName table to compact
|
||||
* @param compactType {@link org.apache.hadoop.hbase.client.CompactType}
|
||||
* @throws IOException if a remote or network exception occurs n
|
||||
* @throws IOException if a remote or network exception occurs
|
||||
*/
|
||||
void compact(TableName tableName, CompactType compactType)
|
||||
throws IOException, InterruptedException;
|
||||
|
@ -610,7 +611,7 @@ public interface Admin extends Abortable, Closeable {
|
|||
* @param tableName table to compact
|
||||
* @param columnFamily column family within a table
|
||||
* @param compactType {@link org.apache.hadoop.hbase.client.CompactType}
|
||||
* @throws IOException if not a mob column family or if a remote or network exception occurs n
|
||||
* @throws IOException if not a mob column family or if a remote or network exception occurs
|
||||
*/
|
||||
void compact(TableName tableName, byte[] columnFamily, CompactType compactType)
|
||||
throws IOException, InterruptedException;
|
||||
|
@ -659,7 +660,7 @@ public interface Admin extends Abortable, Closeable {
|
|||
* while).
|
||||
* @param tableName table to compact
|
||||
* @param compactType {@link org.apache.hadoop.hbase.client.CompactType}
|
||||
* @throws IOException if a remote or network exception occurs n
|
||||
* @throws IOException if a remote or network exception occurs
|
||||
*/
|
||||
void majorCompact(TableName tableName, CompactType compactType)
|
||||
throws IOException, InterruptedException;
|
||||
|
@ -671,7 +672,7 @@ public interface Admin extends Abortable, Closeable {
|
|||
* @param tableName table to compact
|
||||
* @param columnFamily column family within a table
|
||||
* @param compactType {@link org.apache.hadoop.hbase.client.CompactType}
|
||||
* @throws IOException if not a mob column family or if a remote or network exception occurs n
|
||||
* @throws IOException if not a mob column family or if a remote or network exception occurs
|
||||
*/
|
||||
void majorCompact(TableName tableName, byte[] columnFamily, CompactType compactType)
|
||||
throws IOException, InterruptedException;
|
||||
|
@ -1880,7 +1881,7 @@ public interface Admin extends Abortable, Closeable {
|
|||
|
||||
/**
|
||||
* Return the set of supported security capabilities.
|
||||
* @throws IOException if a remote or network exception occurs n
|
||||
* @throws IOException if a remote or network exception occurs
|
||||
*/
|
||||
List<SecurityCapability> getSecurityCapabilities() throws IOException;
|
||||
|
||||
|
@ -2215,7 +2216,7 @@ public interface Admin extends Abortable, Closeable {
|
|||
* Clear compacting queues on a regionserver.
|
||||
* @param serverName the region server name
|
||||
* @param queues the set of queue name
|
||||
* @throws IOException if a remote or network exception occurs n
|
||||
* @throws IOException if a remote or network exception occurs
|
||||
*/
|
||||
void clearCompactionQueues(ServerName serverName, Set<String> queues)
|
||||
throws IOException, InterruptedException;
|
||||
|
|
|
@ -63,7 +63,7 @@ public class Append extends Mutation {
|
|||
* <p>
|
||||
* This range is used as [minStamp, maxStamp).
|
||||
* @param minStamp minimum timestamp value, inclusive
|
||||
* @param maxStamp maximum timestamp value, exclusive n
|
||||
* @param maxStamp maximum timestamp value, exclusive
|
||||
*/
|
||||
public Append setTimeRange(long minStamp, long maxStamp) {
|
||||
tr = TimeRange.between(minStamp, maxStamp);
|
||||
|
@ -71,7 +71,7 @@ public class Append extends Mutation {
|
|||
}
|
||||
|
||||
/**
|
||||
* Gets the TimeRange used for this append. n
|
||||
* Gets the TimeRange used for this append.
|
||||
*/
|
||||
public TimeRange getTimeRange() {
|
||||
return this.tr;
|
||||
|
@ -83,7 +83,7 @@ public class Append extends Mutation {
|
|||
}
|
||||
|
||||
/**
|
||||
* n * True (default) if the append operation should return the results. A client that is not
|
||||
* True (default) if the append operation should return the results. A client that is not
|
||||
* interested in the result can save network bandwidth setting this to false.
|
||||
*/
|
||||
@Override
|
||||
|
@ -122,7 +122,7 @@ public class Append extends Mutation {
|
|||
* Create a Append operation for the specified row.
|
||||
* <p>
|
||||
* At least one column must be appended to.
|
||||
* @param rowArray Makes a copy out of this buffer. nn
|
||||
* @param rowArray Makes a copy out of this buffer.
|
||||
*/
|
||||
public Append(final byte[] rowArray, final int rowOffset, final int rowLength) {
|
||||
checkRow(rowArray, rowOffset, rowLength);
|
||||
|
@ -144,7 +144,7 @@ public class Append extends Mutation {
|
|||
* Add the specified column and value to this Append operation.
|
||||
* @param family family name
|
||||
* @param qualifier column qualifier
|
||||
* @param value value to append to specified column n
|
||||
* @param value value to append to specified column
|
||||
*/
|
||||
public Append addColumn(byte[] family, byte[] qualifier, byte[] value) {
|
||||
KeyValue kv = new KeyValue(this.row, family, qualifier, this.ts, KeyValue.Type.Put, value);
|
||||
|
|
|
@ -211,7 +211,7 @@ public interface AsyncAdmin {
|
|||
CompletableFuture<Void> enableTable(TableName tableName);
|
||||
|
||||
/**
|
||||
* Disable a table. The table has to be in enabled state for it to be disabled. n
|
||||
* Disable a table. The table has to be in enabled state for it to be disabled.
|
||||
*/
|
||||
CompletableFuture<Void> disableTable(TableName tableName);
|
||||
|
||||
|
@ -1156,7 +1156,7 @@ public interface AsyncAdmin {
|
|||
CompletableFuture<Void> stopMaster();
|
||||
|
||||
/**
|
||||
* Stop the designated regionserver. n
|
||||
* Stop the designated regionserver.
|
||||
*/
|
||||
CompletableFuture<Void> stopRegionServer(ServerName serverName);
|
||||
|
||||
|
@ -1365,8 +1365,8 @@ public interface AsyncAdmin {
|
|||
CompletableFuture<Boolean> normalize(NormalizeTableFilterParams ntfp);
|
||||
|
||||
/**
|
||||
* Turn the cleaner chore on/off. n * @return Previous cleaner state wrapped by a
|
||||
* {@link CompletableFuture}
|
||||
* Turn the cleaner chore on/off.
|
||||
* @return Previous cleaner state wrapped by a {@link CompletableFuture}
|
||||
*/
|
||||
CompletableFuture<Boolean> cleanerChoreSwitch(boolean on);
|
||||
|
||||
|
@ -1385,8 +1385,8 @@ public interface AsyncAdmin {
|
|||
CompletableFuture<Boolean> runCleanerChore();
|
||||
|
||||
/**
|
||||
* Turn the catalog janitor on/off. n * @return the previous state wrapped by a
|
||||
* {@link CompletableFuture}
|
||||
* Turn the catalog janitor on/off.
|
||||
* @return the previous state wrapped by a {@link CompletableFuture}
|
||||
*/
|
||||
CompletableFuture<Boolean> catalogJanitorSwitch(boolean on);
|
||||
|
||||
|
|
|
@ -185,7 +185,7 @@ public class AsyncConnectionImpl implements AsyncConnection {
|
|||
}
|
||||
|
||||
/**
|
||||
* If choreService has not been created yet, create the ChoreService. n
|
||||
* If choreService has not been created yet, create the ChoreService.
|
||||
*/
|
||||
synchronized ChoreService getChoreService() {
|
||||
if (isClosed()) {
|
||||
|
|
|
@ -133,7 +133,7 @@ public interface ColumnFamilyDescriptor {
|
|||
int getMinVersions();
|
||||
|
||||
/**
|
||||
* Get the mob compact partition policy for this family n
|
||||
* Get the mob compact partition policy for this family
|
||||
*/
|
||||
MobCompactPartitionPolicy getMobCompactPartitionPolicy();
|
||||
|
||||
|
|
|
@ -861,8 +861,8 @@ public class ColumnFamilyDescriptorBuilder {
|
|||
|
||||
/**
|
||||
* Set whether the tags should be compressed along with DataBlockEncoding. When no
|
||||
* DataBlockEncoding is been used, this is having no effect. n * @return this (for chained
|
||||
* invocation)
|
||||
* DataBlockEncoding is been used, this is having no effect.
|
||||
* @return this (for chained invocation)
|
||||
*/
|
||||
public ModifyableColumnFamilyDescriptor setCompressTags(boolean compressTags) {
|
||||
return setValue(COMPRESS_TAGS_BYTES, String.valueOf(compressTags));
|
||||
|
|
|
@ -97,7 +97,7 @@ public class Delete extends Mutation {
|
|||
* <p>
|
||||
* This timestamp is ONLY used for a delete row operation. If specifying families or columns, you
|
||||
* must specify each timestamp individually.
|
||||
* @param row We make a local copy of this passed in row. nn
|
||||
* @param row We make a local copy of this passed in row.
|
||||
*/
|
||||
public Delete(final byte[] row, final int rowOffset, final int rowLength) {
|
||||
this(row, rowOffset, rowLength, HConstants.LATEST_TIMESTAMP);
|
||||
|
@ -141,7 +141,7 @@ public class Delete extends Mutation {
|
|||
/**
|
||||
* Add an existing delete marker to this Delete object.
|
||||
* @param cell An existing cell of type "delete".
|
||||
* @return this for invocation chaining n
|
||||
* @return this for invocation chaining
|
||||
*/
|
||||
@Override
|
||||
public Delete add(Cell cell) throws IOException {
|
||||
|
|
|
@ -86,7 +86,7 @@ public class Get extends Query implements Row {
|
|||
}
|
||||
|
||||
/**
|
||||
* Copy-constructor n
|
||||
* Copy-constructor
|
||||
*/
|
||||
public Get(Get get) {
|
||||
this(get.getRow());
|
||||
|
@ -125,7 +125,7 @@ public class Get extends Query implements Row {
|
|||
}
|
||||
|
||||
/**
|
||||
* Create a Get operation for the specified row. nnn
|
||||
* Create a Get operation for the specified row.
|
||||
*/
|
||||
public Get(byte[] row, int rowOffset, int rowLength) {
|
||||
Mutation.checkRow(row, rowOffset, rowLength);
|
||||
|
@ -133,7 +133,7 @@ public class Get extends Query implements Row {
|
|||
}
|
||||
|
||||
/**
|
||||
* Create a Get operation for the specified row. n
|
||||
* Create a Get operation for the specified row.
|
||||
*/
|
||||
public Get(ByteBuffer row) {
|
||||
Mutation.checkRow(row);
|
||||
|
@ -294,7 +294,7 @@ public class Get extends Query implements Row {
|
|||
}
|
||||
|
||||
/**
|
||||
* Method for retrieving the get's row n
|
||||
* Method for retrieving the get's row
|
||||
*/
|
||||
@Override
|
||||
public byte[] getRow() {
|
||||
|
@ -326,7 +326,7 @@ public class Get extends Query implements Row {
|
|||
}
|
||||
|
||||
/**
|
||||
* Method for retrieving the get's TimeRange n
|
||||
* Method for retrieving the get's TimeRange
|
||||
*/
|
||||
public TimeRange getTimeRange() {
|
||||
return this.tr;
|
||||
|
@ -357,7 +357,7 @@ public class Get extends Query implements Row {
|
|||
}
|
||||
|
||||
/**
|
||||
* Method for retrieving the get's familyMap n
|
||||
* Method for retrieving the get's familyMap
|
||||
*/
|
||||
public Map<byte[], NavigableSet<byte[]>> getFamilyMap() {
|
||||
return this.familyMap;
|
||||
|
@ -365,7 +365,7 @@ public class Get extends Query implements Row {
|
|||
|
||||
/**
|
||||
* Compile the table and column family (i.e. schema) information into a String. Useful for parsing
|
||||
* and aggregation by debugging, logging, and administration tools. n
|
||||
* and aggregation by debugging, logging, and administration tools.
|
||||
*/
|
||||
@Override
|
||||
public Map<String, Object> getFingerprint() {
|
||||
|
@ -382,7 +382,7 @@ public class Get extends Query implements Row {
|
|||
* Compile the details beyond the scope of getFingerprint (row, columns, timestamps, etc.) into a
|
||||
* Map along with the fingerprinted information. Useful for debugging, logging, and administration
|
||||
* tools.
|
||||
* @param maxCols a limit on the number of columns output prior to truncation n
|
||||
* @param maxCols a limit on the number of columns output prior to truncation
|
||||
*/
|
||||
@Override
|
||||
public Map<String, Object> toMap(int maxCols) {
|
||||
|
|
|
@ -94,7 +94,8 @@ public class Increment extends Mutation {
|
|||
|
||||
/**
|
||||
* Add the specified KeyValue to this operation.
|
||||
* @param cell individual Cell n * @throws java.io.IOException e
|
||||
* @param cell individual Cell
|
||||
* @throws java.io.IOException e
|
||||
*/
|
||||
@Override
|
||||
public Increment add(Cell cell) throws IOException {
|
||||
|
@ -123,7 +124,7 @@ public class Increment extends Mutation {
|
|||
}
|
||||
|
||||
/**
|
||||
* Gets the TimeRange used for this increment. n
|
||||
* Gets the TimeRange used for this increment.
|
||||
*/
|
||||
public TimeRange getTimeRange() {
|
||||
return this.tr;
|
||||
|
@ -141,7 +142,7 @@ public class Increment extends Mutation {
|
|||
* This range is used as [minStamp, maxStamp).
|
||||
* @param minStamp minimum timestamp value, inclusive
|
||||
* @param maxStamp maximum timestamp value, exclusive
|
||||
* @throws IOException if invalid time range n
|
||||
* @throws IOException if invalid time range
|
||||
*/
|
||||
public Increment setTimeRange(long minStamp, long maxStamp) throws IOException {
|
||||
tr = TimeRange.between(minStamp, maxStamp);
|
||||
|
@ -211,8 +212,7 @@ public class Increment extends Mutation {
|
|||
}
|
||||
|
||||
/**
|
||||
* n
|
||||
*/
|
||||
* */
|
||||
@Override
|
||||
public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
|
|
|
@ -179,7 +179,7 @@ class MutableRegionInfo implements RegionInfo {
|
|||
}
|
||||
|
||||
/**
|
||||
* Get current table name of the region n
|
||||
* Get current table name of the region
|
||||
*/
|
||||
@Override
|
||||
public TableName getTable() {
|
||||
|
@ -231,7 +231,7 @@ class MutableRegionInfo implements RegionInfo {
|
|||
|
||||
/**
|
||||
* Change the split status flag.
|
||||
* @param split set split status n
|
||||
* @param split set split status
|
||||
*/
|
||||
public MutableRegionInfo setSplit(boolean split) {
|
||||
this.split = split;
|
||||
|
@ -252,7 +252,7 @@ class MutableRegionInfo implements RegionInfo {
|
|||
/**
|
||||
* The parent of a region split is offline while split daughters hold references to the parent.
|
||||
* Offlined regions are closed.
|
||||
* @param offLine Set online/offline status. n
|
||||
* @param offLine Set online/offline status.
|
||||
*/
|
||||
public MutableRegionInfo setOffline(boolean offLine) {
|
||||
this.offLine = offLine;
|
||||
|
|
|
@ -205,7 +205,7 @@ public abstract class Mutation extends OperationWithAttributes
|
|||
* Compile the details beyond the scope of getFingerprint (row, columns, timestamps, etc.) into a
|
||||
* Map along with the fingerprinted information. Useful for debugging, logging, and administration
|
||||
* tools.
|
||||
* @param maxCols a limit on the number of columns output prior to truncation n
|
||||
* @param maxCols a limit on the number of columns output prior to truncation
|
||||
*/
|
||||
@Override
|
||||
public Map<String, Object> toMap(int maxCols) {
|
||||
|
@ -268,7 +268,7 @@ public abstract class Mutation extends OperationWithAttributes
|
|||
}
|
||||
|
||||
/**
|
||||
* Set the durability for this mutation n
|
||||
* Set the durability for this mutation
|
||||
*/
|
||||
public Mutation setDurability(Durability d) {
|
||||
this.durability = d;
|
||||
|
@ -281,7 +281,7 @@ public abstract class Mutation extends OperationWithAttributes
|
|||
}
|
||||
|
||||
/**
|
||||
* Method for retrieving the put's familyMap n
|
||||
* Method for retrieving the put's familyMap
|
||||
*/
|
||||
public NavigableMap<byte[], List<Cell>> getFamilyCellMap() {
|
||||
return this.familyMap;
|
||||
|
@ -296,7 +296,7 @@ public abstract class Mutation extends OperationWithAttributes
|
|||
}
|
||||
|
||||
/**
|
||||
* Method for retrieving the delete's row n
|
||||
* Method for retrieving the delete's row
|
||||
*/
|
||||
@Override
|
||||
public byte[] getRow() {
|
||||
|
@ -304,7 +304,7 @@ public abstract class Mutation extends OperationWithAttributes
|
|||
}
|
||||
|
||||
/**
|
||||
* Method for retrieving the timestamp. n
|
||||
* Method for retrieving the timestamp.
|
||||
*/
|
||||
public long getTimestamp() {
|
||||
return this.ts;
|
||||
|
@ -340,7 +340,7 @@ public abstract class Mutation extends OperationWithAttributes
|
|||
}
|
||||
|
||||
/**
|
||||
* Sets the visibility expression associated with cells in this Mutation. n
|
||||
* Sets the visibility expression associated with cells in this Mutation.
|
||||
*/
|
||||
public Mutation setCellVisibility(CellVisibility expression) {
|
||||
this.setAttribute(VisibilityConstants.VISIBILITY_LABELS_ATTR_KEY,
|
||||
|
@ -356,8 +356,8 @@ public abstract class Mutation extends OperationWithAttributes
|
|||
}
|
||||
|
||||
/**
|
||||
* Create a protocol buffer CellVisibility based on a client CellVisibility. n * @return a
|
||||
* protocol buffer CellVisibility
|
||||
* Create a protocol buffer CellVisibility based on a client CellVisibility.
|
||||
* @return a protocol buffer CellVisibility
|
||||
*/
|
||||
static ClientProtos.CellVisibility toCellVisibility(CellVisibility cellVisibility) {
|
||||
ClientProtos.CellVisibility.Builder builder = ClientProtos.CellVisibility.newBuilder();
|
||||
|
@ -366,8 +366,8 @@ public abstract class Mutation extends OperationWithAttributes
|
|||
}
|
||||
|
||||
/**
|
||||
* Convert a protocol buffer CellVisibility to a client CellVisibility n * @return the converted
|
||||
* client CellVisibility
|
||||
* Convert a protocol buffer CellVisibility to a client CellVisibility
|
||||
* @return the converted client CellVisibility
|
||||
*/
|
||||
private static CellVisibility toCellVisibility(ClientProtos.CellVisibility proto) {
|
||||
if (proto == null) return null;
|
||||
|
@ -375,8 +375,8 @@ public abstract class Mutation extends OperationWithAttributes
|
|||
}
|
||||
|
||||
/**
|
||||
* Convert a protocol buffer CellVisibility bytes to a client CellVisibility n * @return the
|
||||
* converted client CellVisibility n
|
||||
* Convert a protocol buffer CellVisibility bytes to a client CellVisibility
|
||||
* @return the converted client CellVisibility
|
||||
*/
|
||||
private static CellVisibility toCellVisibility(byte[] protoBytes)
|
||||
throws DeserializationException {
|
||||
|
@ -483,7 +483,7 @@ public abstract class Mutation extends OperationWithAttributes
|
|||
|
||||
/**
|
||||
* Set the TTL desired for the result of the mutation, in milliseconds.
|
||||
* @param ttl the TTL desired for the result of the mutation, in milliseconds n
|
||||
* @param ttl the TTL desired for the result of the mutation, in milliseconds
|
||||
*/
|
||||
public Mutation setTTL(long ttl) {
|
||||
setAttribute(OP_ATTRIBUTE_TTL, Bytes.toBytes(ttl));
|
||||
|
@ -660,8 +660,9 @@ public abstract class Mutation extends OperationWithAttributes
|
|||
}
|
||||
|
||||
/**
|
||||
* @param row Row to check nn * @throws IllegalArgumentException Thrown if <code>row</code> is
|
||||
* empty or null or > {@link HConstants#MAX_ROW_LENGTH}
|
||||
* @param row Row to check
|
||||
* @throws IllegalArgumentException Thrown if <code>row</code> is empty or null or >
|
||||
* {@link HConstants#MAX_ROW_LENGTH}
|
||||
* @return <code>row</code>
|
||||
*/
|
||||
static byte[] checkRow(final byte[] row, final int offset, final int length) {
|
||||
|
|
|
@ -94,7 +94,7 @@ public abstract class Operation {
|
|||
/**
|
||||
* Produces a string representation of this Operation. It defaults to a JSON representation, but
|
||||
* falls back to a string representation of the fingerprint and details in the case of a JSON
|
||||
* encoding failure. n
|
||||
* encoding failure.
|
||||
*/
|
||||
@Override
|
||||
public String toString() {
|
||||
|
|
|
@ -106,7 +106,7 @@ public abstract class OperationWithAttributes extends Operation implements Attri
|
|||
* This method allows you to set an identifier on an operation. The original motivation for this
|
||||
* was to allow the identifier to be used in slow query logging, but this could obviously be
|
||||
* useful in other places. One use of this could be to put a class.method identifier in here to
|
||||
* see where the slow query is coming from. n * id to set for the scan
|
||||
* see where the slow query is coming from. id to set for the scan
|
||||
*/
|
||||
public OperationWithAttributes setId(String id) {
|
||||
setAttribute(ID_ATRIBUTE, Bytes.toBytes(id));
|
||||
|
|
|
@ -61,7 +61,7 @@ public class Put extends Mutation implements HeapSize {
|
|||
}
|
||||
|
||||
/**
|
||||
* We make a copy of the passed in row key to keep local. nnn
|
||||
* We make a copy of the passed in row key to keep local.
|
||||
*/
|
||||
public Put(byte[] rowArray, int rowOffset, int rowLength) {
|
||||
this(rowArray, rowOffset, rowLength, HConstants.LATEST_TIMESTAMP);
|
||||
|
@ -89,7 +89,7 @@ public class Put extends Mutation implements HeapSize {
|
|||
}
|
||||
|
||||
/**
|
||||
* We make a copy of the passed in row key to keep local. nnnn
|
||||
* We make a copy of the passed in row key to keep local.
|
||||
*/
|
||||
public Put(byte[] rowArray, int rowOffset, int rowLength, long ts) {
|
||||
checkRow(rowArray, rowOffset, rowLength);
|
||||
|
@ -156,7 +156,7 @@ public class Put extends Mutation implements HeapSize {
|
|||
* Add the specified column and value to this Put operation.
|
||||
* @param family family name
|
||||
* @param qualifier column qualifier
|
||||
* @param value column value n
|
||||
* @param value column value
|
||||
*/
|
||||
public Put addColumn(byte[] family, byte[] qualifier, byte[] value) {
|
||||
return addColumn(family, qualifier, this.ts, value);
|
||||
|
@ -168,7 +168,7 @@ public class Put extends Mutation implements HeapSize {
|
|||
* @param family family name
|
||||
* @param qualifier column qualifier
|
||||
* @param ts version timestamp
|
||||
* @param value column value n
|
||||
* @param value column value
|
||||
*/
|
||||
public Put addColumn(byte[] family, byte[] qualifier, long ts, byte[] value) {
|
||||
if (ts < 0) {
|
||||
|
@ -186,7 +186,7 @@ public class Put extends Mutation implements HeapSize {
|
|||
* @param family family name
|
||||
* @param qualifier column qualifier
|
||||
* @param ts version timestamp
|
||||
* @param value column value n
|
||||
* @param value column value
|
||||
*/
|
||||
public Put addColumn(byte[] family, ByteBuffer qualifier, long ts, ByteBuffer value) {
|
||||
if (ts < 0) {
|
||||
|
@ -201,7 +201,8 @@ public class Put extends Mutation implements HeapSize {
|
|||
/**
|
||||
* Add the specified KeyValue to this Put operation. Operation assumes that the passed KeyValue is
|
||||
* immutable and its backing array will not be modified for the duration of this Put.
|
||||
* @param cell individual cell n * @throws java.io.IOException e
|
||||
* @param cell individual cell
|
||||
* @throws java.io.IOException e
|
||||
*/
|
||||
@Override
|
||||
public Put add(Cell cell) throws IOException {
|
||||
|
|
|
@ -47,9 +47,6 @@ public abstract class Query extends OperationWithAttributes {
|
|||
protected Map<byte[], TimeRange> colFamTimeRangeMap = Maps.newTreeMap(Bytes.BYTES_COMPARATOR);
|
||||
protected Boolean loadColumnFamiliesOnDemand = null;
|
||||
|
||||
/**
|
||||
* n
|
||||
*/
|
||||
public Filter getFilter() {
|
||||
return filter;
|
||||
}
|
||||
|
@ -67,7 +64,7 @@ public abstract class Query extends OperationWithAttributes {
|
|||
}
|
||||
|
||||
/**
|
||||
* Sets the authorizations to be used by this Query n
|
||||
* Sets the authorizations to be used by this Query
|
||||
*/
|
||||
public Query setAuthorizations(Authorizations authorizations) {
|
||||
this.setAttribute(VisibilityConstants.VISIBILITY_LABELS_ATTR_KEY,
|
||||
|
@ -133,7 +130,7 @@ public abstract class Query extends OperationWithAttributes {
|
|||
* Specify region replica id where Query will fetch data from. Use this together with
|
||||
* {@link #setConsistency(Consistency)} passing {@link Consistency#TIMELINE} to read data from a
|
||||
* specific replicaId. <br>
|
||||
* <b> Expert: </b>This is an advanced API exposed. Only use it if you know what you are doing n
|
||||
* <b> Expert: </b>This is an advanced API exposed. Only use it if you know what you are doing
|
||||
*/
|
||||
public Query setReplicaId(int Id) {
|
||||
this.targetReplicaId = Id;
|
||||
|
@ -209,7 +206,7 @@ public abstract class Query extends OperationWithAttributes {
|
|||
* Column Family time ranges take precedence over the global time range.
|
||||
* @param cf the column family for which you want to restrict
|
||||
* @param minStamp minimum timestamp value, inclusive
|
||||
* @param maxStamp maximum timestamp value, exclusive n
|
||||
* @param maxStamp maximum timestamp value, exclusive
|
||||
*/
|
||||
|
||||
public Query setColumnFamilyTimeRange(byte[] cf, long minStamp, long maxStamp) {
|
||||
|
|
|
@ -59,7 +59,8 @@ public class RegionInfoDisplay {
|
|||
}
|
||||
|
||||
/**
|
||||
* Get the start key for display. Optionally hide the real start key. nn * @return the startkey
|
||||
* Get the start key for display. Optionally hide the real start key.
|
||||
* @return the startkey
|
||||
*/
|
||||
public static byte[] getStartKeyForDisplay(RegionInfo ri, Configuration conf) {
|
||||
boolean displayKey = conf.getBoolean(DISPLAY_KEYS_KEY, true);
|
||||
|
@ -68,15 +69,16 @@ public class RegionInfoDisplay {
|
|||
}
|
||||
|
||||
/**
|
||||
* Get the region name for display. Optionally hide the start key. nn * @return region name as
|
||||
* String
|
||||
* Get the region name for display. Optionally hide the start key.
|
||||
* @return region name as String
|
||||
*/
|
||||
public static String getRegionNameAsStringForDisplay(RegionInfo ri, Configuration conf) {
|
||||
return Bytes.toStringBinary(getRegionNameForDisplay(ri, conf));
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the region name for display. Optionally hide the start key. nn * @return region name bytes
|
||||
* Get the region name for display. Optionally hide the start key.
|
||||
* @return region name bytes
|
||||
*/
|
||||
public static byte[] getRegionNameForDisplay(RegionInfo ri, Configuration conf) {
|
||||
boolean displayKey = conf.getBoolean(DISPLAY_KEYS_KEY, true);
|
||||
|
|
|
@ -84,7 +84,7 @@ public class RegionReplicaUtil {
|
|||
}
|
||||
|
||||
/**
|
||||
* Removes the non-default replicas from the passed regions collection n
|
||||
* Removes the non-default replicas from the passed regions collection
|
||||
*/
|
||||
public static void removeNonDefaultRegions(Collection<RegionInfo> regions) {
|
||||
Iterator<RegionInfo> iterator = regions.iterator();
|
||||
|
|
|
@ -186,7 +186,7 @@ public class Result implements CellScannable, CellScanner {
|
|||
|
||||
/**
|
||||
* Method for retrieving the row key that corresponds to the row from which this Result was
|
||||
* created. n
|
||||
* created.
|
||||
*/
|
||||
public byte[] getRow() {
|
||||
if (this.row == null) {
|
||||
|
@ -227,8 +227,9 @@ public class Result implements CellScannable, CellScanner {
|
|||
* or Get) only requested 1 version the list will contain at most 1 entry. If the column did not
|
||||
* exist in the result set (either the column does not exist or the column was not selected in the
|
||||
* query) the list will be empty. Also see getColumnLatest which returns just a Cell
|
||||
* @param family the family n * @return a list of Cells for this column or empty list if the
|
||||
* column did not exist in the result set
|
||||
* @param family the family
|
||||
* @return a list of Cells for this column or empty list if the column did not exist in the result
|
||||
* set
|
||||
*/
|
||||
public List<Cell> getColumnCells(byte[] family, byte[] qualifier) {
|
||||
List<Cell> result = new ArrayList<>();
|
||||
|
@ -324,7 +325,7 @@ public class Result implements CellScannable, CellScanner {
|
|||
}
|
||||
|
||||
/**
|
||||
* The Cell for the most recent timestamp for a given column. nn *
|
||||
* The Cell for the most recent timestamp for a given column.
|
||||
* @return the Cell for the column, or null if no value exists in the row or none have been
|
||||
* selected in the query (Get/Scan)
|
||||
*/
|
||||
|
@ -677,8 +678,7 @@ public class Result implements CellScannable, CellScanner {
|
|||
}
|
||||
|
||||
/**
|
||||
* n
|
||||
*/
|
||||
* */
|
||||
@Override
|
||||
public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
|
@ -800,7 +800,8 @@ public class Result implements CellScannable, CellScanner {
|
|||
}
|
||||
|
||||
/**
|
||||
* Get total size of raw cells n * @return Total size.
|
||||
* Get total size of raw cells
|
||||
* @return Total size.
|
||||
*/
|
||||
public static long getTotalSizeOfCells(Result result) {
|
||||
long size = 0;
|
||||
|
@ -816,7 +817,7 @@ public class Result implements CellScannable, CellScanner {
|
|||
/**
|
||||
* Copy another Result into this one. Needed for the old Mapred framework
|
||||
* @throws UnsupportedOperationException if invoked on instance of EMPTY_RESULT (which is supposed
|
||||
* to be immutable). n
|
||||
* to be immutable).
|
||||
*/
|
||||
public void copyFrom(Result other) {
|
||||
checkReadonly();
|
||||
|
|
|
@ -86,7 +86,7 @@ public interface ResultScanner extends Closeable, Iterable<Result> {
|
|||
* setting (or hbase.client.scanner.caching in hbase-site.xml).
|
||||
* @param nbRows number of rows to return
|
||||
* @return Between zero and nbRows rowResults. Scan is done if returned array is of zero-length
|
||||
* (We never return null). n
|
||||
* (We never return null).
|
||||
*/
|
||||
default Result[] next(int nbRows) throws IOException {
|
||||
List<Result> resultSets = new ArrayList<>(nbRows);
|
||||
|
|
|
@ -38,8 +38,8 @@ public class RowMutations implements Row {
|
|||
|
||||
/**
|
||||
* Create a {@link RowMutations} with the specified mutations.
|
||||
* @param mutations the mutations to send n * @throws IOException if any row in mutations is
|
||||
* different to another
|
||||
* @param mutations the mutations to send
|
||||
* @throws IOException if any row in mutations is different to another
|
||||
*/
|
||||
public static RowMutations of(List<? extends Mutation> mutations) throws IOException {
|
||||
if (CollectionUtils.isEmpty(mutations)) {
|
||||
|
|
|
@ -259,7 +259,7 @@ public class Scan extends Query {
|
|||
* Get all columns from the specified family.
|
||||
* <p>
|
||||
* Overrides previous calls to addColumn for this family.
|
||||
* @param family family name n
|
||||
* @param family family name
|
||||
*/
|
||||
public Scan addFamily(byte[] family) {
|
||||
familyMap.remove(family);
|
||||
|
@ -272,7 +272,7 @@ public class Scan extends Query {
|
|||
* <p>
|
||||
* Overrides previous calls to addFamily for this family.
|
||||
* @param family family name
|
||||
* @param qualifier column qualifier n
|
||||
* @param qualifier column qualifier
|
||||
*/
|
||||
public Scan addColumn(byte[] family, byte[] qualifier) {
|
||||
NavigableSet<byte[]> set = familyMap.get(family);
|
||||
|
@ -294,7 +294,7 @@ public class Scan extends Query {
|
|||
* @param minStamp minimum timestamp value, inclusive
|
||||
* @param maxStamp maximum timestamp value, exclusive
|
||||
* @see #readAllVersions()
|
||||
* @see #readVersions(int) n
|
||||
* @see #readVersions(int)
|
||||
*/
|
||||
public Scan setTimeRange(long minStamp, long maxStamp) throws IOException {
|
||||
tr = TimeRange.between(minStamp, maxStamp);
|
||||
|
@ -307,7 +307,7 @@ public class Scan extends Query {
|
|||
* number of versions beyond the defaut.
|
||||
* @param timestamp version timestamp
|
||||
* @see #readAllVersions()
|
||||
* @see #readVersions(int) n
|
||||
* @see #readVersions(int)
|
||||
*/
|
||||
public Scan setTimestamp(long timestamp) {
|
||||
try {
|
||||
|
@ -336,9 +336,9 @@ public class Scan extends Query {
|
|||
* {@link #setStartStopRowForPrefixScan(byte[])}.</strong> Doing so will make the scan result
|
||||
* unexpected or even undefined.
|
||||
* </p>
|
||||
* @param startRow row to start scanner at or after n * @throws IllegalArgumentException if
|
||||
* startRow does not meet criteria for a row key (when length exceeds
|
||||
* {@link HConstants#MAX_ROW_LENGTH})
|
||||
* @param startRow row to start scanner at or after
|
||||
* @throws IllegalArgumentException if startRow does not meet criteria for a row key (when length
|
||||
* exceeds {@link HConstants#MAX_ROW_LENGTH})
|
||||
*/
|
||||
public Scan withStartRow(byte[] startRow) {
|
||||
return withStartRow(startRow, true);
|
||||
|
@ -355,9 +355,9 @@ public class Scan extends Query {
|
|||
* unexpected or even undefined.
|
||||
* </p>
|
||||
* @param startRow row to start scanner at or after
|
||||
* @param inclusive whether we should include the start row when scan n * @throws
|
||||
* IllegalArgumentException if startRow does not meet criteria for a row key
|
||||
* (when length exceeds {@link HConstants#MAX_ROW_LENGTH})
|
||||
* @param inclusive whether we should include the start row when scan
|
||||
* @throws IllegalArgumentException if startRow does not meet criteria for a row key (when length
|
||||
* exceeds {@link HConstants#MAX_ROW_LENGTH})
|
||||
*/
|
||||
public Scan withStartRow(byte[] startRow, boolean inclusive) {
|
||||
if (Bytes.len(startRow) > HConstants.MAX_ROW_LENGTH) {
|
||||
|
@ -378,9 +378,9 @@ public class Scan extends Query {
|
|||
* {@link #setStartStopRowForPrefixScan(byte[])}.</strong> Doing so will make the scan result
|
||||
* unexpected or even undefined.
|
||||
* </p>
|
||||
* @param stopRow row to end at (exclusive) n * @throws IllegalArgumentException if stopRow does
|
||||
* not meet criteria for a row key (when length exceeds
|
||||
* {@link HConstants#MAX_ROW_LENGTH})
|
||||
* @param stopRow row to end at (exclusive)
|
||||
* @throws IllegalArgumentException if stopRow does not meet criteria for a row key (when length
|
||||
* exceeds {@link HConstants#MAX_ROW_LENGTH})
|
||||
*/
|
||||
public Scan withStopRow(byte[] stopRow) {
|
||||
return withStopRow(stopRow, false);
|
||||
|
@ -397,9 +397,9 @@ public class Scan extends Query {
|
|||
* unexpected or even undefined.
|
||||
* </p>
|
||||
* @param stopRow row to end at
|
||||
* @param inclusive whether we should include the stop row when scan n * @throws
|
||||
* IllegalArgumentException if stopRow does not meet criteria for a row key (when
|
||||
* length exceeds {@link HConstants#MAX_ROW_LENGTH})
|
||||
* @param inclusive whether we should include the stop row when scan
|
||||
* @throws IllegalArgumentException if stopRow does not meet criteria for a row key (when length
|
||||
* exceeds {@link HConstants#MAX_ROW_LENGTH})
|
||||
*/
|
||||
public Scan withStopRow(byte[] stopRow, boolean inclusive) {
|
||||
if (Bytes.len(stopRow) > HConstants.MAX_ROW_LENGTH) {
|
||||
|
@ -427,11 +427,10 @@ public class Scan extends Query {
|
|||
* <strong>This CANNOT be used in combination with withStartRow and/or withStopRow.</strong> Such
|
||||
* a combination will yield unexpected and even undefined results.
|
||||
* </p>
|
||||
* @param rowPrefix the prefix all rows must start with. (Set <i>null</i> to remove the filter.) n
|
||||
* * @deprecated since 2.5.0, will be removed in 4.0.0. The name of this method
|
||||
* is considered to be confusing as it does not use a {@link Filter} but uses
|
||||
* setting the startRow and stopRow instead. Use
|
||||
* {@link #setStartStopRowForPrefixScan(byte[])} instead.
|
||||
* @param rowPrefix the prefix all rows must start with. (Set <i>null</i> to remove the filter.)
|
||||
* @deprecated since 2.5.0, will be removed in 4.0.0. The name of this method is considered to be
|
||||
* confusing as it does not use a {@link Filter} but uses setting the startRow and
|
||||
* stopRow instead. Use {@link #setStartStopRowForPrefixScan(byte[])} instead.
|
||||
*/
|
||||
@Deprecated
|
||||
public Scan setRowPrefixFilter(byte[] rowPrefix) {
|
||||
|
@ -454,7 +453,7 @@ public class Scan extends Query {
|
|||
* <strong>This CANNOT be used in combination with withStartRow and/or withStopRow.</strong> Such
|
||||
* a combination will yield unexpected and even undefined results.
|
||||
* </p>
|
||||
* @param rowPrefix the prefix all rows must start with. (Set <i>null</i> to remove the filter.) n
|
||||
* @param rowPrefix the prefix all rows must start with. (Set <i>null</i> to remove the filter.)
|
||||
*/
|
||||
public Scan setStartStopRowForPrefixScan(byte[] rowPrefix) {
|
||||
if (rowPrefix == null) {
|
||||
|
@ -468,7 +467,7 @@ public class Scan extends Query {
|
|||
}
|
||||
|
||||
/**
|
||||
* Get all available versions. n
|
||||
* Get all available versions.
|
||||
*/
|
||||
public Scan readAllVersions() {
|
||||
this.maxVersions = Integer.MAX_VALUE;
|
||||
|
@ -477,7 +476,7 @@ public class Scan extends Query {
|
|||
|
||||
/**
|
||||
* Get up to the specified number of versions of each column.
|
||||
* @param versions specified number of versions for each column n
|
||||
* @param versions specified number of versions for each column
|
||||
*/
|
||||
public Scan readVersions(int versions) {
|
||||
this.maxVersions = versions;
|
||||
|
@ -555,7 +554,7 @@ public class Scan extends Query {
|
|||
|
||||
/**
|
||||
* Setting the familyMap
|
||||
* @param familyMap map of family to qualifier n
|
||||
* @param familyMap map of family to qualifier
|
||||
*/
|
||||
public Scan setFamilyMap(Map<byte[], NavigableSet<byte[]>> familyMap) {
|
||||
this.familyMap = familyMap;
|
||||
|
@ -563,7 +562,7 @@ public class Scan extends Query {
|
|||
}
|
||||
|
||||
/**
|
||||
* Getting the familyMap n
|
||||
* Getting the familyMap
|
||||
*/
|
||||
public Map<byte[], NavigableSet<byte[]>> getFamilyMap() {
|
||||
return this.familyMap;
|
||||
|
@ -638,16 +637,12 @@ public class Scan extends Query {
|
|||
return this.caching;
|
||||
}
|
||||
|
||||
/**
|
||||
* n
|
||||
*/
|
||||
/** Returns TimeRange */
|
||||
public TimeRange getTimeRange() {
|
||||
return this.tr;
|
||||
}
|
||||
|
||||
/**
|
||||
* n
|
||||
*/
|
||||
/** Returns RowFilter */
|
||||
@Override
|
||||
public Filter getFilter() {
|
||||
return filter;
|
||||
|
@ -682,7 +677,7 @@ public class Scan extends Query {
|
|||
* Set whether this scan is a reversed one
|
||||
* <p>
|
||||
* This is false by default which means forward(normal) scan.
|
||||
* @param reversed if true, scan will be backward order n
|
||||
* @param reversed if true, scan will be backward order
|
||||
*/
|
||||
public Scan setReversed(boolean reversed) {
|
||||
this.reversed = reversed;
|
||||
|
@ -701,7 +696,8 @@ public class Scan extends Query {
|
|||
* Setting whether the caller wants to see the partial results when server returns
|
||||
* less-than-expected cells. It is helpful while scanning a huge row to prevent OOM at client. By
|
||||
* default this value is false and the complete results will be assembled client side before being
|
||||
* delivered to the caller. nn * @see Result#mayHaveMoreCellsInRow()
|
||||
* delivered to the caller.
|
||||
* @see Result#mayHaveMoreCellsInRow()
|
||||
* @see #setBatch(int)
|
||||
*/
|
||||
public Scan setAllowPartialResults(final boolean allowPartialResults) {
|
||||
|
@ -725,7 +721,7 @@ public class Scan extends Query {
|
|||
|
||||
/**
|
||||
* Compile the table and column family (i.e. schema) information into a String. Useful for parsing
|
||||
* and aggregation by debugging, logging, and administration tools. n
|
||||
* and aggregation by debugging, logging, and administration tools.
|
||||
*/
|
||||
@Override
|
||||
public Map<String, Object> getFingerprint() {
|
||||
|
@ -747,7 +743,7 @@ public class Scan extends Query {
|
|||
* Compile the details beyond the scope of getFingerprint (row, columns, timestamps, etc.) into a
|
||||
* Map along with the fingerprinted information. Useful for debugging, logging, and administration
|
||||
* tools.
|
||||
* @param maxCols a limit on the number of columns output prior to truncation n
|
||||
* @param maxCols a limit on the number of columns output prior to truncation
|
||||
*/
|
||||
@Override
|
||||
public Map<String, Object> toMap(int maxCols) {
|
||||
|
@ -904,7 +900,7 @@ public class Scan extends Query {
|
|||
* reaches this value.
|
||||
* <p>
|
||||
* This condition will be tested at last, after all other conditions such as stopRow, filter, etc.
|
||||
* @param limit the limit of rows for this scan n
|
||||
* @param limit the limit of rows for this scan
|
||||
*/
|
||||
public Scan setLimit(int limit) {
|
||||
this.limit = limit;
|
||||
|
@ -913,7 +909,7 @@ public class Scan extends Query {
|
|||
|
||||
/**
|
||||
* Call this when you only want to get one row. It will set {@code limit} to {@code 1}, and also
|
||||
* set {@code readType} to {@link ReadType#PREAD}. n
|
||||
* set {@code readType} to {@link ReadType#PREAD}.
|
||||
*/
|
||||
public Scan setOneRowLimit() {
|
||||
return setLimit(1).setReadType(ReadType.PREAD);
|
||||
|
@ -935,7 +931,7 @@ public class Scan extends Query {
|
|||
* Set the read type for this scan.
|
||||
* <p>
|
||||
* Notice that we may choose to use pread even if you specific {@link ReadType#STREAM} here. For
|
||||
* example, we will always use pread if this is a get scan. n
|
||||
* example, we will always use pread if this is a get scan.
|
||||
*/
|
||||
public Scan setReadType(ReadType readType) {
|
||||
this.readType = readType;
|
||||
|
|
|
@ -116,7 +116,8 @@ public interface Table extends Closeable {
|
|||
* @param results Empty Object[], same size as actions. Provides access to partial results, in
|
||||
* case an exception is thrown. A null in the result array means that the call for
|
||||
* that action failed, even after retries. The order of the objects in the results
|
||||
* array corresponds to the order of actions in the request list. n * @since 0.90.0
|
||||
* array corresponds to the order of actions in the request list.
|
||||
* @since 0.90.0
|
||||
*/
|
||||
default void batch(final List<? extends Row> actions, final Object[] results)
|
||||
throws IOException, InterruptedException {
|
||||
|
@ -264,8 +265,8 @@ public interface Table extends Closeable {
|
|||
* @apiNote In 3.0.0 version, the input list {@code deletes} will no longer be modified. Also,
|
||||
* {@link #put(List)} runs pre-flight validations on the input list on client. Currently
|
||||
* {@link #delete(List)} doesn't run validations on the client, there is no need
|
||||
* currently, but this may change in the future. An * {@link IllegalArgumentException}
|
||||
* will be thrown in this case.
|
||||
* currently, but this may change in the future. An {@link IllegalArgumentException} will
|
||||
* be thrown in this case.
|
||||
*/
|
||||
default void delete(List<Delete> deletes) throws IOException {
|
||||
throw new NotImplementedException("Add an implementation!");
|
||||
|
|
|
@ -153,7 +153,7 @@ public interface TableDescriptor {
|
|||
String getRegionSplitPolicyClassName();
|
||||
|
||||
/**
|
||||
* Get the name of the table n
|
||||
* Get the name of the table
|
||||
*/
|
||||
TableName getTableName();
|
||||
|
||||
|
|
|
@ -886,7 +886,7 @@ public class TableDescriptorBuilder {
|
|||
}
|
||||
|
||||
/**
|
||||
* Get the name of the table n
|
||||
* Get the name of the table
|
||||
*/
|
||||
@Override
|
||||
public TableName getTableName() {
|
||||
|
@ -1299,7 +1299,8 @@ public class TableDescriptorBuilder {
|
|||
* org.apache.hadoop.hbase.coprocessor.RegionObserver or Endpoint. It won't check if the class
|
||||
* can be loaded or not. Whether a coprocessor is loadable or not will be determined when a
|
||||
* region is opened.
|
||||
* @param className Full class name. n * @return the modifyable TD
|
||||
* @param className Full class name.
|
||||
* @return the modifyable TD
|
||||
*/
|
||||
public ModifyableTableDescriptor setCoprocessor(String className) throws IOException {
|
||||
return setCoprocessor(CoprocessorDescriptorBuilder.newBuilder(className)
|
||||
|
@ -1347,8 +1348,8 @@ public class TableDescriptorBuilder {
|
|||
* org.apache.hadoop.hbase.coprocessor.RegionObserver or Endpoint. It won't check if the class
|
||||
* can be loaded or not. Whether a coprocessor is loadable or not will be determined when a
|
||||
* region is opened.
|
||||
* @param specStr The Coprocessor specification all in in one String n * @return the modifyable
|
||||
* TD
|
||||
* @param specStr The Coprocessor specification all in in one String
|
||||
* @return the modifyable TD
|
||||
* @deprecated used by HTableDescriptor and admin.rb. As of release 2.0.0, this will be removed
|
||||
* in HBase 3.0.0.
|
||||
*/
|
||||
|
@ -1461,8 +1462,8 @@ public class TableDescriptorBuilder {
|
|||
|
||||
/**
|
||||
* @param bytes A pb serialized {@link ModifyableTableDescriptor} instance with pb magic prefix
|
||||
* @return An instance of {@link ModifyableTableDescriptor} made from <code>bytes</code> n
|
||||
* * @see #toByteArray()
|
||||
* @return An instance of {@link ModifyableTableDescriptor} made from <code>bytes</code>
|
||||
* @see #toByteArray()
|
||||
*/
|
||||
private static TableDescriptor parseFrom(final byte[] bytes) throws DeserializationException {
|
||||
if (!ProtobufUtil.isPBMagicPrefix(bytes)) {
|
||||
|
|
|
@ -42,7 +42,7 @@ public class TableState {
|
|||
|
||||
/**
|
||||
* Covert from PB version of State
|
||||
* @param state convert from n
|
||||
* @param state convert from
|
||||
*/
|
||||
public static State convert(HBaseProtos.TableState.State state) {
|
||||
State ret;
|
||||
|
@ -66,7 +66,7 @@ public class TableState {
|
|||
}
|
||||
|
||||
/**
|
||||
* Covert to PB version of State n
|
||||
* Covert to PB version of State
|
||||
*/
|
||||
public HBaseProtos.TableState.State convert() {
|
||||
HBaseProtos.TableState.State state;
|
||||
|
@ -140,7 +140,7 @@ public class TableState {
|
|||
}
|
||||
|
||||
/**
|
||||
* Table name for state n
|
||||
* Table name for state
|
||||
*/
|
||||
public TableName getTableName() {
|
||||
return tableName;
|
||||
|
@ -168,7 +168,7 @@ public class TableState {
|
|||
}
|
||||
|
||||
/**
|
||||
* Covert to PB version of TableState n
|
||||
* Covert to PB version of TableState
|
||||
*/
|
||||
public HBaseProtos.TableState convert() {
|
||||
return HBaseProtos.TableState.newBuilder().setState(this.state.convert()).build();
|
||||
|
@ -177,7 +177,7 @@ public class TableState {
|
|||
/**
|
||||
* Covert from PB version of TableState
|
||||
* @param tableName table this state of
|
||||
* @param tableState convert from n
|
||||
* @param tableState convert from
|
||||
*/
|
||||
public static TableState convert(TableName tableName, HBaseProtos.TableState tableState) {
|
||||
TableState.State state = State.convert(tableState.getState());
|
||||
|
|
|
@ -33,7 +33,7 @@ public class ServerStatistics {
|
|||
|
||||
/**
|
||||
* Good enough attempt. Last writer wins. It doesn't really matter which one gets to update, as
|
||||
* something gets set nn
|
||||
* something gets set
|
||||
*/
|
||||
public void update(byte[] region, RegionLoadStats currentStats) {
|
||||
RegionStatistics regionStat = this.stats.get(region);
|
||||
|
|
|
@ -35,8 +35,8 @@ public class ServerSideScanMetrics {
|
|||
private final Map<String, AtomicLong> counters = new HashMap<>();
|
||||
|
||||
/**
|
||||
* Create a new counter with the specified name n * @return {@link AtomicLong} instance for the
|
||||
* counter with counterName
|
||||
* Create a new counter with the specified name
|
||||
* @return {@link AtomicLong} instance for the counter with counterName
|
||||
*/
|
||||
protected AtomicLong createCounter(String counterName) {
|
||||
AtomicLong c = new AtomicLong(0);
|
||||
|
@ -59,9 +59,6 @@ public class ServerSideScanMetrics {
|
|||
*/
|
||||
public final AtomicLong countOfRowsScanned = createCounter(COUNT_OF_ROWS_SCANNED_KEY_METRIC_NAME);
|
||||
|
||||
/**
|
||||
* nn
|
||||
*/
|
||||
public void setCounter(String counterName, long value) {
|
||||
AtomicLong c = this.counters.get(counterName);
|
||||
if (c != null) {
|
||||
|
@ -69,23 +66,16 @@ public class ServerSideScanMetrics {
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* n * @return true if a counter exists with the counterName
|
||||
*/
|
||||
/** Returns true if a counter exists with the counterName */
|
||||
public boolean hasCounter(String counterName) {
|
||||
return this.counters.containsKey(counterName);
|
||||
}
|
||||
|
||||
/**
|
||||
* n * @return {@link AtomicLong} instance for this counter name, null if counter does not exist.
|
||||
*/
|
||||
/** Returns {@link AtomicLong} instance for this counter name, null if counter does not exist. */
|
||||
public AtomicLong getCounter(String counterName) {
|
||||
return this.counters.get(counterName);
|
||||
}
|
||||
|
||||
/**
|
||||
* nn
|
||||
*/
|
||||
public void addToCounter(String counterName, long delta) {
|
||||
AtomicLong c = this.counters.get(counterName);
|
||||
if (c != null) {
|
||||
|
|
|
@ -52,36 +52,27 @@ import org.apache.hbase.thirdparty.com.google.protobuf.Message;
|
|||
public abstract class ColumnInterpreter<T, S, P extends Message, Q extends Message,
|
||||
R extends Message> {
|
||||
|
||||
/**
|
||||
* nnn * @return value of type T n
|
||||
*/
|
||||
/** Returns value of type T */
|
||||
public abstract T getValue(byte[] colFamily, byte[] colQualifier, Cell c) throws IOException;
|
||||
|
||||
/**
|
||||
* nn * @return sum or non null value among (if either of them is null); otherwise returns a null.
|
||||
*/
|
||||
/** Returns sum or non null value among (if either of them is null); otherwise returns a null. */
|
||||
public abstract S add(S l1, S l2);
|
||||
|
||||
/**
|
||||
* returns the maximum value for this type T n
|
||||
* returns the maximum value for this type T
|
||||
*/
|
||||
|
||||
public abstract T getMaxValue();
|
||||
|
||||
public abstract T getMinValue();
|
||||
|
||||
/**
|
||||
* nnn
|
||||
*/
|
||||
/** Returns multiplication */
|
||||
public abstract S multiply(S o1, S o2);
|
||||
|
||||
/**
|
||||
* nn
|
||||
*/
|
||||
/** Returns increment */
|
||||
public abstract S increment(S o);
|
||||
|
||||
/**
|
||||
* provides casting opportunity between the data types. nn
|
||||
* provides casting opportunity between the data types.
|
||||
*/
|
||||
public abstract S castToReturnType(T o);
|
||||
|
||||
|
@ -96,7 +87,7 @@ public abstract class ColumnInterpreter<T, S, P extends Message, Q extends Messa
|
|||
|
||||
/**
|
||||
* used for computing average of <S> data values. Not providing the divide method that takes
|
||||
* two <S> values as it is not needed as of now. nnn
|
||||
* two <S> values as it is not needed as of now.
|
||||
*/
|
||||
public abstract double divideForAvg(S o, Long l);
|
||||
|
||||
|
@ -112,37 +103,37 @@ public abstract class ColumnInterpreter<T, S, P extends Message, Q extends Messa
|
|||
|
||||
/**
|
||||
* This method should initialize any field(s) of the ColumnInterpreter with a parsing of the
|
||||
* passed message bytes (used on the server side). n
|
||||
* passed message bytes (used on the server side).
|
||||
*/
|
||||
public abstract void initialize(P msg);
|
||||
|
||||
/**
|
||||
* This method gets the PB message corresponding to the cell type n * @return the PB message for
|
||||
* the cell-type instance
|
||||
* This method gets the PB message corresponding to the cell type
|
||||
* @return the PB message for the cell-type instance
|
||||
*/
|
||||
public abstract Q getProtoForCellType(T t);
|
||||
|
||||
/**
|
||||
* This method gets the PB message corresponding to the cell type n * @return the cell-type
|
||||
* instance from the PB message
|
||||
* This method gets the PB message corresponding to the cell type
|
||||
* @return the cell-type instance from the PB message
|
||||
*/
|
||||
public abstract T getCellValueFromProto(Q q);
|
||||
|
||||
/**
|
||||
* This method gets the PB message corresponding to the promoted type n * @return the PB message
|
||||
* for the promoted-type instance
|
||||
* This method gets the PB message corresponding to the promoted type
|
||||
* @return the PB message for the promoted-type instance
|
||||
*/
|
||||
public abstract R getProtoForPromotedType(S s);
|
||||
|
||||
/**
|
||||
* This method gets the promoted type from the proto message n * @return the promoted-type
|
||||
* instance from the PB message
|
||||
* This method gets the promoted type from the proto message
|
||||
* @return the promoted-type instance from the PB message
|
||||
*/
|
||||
public abstract S getPromotedValueFromProto(R r);
|
||||
|
||||
/**
|
||||
* The response message comes as type S. This will convert/cast it to T. In some sense, performs
|
||||
* the opposite of {@link #castToReturnType(Object)} nn
|
||||
* the opposite of {@link #castToReturnType(Object)}
|
||||
*/
|
||||
public abstract T castToCellType(S response);
|
||||
}
|
||||
|
|
|
@ -33,7 +33,7 @@ public class CoprocessorException extends DoNotRetryIOException {
|
|||
}
|
||||
|
||||
/**
|
||||
* Constructor with a Class object and exception message. nn
|
||||
* Constructor with a Class object and exception message.
|
||||
*/
|
||||
public CoprocessorException(Class<?> clazz, String s) {
|
||||
super("Coprocessor [" + clazz.getName() + "]: " + s);
|
||||
|
|
|
@ -150,7 +150,7 @@ public final class ClientExceptionsUtil {
|
|||
/**
|
||||
* Translates exception for preemptive fast fail checks.
|
||||
* @param t exception to check
|
||||
* @return translated exception n
|
||||
* @return translated exception
|
||||
*/
|
||||
public static Throwable translatePFFE(Throwable t) throws IOException {
|
||||
if (t instanceof NoSuchMethodError) {
|
||||
|
|
|
@ -35,15 +35,13 @@ public class FailedSanityCheckException extends org.apache.hadoop.hbase.DoNotRet
|
|||
}
|
||||
|
||||
/**
|
||||
* n
|
||||
*/
|
||||
* */
|
||||
public FailedSanityCheckException(String message) {
|
||||
super(message);
|
||||
}
|
||||
|
||||
/**
|
||||
* nn
|
||||
*/
|
||||
* */
|
||||
public FailedSanityCheckException(String message, Throwable cause) {
|
||||
super(message, cause);
|
||||
}
|
||||
|
|
|
@ -68,9 +68,7 @@ public class ColumnValueFilter extends FilterBase {
|
|||
this.comparator = Preconditions.checkNotNull(comparator, "Comparator should not be null");
|
||||
}
|
||||
|
||||
/**
|
||||
* n
|
||||
*/
|
||||
/** Returns operator */
|
||||
public CompareOperator getCompareOperator() {
|
||||
return op;
|
||||
}
|
||||
|
|
|
@ -216,8 +216,9 @@ public abstract class Filter {
|
|||
|
||||
/**
|
||||
* Concrete implementers can signal a failure condition in their code by throwing an
|
||||
* {@link IOException}. n * @return true if and only if the fields of the filter that are
|
||||
* serialized are equal to the corresponding fields in other. Used for testing.
|
||||
* {@link IOException}.
|
||||
* @return true if and only if the fields of the filter that are serialized are equal to the
|
||||
* corresponding fields in other. Used for testing.
|
||||
*/
|
||||
abstract boolean areSerializedFieldsEqual(Filter other);
|
||||
|
||||
|
|
|
@ -134,9 +134,9 @@ public abstract class FilterBase extends Filter {
|
|||
}
|
||||
|
||||
/**
|
||||
* Default implementation so that writers of custom filters aren't forced to implement. n
|
||||
* * @return true if and only if the fields of the filter that are serialized are equal to the
|
||||
* corresponding fields in other. Used for testing.
|
||||
* Default implementation so that writers of custom filters aren't forced to implement.
|
||||
* @return true if and only if the fields of the filter that are serialized are equal to the
|
||||
* corresponding fields in other. Used for testing.
|
||||
*/
|
||||
@Override
|
||||
boolean areSerializedFieldsEqual(Filter other) {
|
||||
|
|
|
@ -84,7 +84,7 @@ final public class FilterList extends FilterBase {
|
|||
|
||||
/**
|
||||
* Constructor that takes a var arg number of {@link Filter}s. The default operator MUST_PASS_ALL
|
||||
* is assumed. n
|
||||
* is assumed.
|
||||
*/
|
||||
public FilterList(final Filter... filters) {
|
||||
this(Operator.MUST_PASS_ALL, Arrays.asList(filters));
|
||||
|
@ -108,14 +108,14 @@ final public class FilterList extends FilterBase {
|
|||
}
|
||||
|
||||
/**
|
||||
* Get the operator. n
|
||||
* Get the operator.
|
||||
*/
|
||||
public Operator getOperator() {
|
||||
return operator;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the filters. n
|
||||
* Get the filters.
|
||||
*/
|
||||
public List<Filter> getFilters() {
|
||||
return filterListBase.getFilters();
|
||||
|
|
|
@ -92,7 +92,7 @@ public abstract class FilterListBase extends FilterBase {
|
|||
* the current child, we should set the traverse result (transformed cell) of previous node(s) as
|
||||
* the initial value. (HBASE-18879).
|
||||
* @param c The cell in question.
|
||||
* @return the transformed cell. n
|
||||
* @return the transformed cell.
|
||||
*/
|
||||
@Override
|
||||
public Cell transformCell(Cell c) throws IOException {
|
||||
|
|
|
@ -116,7 +116,8 @@ public class FuzzyRowFilter extends FilterBase {
|
|||
|
||||
/**
|
||||
* We need to preprocess mask array, as since we treat 2's as unfixed positions and -1 (0xff) as
|
||||
* fixed positions n * @return mask array
|
||||
* fixed positions
|
||||
* @return mask array
|
||||
*/
|
||||
private byte[] preprocessMask(byte[] mask) {
|
||||
if (!UNSAFE_UNALIGNED) {
|
||||
|
@ -588,8 +589,8 @@ public class FuzzyRowFilter extends FilterBase {
|
|||
|
||||
/**
|
||||
* For forward scanner, next cell hint should not contain any trailing zeroes unless they are part
|
||||
* of fuzzyKeyMeta hint = '\x01\x01\x01\x00\x00' will skip valid row '\x01\x01\x01' nn * @param
|
||||
* toInc - position of incremented byte
|
||||
* of fuzzyKeyMeta hint = '\x01\x01\x01\x00\x00' will skip valid row '\x01\x01\x01'
|
||||
* @param toInc - position of incremented byte
|
||||
* @return trimmed version of result
|
||||
*/
|
||||
|
||||
|
|
|
@ -37,7 +37,7 @@ public class RandomRowFilter extends FilterBase {
|
|||
protected boolean filterOutRow;
|
||||
|
||||
/**
|
||||
* Create a new filter with a specified chance for a row to be included. n
|
||||
* Create a new filter with a specified chance for a row to be included.
|
||||
*/
|
||||
public RandomRowFilter(float chance) {
|
||||
this.chance = chance;
|
||||
|
@ -49,7 +49,7 @@ public class RandomRowFilter extends FilterBase {
|
|||
}
|
||||
|
||||
/**
|
||||
* Set the chance that a row is included. n
|
||||
* Set the chance that a row is included.
|
||||
*/
|
||||
public void setChance(float chance) {
|
||||
this.chance = chance;
|
||||
|
|
|
@ -71,7 +71,7 @@ public class SingleColumnValueExcludeFilter extends SingleColumnValueFilter {
|
|||
}
|
||||
|
||||
/**
|
||||
* Constructor for protobuf deserialization only. nnnnnn
|
||||
* Constructor for protobuf deserialization only.
|
||||
*/
|
||||
protected SingleColumnValueExcludeFilter(final byte[] family, final byte[] qualifier,
|
||||
final CompareOperator op, ByteArrayComparable comparator, final boolean filterIfMissing,
|
||||
|
|
|
@ -111,7 +111,7 @@ public class SingleColumnValueFilter extends FilterBase {
|
|||
}
|
||||
|
||||
/**
|
||||
* Constructor for protobuf deserialization only. nnnnnn
|
||||
* Constructor for protobuf deserialization only.
|
||||
*/
|
||||
protected SingleColumnValueFilter(final byte[] family, final byte[] qualifier,
|
||||
final CompareOperator op, org.apache.hadoop.hbase.filter.ByteArrayComparable comparator,
|
||||
|
|
|
@ -54,7 +54,7 @@ public class TimestampsFilter extends FilterBase {
|
|||
long minTimestamp = Long.MAX_VALUE;
|
||||
|
||||
/**
|
||||
* Constructor for filter that retains only the specified timestamps in the list. n
|
||||
* Constructor for filter that retains only the specified timestamps in the list.
|
||||
*/
|
||||
public TimestampsFilter(List<Long> timestamps) {
|
||||
this(timestamps, false);
|
||||
|
|
|
@ -104,9 +104,10 @@ class CellBlockBuilder {
|
|||
|
||||
/**
|
||||
* Puts CellScanner Cells into a cell block using passed in <code>codec</code> and/or
|
||||
* <code>compressor</code>. nnn * @return Null or byte buffer filled with a cellblock filled with
|
||||
* passed-in Cells encoded using passed in <code>codec</code> and/or <code>compressor</code>; the
|
||||
* returned buffer has been flipped and is ready for reading. Use limit to find total size. n
|
||||
* <code>compressor</code>.
|
||||
* @return Null or byte buffer filled with a cellblock filled with passed-in Cells encoded using
|
||||
* passed in <code>codec</code> and/or <code>compressor</code>; the returned buffer has
|
||||
* been flipped and is ready for reading. Use limit to find total size.
|
||||
*/
|
||||
public ByteBuffer buildCellBlock(final Codec codec, final CompressionCodec compressor,
|
||||
final CellScanner cellScanner) throws IOException {
|
||||
|
|
|
@ -34,8 +34,7 @@ public class LeaseException extends DoNotRetryIOException {
|
|||
}
|
||||
|
||||
/**
|
||||
* n
|
||||
*/
|
||||
* */
|
||||
public LeaseException(String message) {
|
||||
super(message);
|
||||
}
|
||||
|
|
|
@ -33,8 +33,7 @@ public class FailedLogCloseException extends IOException {
|
|||
}
|
||||
|
||||
/**
|
||||
* n
|
||||
*/
|
||||
* */
|
||||
public FailedLogCloseException(String msg) {
|
||||
super(msg);
|
||||
}
|
||||
|
|
|
@ -32,8 +32,7 @@ public class FailedSyncBeforeLogCloseException extends FailedLogCloseException {
|
|||
}
|
||||
|
||||
/**
|
||||
* n
|
||||
*/
|
||||
* */
|
||||
public FailedSyncBeforeLogCloseException(String msg) {
|
||||
super(msg);
|
||||
}
|
||||
|
|
|
@ -50,7 +50,7 @@ public abstract class AbstractHBaseSaslRpcClient {
|
|||
* @param token token to use if needed by the authentication method
|
||||
* @param serverAddr the address of the hbase service
|
||||
* @param securityInfo the security details for the remote hbase service
|
||||
* @param fallbackAllowed does the client allow fallback to simple authentication n
|
||||
* @param fallbackAllowed does the client allow fallback to simple authentication
|
||||
*/
|
||||
protected AbstractHBaseSaslRpcClient(Configuration conf,
|
||||
SaslClientAuthenticationProvider provider, Token<? extends TokenIdentifier> token,
|
||||
|
@ -66,7 +66,7 @@ public abstract class AbstractHBaseSaslRpcClient {
|
|||
* @param serverAddr the address of the hbase service
|
||||
* @param securityInfo the security details for the remote hbase service
|
||||
* @param fallbackAllowed does the client allow fallback to simple authentication
|
||||
* @param rpcProtection the protection level ("authentication", "integrity" or "privacy") n
|
||||
* @param rpcProtection the protection level ("authentication", "integrity" or "privacy")
|
||||
*/
|
||||
protected AbstractHBaseSaslRpcClient(Configuration conf,
|
||||
SaslClientAuthenticationProvider provider, Token<? extends TokenIdentifier> token,
|
||||
|
|
|
@ -62,7 +62,7 @@ public final class EncryptionUtil {
|
|||
* @param conf configuration
|
||||
* @param key the raw key bytes
|
||||
* @param algorithm the algorithm to use with this key material
|
||||
* @return the encrypted key bytes n
|
||||
* @return the encrypted key bytes
|
||||
*/
|
||||
public static byte[] wrapKey(Configuration conf, byte[] key, String algorithm)
|
||||
throws IOException {
|
||||
|
@ -115,7 +115,7 @@ public final class EncryptionUtil {
|
|||
* @param conf configuration
|
||||
* @param subject subject key alias
|
||||
* @param value the encrypted key bytes
|
||||
* @return the raw key bytes nn
|
||||
* @return the raw key bytes
|
||||
*/
|
||||
public static Key unwrapKey(Configuration conf, String subject, byte[] value)
|
||||
throws IOException, KeyException {
|
||||
|
|
|
@ -86,7 +86,7 @@ public class HBaseSaslRpcClient extends AbstractHBaseSaslRpcClient {
|
|||
* Do client side SASL authentication with server via the given InputStream and OutputStream
|
||||
* @param inS InputStream to use
|
||||
* @param outS OutputStream to use
|
||||
* @return true if connection is set up, or false if needs to switch to simple Auth. n
|
||||
* @return true if connection is set up, or false if needs to switch to simple Auth.
|
||||
*/
|
||||
public boolean saslConnect(InputStream inS, OutputStream outS) throws IOException {
|
||||
DataInputStream inStream = new DataInputStream(new BufferedInputStream(inS));
|
||||
|
@ -185,7 +185,7 @@ public class HBaseSaslRpcClient extends AbstractHBaseSaslRpcClient {
|
|||
|
||||
/**
|
||||
* Get a SASL wrapped InputStream. Can be called only after saslConnect() has been called.
|
||||
* @return a SASL wrapped InputStream n
|
||||
* @return a SASL wrapped InputStream
|
||||
*/
|
||||
public InputStream getInputStream() throws IOException {
|
||||
if (!saslClient.isComplete()) {
|
||||
|
@ -248,7 +248,7 @@ public class HBaseSaslRpcClient extends AbstractHBaseSaslRpcClient {
|
|||
|
||||
/**
|
||||
* Get a SASL wrapped OutputStream. Can be called only after saslConnect() has been called.
|
||||
* @return a SASL wrapped OutputStream n
|
||||
* @return a SASL wrapped OutputStream
|
||||
*/
|
||||
public OutputStream getOutputStream() throws IOException {
|
||||
if (!saslClient.isComplete()) {
|
||||
|
|
|
@ -45,7 +45,7 @@ public class AccessControlClient {
|
|||
/**
|
||||
* Return true if authorization is supported and enabled
|
||||
* @param connection The connection to use
|
||||
* @return true if authorization is supported and enabled, false otherwise n
|
||||
* @return true if authorization is supported and enabled, false otherwise
|
||||
*/
|
||||
public static boolean isAuthorizationEnabled(Connection connection) throws IOException {
|
||||
return connection.getAdmin().getSecurityCapabilities()
|
||||
|
@ -55,7 +55,7 @@ public class AccessControlClient {
|
|||
/**
|
||||
* Return true if cell authorization is supported and enabled
|
||||
* @param connection The connection to use
|
||||
* @return true if cell authorization is supported and enabled, false otherwise n
|
||||
* @return true if cell authorization is supported and enabled, false otherwise
|
||||
*/
|
||||
public static boolean isCellAuthorizationEnabled(Connection connection) throws IOException {
|
||||
return connection.getAdmin().getSecurityCapabilities()
|
||||
|
@ -146,7 +146,7 @@ public class AccessControlClient {
|
|||
|
||||
/**
|
||||
* Grant global permissions for the specified user. If permissions for the specified user exists,
|
||||
* later granted permissions will override previous granted permissions. nnnn
|
||||
* later granted permissions will override previous granted permissions.
|
||||
*/
|
||||
public static void grant(Connection connection, final String userName,
|
||||
final Permission.Action... actions) throws Throwable {
|
||||
|
@ -162,7 +162,7 @@ public class AccessControlClient {
|
|||
|
||||
/**
|
||||
* Revokes the permission on the table
|
||||
* @param connection The Connection instance to use nnnnnn
|
||||
* @param connection The Connection instance to use
|
||||
*/
|
||||
public static void revoke(Connection connection, final TableName tableName, final String username,
|
||||
final byte[] family, final byte[] qualifier, final Permission.Action... actions)
|
||||
|
@ -173,7 +173,7 @@ public class AccessControlClient {
|
|||
|
||||
/**
|
||||
* Revokes the permission on the namespace for the specified user.
|
||||
* @param connection The Connection instance to use nnnn
|
||||
* @param connection The Connection instance to use
|
||||
*/
|
||||
public static void revoke(Connection connection, final String namespace, final String userName,
|
||||
final Permission.Action... actions) throws Throwable {
|
||||
|
@ -197,7 +197,7 @@ public class AccessControlClient {
|
|||
* along with the list of superusers would be returned. Else, no rows get returned.
|
||||
* @param connection The Connection instance to use
|
||||
* @param tableRegex The regular expression string to match against
|
||||
* @return List of UserPermissions n
|
||||
* @return List of UserPermissions
|
||||
*/
|
||||
public static List<UserPermission> getUserPermissions(Connection connection, String tableRegex)
|
||||
throws Throwable {
|
||||
|
|
|
@ -450,8 +450,8 @@ public class AccessControlUtil {
|
|||
* It's also called by the shell, in case you want to find references.
|
||||
* @param protocol the AccessControlService protocol proxy
|
||||
* @param userShortName the short name of the user to grant permissions
|
||||
* @param actions the permissions to be granted n * @deprecated Use
|
||||
* {@link Admin#grant(UserPermission, boolean)} instead.
|
||||
* @param actions the permissions to be granted
|
||||
* @deprecated Use {@link Admin#grant(UserPermission, boolean)} instead.
|
||||
*/
|
||||
@Deprecated
|
||||
public static void grant(RpcController controller,
|
||||
|
@ -478,8 +478,8 @@ public class AccessControlUtil {
|
|||
* @param tableName optional table name
|
||||
* @param f optional column family
|
||||
* @param q optional qualifier
|
||||
* @param actions the permissions to be granted n * @deprecated Use
|
||||
* {@link Admin#grant(UserPermission, boolean)} instead.
|
||||
* @param actions the permissions to be granted
|
||||
* @deprecated Use {@link Admin#grant(UserPermission, boolean)} instead.
|
||||
*/
|
||||
@Deprecated
|
||||
public static void grant(RpcController controller,
|
||||
|
@ -504,8 +504,8 @@ public class AccessControlUtil {
|
|||
* @param controller RpcController
|
||||
* @param protocol the AccessControlService protocol proxy
|
||||
* @param namespace the short name of the user to grant permissions
|
||||
* @param actions the permissions to be granted n * @deprecated Use
|
||||
* {@link Admin#grant(UserPermission, boolean)} instead.
|
||||
* @param actions the permissions to be granted
|
||||
* @deprecated Use {@link Admin#grant(UserPermission, boolean)} instead.
|
||||
*/
|
||||
@Deprecated
|
||||
public static void grant(RpcController controller,
|
||||
|
@ -621,9 +621,8 @@ public class AccessControlUtil {
|
|||
* A utility used to get user's global permissions based on the specified user name.
|
||||
* @param controller RpcController
|
||||
* @param protocol the AccessControlService protocol proxy
|
||||
* @param userName User name, if empty then all user permissions will be retrieved. n
|
||||
* * @deprecated Use {@link Admin#getUserPermissions(GetUserPermissionsRequest)}
|
||||
* instead.
|
||||
* @param userName User name, if empty then all user permissions will be retrieved.
|
||||
* @deprecated Use {@link Admin#getUserPermissions(GetUserPermissionsRequest)} instead.
|
||||
*/
|
||||
@Deprecated
|
||||
public static List<UserPermission> getUserPermissions(RpcController controller,
|
||||
|
@ -651,8 +650,8 @@ public class AccessControlUtil {
|
|||
* It's also called by the shell, in case you want to find references.
|
||||
* @param controller RpcController
|
||||
* @param protocol the AccessControlService protocol proxy
|
||||
* @param t optional table name n * @deprecated Use
|
||||
* {@link Admin#getUserPermissions(GetUserPermissionsRequest)} instead.
|
||||
* @param t optional table name
|
||||
* @deprecated Use {@link Admin#getUserPermissions(GetUserPermissionsRequest)} instead.
|
||||
*/
|
||||
@Deprecated
|
||||
public static List<UserPermission> getUserPermissions(RpcController controller,
|
||||
|
@ -668,9 +667,8 @@ public class AccessControlUtil {
|
|||
* @param t optional table name
|
||||
* @param columnFamily Column family
|
||||
* @param columnQualifier Column qualifier
|
||||
* @param userName User name, if empty then all user permissions will be retrieved. n
|
||||
* * @deprecated Use
|
||||
* {@link Admin#getUserPermissions(GetUserPermissionsRequest)} instead.
|
||||
* @param userName User name, if empty then all user permissions will be retrieved.
|
||||
* @deprecated Use {@link Admin#getUserPermissions(GetUserPermissionsRequest)} instead.
|
||||
*/
|
||||
@Deprecated
|
||||
public static List<UserPermission> getUserPermissions(RpcController controller,
|
||||
|
@ -708,8 +706,8 @@ public class AccessControlUtil {
|
|||
* It's also called by the shell, in case you want to find references.
|
||||
* @param controller RpcController
|
||||
* @param protocol the AccessControlService protocol proxy
|
||||
* @param namespace name of the namespace n * @deprecated Use
|
||||
* {@link Admin#getUserPermissions(GetUserPermissionsRequest)} instead.
|
||||
* @param namespace name of the namespace
|
||||
* @deprecated Use {@link Admin#getUserPermissions(GetUserPermissionsRequest)} instead.
|
||||
*/
|
||||
@Deprecated
|
||||
public static List<UserPermission> getUserPermissions(RpcController controller,
|
||||
|
@ -722,9 +720,8 @@ public class AccessControlUtil {
|
|||
* @param controller RpcController
|
||||
* @param protocol the AccessControlService protocol proxy
|
||||
* @param namespace name of the namespace
|
||||
* @param userName User name, if empty then all user permissions will be retrieved. n
|
||||
* * @deprecated Use {@link Admin#getUserPermissions(GetUserPermissionsRequest)}
|
||||
* instead.
|
||||
* @param userName User name, if empty then all user permissions will be retrieved.
|
||||
* @deprecated Use {@link Admin#getUserPermissions(GetUserPermissionsRequest)} instead.
|
||||
*/
|
||||
@Deprecated
|
||||
public static List<UserPermission> getUserPermissions(RpcController controller,
|
||||
|
@ -762,8 +759,8 @@ public class AccessControlUtil {
|
|||
* will not be considered if columnFamily is passed as null or empty.
|
||||
* @param userName User name, it shouldn't be null or empty.
|
||||
* @param actions Actions
|
||||
* @return true if access allowed, otherwise false n * @deprecated Use
|
||||
* {@link Admin#hasUserPermissions(String, List)} instead.
|
||||
* @return true if access allowed, otherwise false
|
||||
* @deprecated Use {@link Admin#hasUserPermissions(String, List)} instead.
|
||||
*/
|
||||
@Deprecated
|
||||
public static boolean hasPermission(RpcController controller,
|
||||
|
|
|
@ -55,7 +55,7 @@ public class VisibilityClient {
|
|||
/**
|
||||
* Return true if cell visibility features are supported and enabled
|
||||
* @param connection The connection to use
|
||||
* @return true if cell visibility features are supported and enabled, false otherwise n
|
||||
* @return true if cell visibility features are supported and enabled, false otherwise
|
||||
*/
|
||||
public static boolean isCellVisibilityEnabled(Connection connection) throws IOException {
|
||||
return connection.getAdmin().getSecurityCapabilities()
|
||||
|
@ -63,7 +63,7 @@ public class VisibilityClient {
|
|||
}
|
||||
|
||||
/**
|
||||
* Utility method for adding label to the system. nnnn
|
||||
* Utility method for adding label to the system.
|
||||
*/
|
||||
public static VisibilityLabelsResponse addLabel(Connection connection, final String label)
|
||||
throws Throwable {
|
||||
|
@ -71,7 +71,7 @@ public class VisibilityClient {
|
|||
}
|
||||
|
||||
/**
|
||||
* Utility method for adding labels to the system. nnnn
|
||||
* Utility method for adding labels to the system.
|
||||
*/
|
||||
public static VisibilityLabelsResponse addLabels(Connection connection, final String[] labels)
|
||||
throws Throwable {
|
||||
|
@ -109,7 +109,7 @@ public class VisibilityClient {
|
|||
}
|
||||
|
||||
/**
|
||||
* Sets given labels globally authorized for the user. nnnnn
|
||||
* Sets given labels globally authorized for the user.
|
||||
*/
|
||||
public static VisibilityLabelsResponse setAuths(Connection connection, final String[] auths,
|
||||
final String user) throws Throwable {
|
||||
|
@ -154,7 +154,7 @@ public class VisibilityClient {
|
|||
* Retrieve the list of visibility labels defined in the system.
|
||||
* @param connection The Connection instance to use.
|
||||
* @param regex The regular expression to filter which labels are returned.
|
||||
* @return labels The list of visibility labels defined in the system. n
|
||||
* @return labels The list of visibility labels defined in the system.
|
||||
*/
|
||||
public static ListLabelsResponse listLabels(Connection connection, final String regex)
|
||||
throws Throwable {
|
||||
|
@ -190,7 +190,7 @@ public class VisibilityClient {
|
|||
}
|
||||
|
||||
/**
|
||||
* Removes given labels from user's globally authorized list of labels. nnnnn
|
||||
* Removes given labels from user's globally authorized list of labels.
|
||||
*/
|
||||
public static VisibilityLabelsResponse clearAuths(Connection connection, final String[] auths,
|
||||
final String user) throws Throwable {
|
||||
|
|
|
@ -562,7 +562,7 @@ public final class ProtobufUtil {
|
|||
/**
|
||||
* Convert a protocol buffer Get to a client Get
|
||||
* @param proto the protocol buffer Get to convert
|
||||
* @return the converted client Get n
|
||||
* @return the converted client Get
|
||||
*/
|
||||
public static Get toGet(final ClientProtos.Get proto) throws IOException {
|
||||
if (proto == null) return null;
|
||||
|
@ -647,7 +647,7 @@ public final class ProtobufUtil {
|
|||
/**
|
||||
* Convert a protocol buffer Mutate to a Put.
|
||||
* @param proto The protocol buffer MutationProto to convert
|
||||
* @return A client Put. n
|
||||
* @return A client Put.
|
||||
*/
|
||||
public static Put toPut(final MutationProto proto) throws IOException {
|
||||
return toPut(proto, null);
|
||||
|
@ -657,7 +657,7 @@ public final class ProtobufUtil {
|
|||
* Convert a protocol buffer Mutate to a Put.
|
||||
* @param proto The protocol buffer MutationProto to convert
|
||||
* @param cellScanner If non-null, the Cell data that goes with this proto.
|
||||
* @return A client Put. n
|
||||
* @return A client Put.
|
||||
*/
|
||||
public static Put toPut(final MutationProto proto, final CellScanner cellScanner)
|
||||
throws IOException {
|
||||
|
@ -741,7 +741,7 @@ public final class ProtobufUtil {
|
|||
/**
|
||||
* Convert a protocol buffer Mutate to a Delete
|
||||
* @param proto the protocol buffer Mutate to convert
|
||||
* @return the converted client Delete n
|
||||
* @return the converted client Delete
|
||||
*/
|
||||
public static Delete toDelete(final MutationProto proto) throws IOException {
|
||||
return toDelete(proto, null);
|
||||
|
@ -751,7 +751,7 @@ public final class ProtobufUtil {
|
|||
* Convert a protocol buffer Mutate to a Delete
|
||||
* @param proto the protocol buffer Mutate to convert
|
||||
* @param cellScanner if non-null, the data that goes with this delete.
|
||||
* @return the converted client Delete n
|
||||
* @return the converted client Delete
|
||||
*/
|
||||
public static Delete toDelete(final MutationProto proto, final CellScanner cellScanner)
|
||||
throws IOException {
|
||||
|
@ -920,7 +920,7 @@ public final class ProtobufUtil {
|
|||
/**
|
||||
* Convert a MutateRequest to Mutation
|
||||
* @param proto the protocol buffer Mutate to convert
|
||||
* @return the converted Mutation n
|
||||
* @return the converted Mutation
|
||||
*/
|
||||
public static Mutation toMutation(final MutationProto proto) throws IOException {
|
||||
MutationType type = proto.getMutateType();
|
||||
|
@ -968,7 +968,7 @@ public final class ProtobufUtil {
|
|||
/**
|
||||
* Convert a client Scan to a protocol buffer Scan
|
||||
* @param scan the client Scan to convert
|
||||
* @return the converted protocol buffer Scan n
|
||||
* @return the converted protocol buffer Scan
|
||||
*/
|
||||
public static ClientProtos.Scan toScan(final Scan scan) throws IOException {
|
||||
ClientProtos.Scan.Builder scanBuilder = ClientProtos.Scan.newBuilder();
|
||||
|
@ -1062,7 +1062,7 @@ public final class ProtobufUtil {
|
|||
/**
|
||||
* Convert a protocol buffer Scan to a client Scan
|
||||
* @param proto the protocol buffer Scan to convert
|
||||
* @return the converted client Scan n
|
||||
* @return the converted client Scan
|
||||
*/
|
||||
public static Scan toScan(final ClientProtos.Scan proto) throws IOException {
|
||||
byte[] startRow = HConstants.EMPTY_START_ROW;
|
||||
|
@ -1182,7 +1182,7 @@ public final class ProtobufUtil {
|
|||
/**
|
||||
* Create a protocol buffer Get based on a client Get.
|
||||
* @param get the client Get
|
||||
* @return a protocol buffer Get n
|
||||
* @return a protocol buffer Get
|
||||
*/
|
||||
public static ClientProtos.Get toGet(final Get get) throws IOException {
|
||||
ClientProtos.Get.Builder builder = ClientProtos.Get.newBuilder();
|
||||
|
@ -1248,7 +1248,8 @@ public final class ProtobufUtil {
|
|||
}
|
||||
|
||||
/**
|
||||
* Create a protocol buffer Mutate based on a client Mutation nn * @return a protobuf'd Mutation n
|
||||
* Create a protocol buffer Mutate based on a client Mutation
|
||||
* @return a protobuf'd Mutation
|
||||
*/
|
||||
public static MutationProto toMutation(final MutationType type, final Mutation mutation,
|
||||
final long nonce) throws IOException {
|
||||
|
@ -1297,8 +1298,8 @@ public final class ProtobufUtil {
|
|||
|
||||
/**
|
||||
* Create a protocol buffer MutationProto based on a client Mutation. Does NOT include data.
|
||||
* Understanding is that the Cell will be transported other than via protobuf. nnn * @return a
|
||||
* protobuf'd Mutation n
|
||||
* Understanding is that the Cell will be transported other than via protobuf.
|
||||
* @return a protobuf'd Mutation
|
||||
*/
|
||||
public static MutationProto toMutationNoData(final MutationType type, final Mutation mutation,
|
||||
final MutationProto.Builder builder) throws IOException {
|
||||
|
@ -1307,8 +1308,8 @@ public final class ProtobufUtil {
|
|||
|
||||
/**
|
||||
* Create a protocol buffer MutationProto based on a client Mutation. Does NOT include data.
|
||||
* Understanding is that the Cell will be transported other than via protobuf. nn * @return a
|
||||
* protobuf'd Mutation n
|
||||
* Understanding is that the Cell will be transported other than via protobuf.
|
||||
* @return a protobuf'd Mutation
|
||||
*/
|
||||
public static MutationProto toMutationNoData(final MutationType type, final Mutation mutation)
|
||||
throws IOException {
|
||||
|
@ -1334,8 +1335,8 @@ public final class ProtobufUtil {
|
|||
|
||||
/**
|
||||
* Code shared by {@link #toMutation(MutationType, Mutation)} and
|
||||
* {@link #toMutationNoData(MutationType, Mutation)} nn * @return A partly-filled out protobuf'd
|
||||
* Mutation.
|
||||
* {@link #toMutationNoData(MutationType, Mutation)}
|
||||
* @return A partly-filled out protobuf'd Mutation.
|
||||
*/
|
||||
private static MutationProto.Builder getMutationBuilderAndSetCommonFields(final MutationType type,
|
||||
final Mutation mutation, MutationProto.Builder builder) {
|
||||
|
@ -1468,7 +1469,7 @@ public final class ProtobufUtil {
|
|||
* Convert a protocol buffer Result to a client Result
|
||||
* @param proto the protocol buffer Result to convert
|
||||
* @param scanner Optional cell scanner.
|
||||
* @return the converted client Result n
|
||||
* @return the converted client Result
|
||||
*/
|
||||
public static Result toResult(final ClientProtos.Result proto, final CellScanner scanner)
|
||||
throws IOException {
|
||||
|
@ -1583,8 +1584,8 @@ public final class ProtobufUtil {
|
|||
}
|
||||
|
||||
/**
|
||||
* Convert a delete KeyValue type to protocol buffer DeleteType. n * @return protocol buffer
|
||||
* DeleteType n
|
||||
* Convert a delete KeyValue type to protocol buffer DeleteType.
|
||||
* @return protocol buffer DeleteType
|
||||
*/
|
||||
public static DeleteType toDeleteType(KeyValue.Type type) throws IOException {
|
||||
switch (type) {
|
||||
|
@ -1604,7 +1605,7 @@ public final class ProtobufUtil {
|
|||
/**
|
||||
* Convert a protocol buffer DeleteType to delete KeyValue type.
|
||||
* @param type The DeleteType
|
||||
* @return The type. n
|
||||
* @return The type.
|
||||
*/
|
||||
public static KeyValue.Type fromDeleteType(DeleteType type) throws IOException {
|
||||
switch (type) {
|
||||
|
@ -1690,7 +1691,7 @@ public final class ProtobufUtil {
|
|||
}
|
||||
|
||||
/**
|
||||
* A helper to close a region given a region name using admin protocol. nnn
|
||||
* A helper to close a region given a region name using admin protocol.
|
||||
*/
|
||||
public static void closeRegion(final RpcController controller,
|
||||
final AdminService.BlockingInterface admin, final ServerName server, final byte[] regionName)
|
||||
|
@ -1705,7 +1706,7 @@ public final class ProtobufUtil {
|
|||
}
|
||||
|
||||
/**
|
||||
* A helper to warmup a region given a region name using admin protocol nn *
|
||||
* A helper to warmup a region given a region name using admin protocol
|
||||
*/
|
||||
public static void warmupRegion(final RpcController controller,
|
||||
final AdminService.BlockingInterface admin,
|
||||
|
@ -1722,7 +1723,7 @@ public final class ProtobufUtil {
|
|||
}
|
||||
|
||||
/**
|
||||
* A helper to open a region using admin protocol. nnn
|
||||
* A helper to open a region using admin protocol.
|
||||
*/
|
||||
public static void openRegion(final RpcController controller,
|
||||
final AdminService.BlockingInterface admin, ServerName server,
|
||||
|
@ -1736,8 +1737,8 @@ public final class ProtobufUtil {
|
|||
}
|
||||
|
||||
/**
|
||||
* A helper to get the all the online regions on a region server using admin protocol. n * @return
|
||||
* a list of online region info n
|
||||
* A helper to get the all the online regions on a region server using admin protocol.
|
||||
* @return a list of online region info
|
||||
*/
|
||||
public static List<org.apache.hadoop.hbase.client.RegionInfo>
|
||||
getOnlineRegions(final AdminService.BlockingInterface admin) throws IOException {
|
||||
|
@ -2069,7 +2070,8 @@ public final class ProtobufUtil {
|
|||
/**
|
||||
* Return short version of Message toString'd, shorter than TextFormat#shortDebugString. Tries to
|
||||
* NOT print out data both because it can be big but also so we do not have data in our logs. Use
|
||||
* judiciously. n * @return toString of passed <code>m</code>
|
||||
* judiciously.
|
||||
* @return toString of passed <code>m</code>
|
||||
*/
|
||||
public static String getShortTextFormat(Message m) {
|
||||
if (m == null) return "null";
|
||||
|
@ -2216,8 +2218,8 @@ public final class ProtobufUtil {
|
|||
}
|
||||
|
||||
/**
|
||||
* Convert a protocol buffer CellVisibility to a client CellVisibility n * @return the converted
|
||||
* client CellVisibility
|
||||
* Convert a protocol buffer CellVisibility to a client CellVisibility
|
||||
* @return the converted client CellVisibility
|
||||
*/
|
||||
public static CellVisibility toCellVisibility(ClientProtos.CellVisibility proto) {
|
||||
if (proto == null) return null;
|
||||
|
@ -2225,8 +2227,8 @@ public final class ProtobufUtil {
|
|||
}
|
||||
|
||||
/**
|
||||
* Convert a protocol buffer CellVisibility bytes to a client CellVisibility n * @return the
|
||||
* converted client CellVisibility n
|
||||
* Convert a protocol buffer CellVisibility bytes to a client CellVisibility
|
||||
* @return the converted client CellVisibility
|
||||
*/
|
||||
public static CellVisibility toCellVisibility(byte[] protoBytes) throws DeserializationException {
|
||||
if (protoBytes == null) return null;
|
||||
|
@ -2242,8 +2244,8 @@ public final class ProtobufUtil {
|
|||
}
|
||||
|
||||
/**
|
||||
* Create a protocol buffer CellVisibility based on a client CellVisibility. n * @return a
|
||||
* protocol buffer CellVisibility
|
||||
* Create a protocol buffer CellVisibility based on a client CellVisibility.
|
||||
* @return a protocol buffer CellVisibility
|
||||
*/
|
||||
public static ClientProtos.CellVisibility toCellVisibility(CellVisibility cellVisibility) {
|
||||
ClientProtos.CellVisibility.Builder builder = ClientProtos.CellVisibility.newBuilder();
|
||||
|
@ -2252,8 +2254,8 @@ public final class ProtobufUtil {
|
|||
}
|
||||
|
||||
/**
|
||||
* Convert a protocol buffer Authorizations to a client Authorizations n * @return the converted
|
||||
* client Authorizations
|
||||
* Convert a protocol buffer Authorizations to a client Authorizations
|
||||
* @return the converted client Authorizations
|
||||
*/
|
||||
public static Authorizations toAuthorizations(ClientProtos.Authorizations proto) {
|
||||
if (proto == null) return null;
|
||||
|
@ -2261,8 +2263,8 @@ public final class ProtobufUtil {
|
|||
}
|
||||
|
||||
/**
|
||||
* Convert a protocol buffer Authorizations bytes to a client Authorizations n * @return the
|
||||
* converted client Authorizations n
|
||||
* Convert a protocol buffer Authorizations bytes to a client Authorizations
|
||||
* @return the converted client Authorizations
|
||||
*/
|
||||
public static Authorizations toAuthorizations(byte[] protoBytes) throws DeserializationException {
|
||||
if (protoBytes == null) return null;
|
||||
|
@ -2278,8 +2280,8 @@ public final class ProtobufUtil {
|
|||
}
|
||||
|
||||
/**
|
||||
* Create a protocol buffer Authorizations based on a client Authorizations. n * @return a
|
||||
* protocol buffer Authorizations
|
||||
* Create a protocol buffer Authorizations based on a client Authorizations.
|
||||
* @return a protocol buffer Authorizations
|
||||
*/
|
||||
public static ClientProtos.Authorizations toAuthorizations(Authorizations authorizations) {
|
||||
ClientProtos.Authorizations.Builder builder = ClientProtos.Authorizations.newBuilder();
|
||||
|
@ -2290,8 +2292,8 @@ public final class ProtobufUtil {
|
|||
}
|
||||
|
||||
/**
|
||||
* Convert a protocol buffer TimeUnit to a client TimeUnit n * @return the converted client
|
||||
* TimeUnit
|
||||
* Convert a protocol buffer TimeUnit to a client TimeUnit
|
||||
* @return the converted client TimeUnit
|
||||
*/
|
||||
public static TimeUnit toTimeUnit(final HBaseProtos.TimeUnit proto) {
|
||||
switch (proto) {
|
||||
|
@ -2314,8 +2316,8 @@ public final class ProtobufUtil {
|
|||
}
|
||||
|
||||
/**
|
||||
* Convert a client TimeUnit to a protocol buffer TimeUnit n * @return the converted protocol
|
||||
* buffer TimeUnit
|
||||
* Convert a client TimeUnit to a protocol buffer TimeUnit
|
||||
* @return the converted protocol buffer TimeUnit
|
||||
*/
|
||||
public static HBaseProtos.TimeUnit toProtoTimeUnit(final TimeUnit timeUnit) {
|
||||
switch (timeUnit) {
|
||||
|
@ -2338,8 +2340,8 @@ public final class ProtobufUtil {
|
|||
}
|
||||
|
||||
/**
|
||||
* Convert a protocol buffer ThrottleType to a client ThrottleType n * @return the converted
|
||||
* client ThrottleType
|
||||
* Convert a protocol buffer ThrottleType to a client ThrottleType
|
||||
* @return the converted client ThrottleType
|
||||
*/
|
||||
public static ThrottleType toThrottleType(final QuotaProtos.ThrottleType proto) {
|
||||
switch (proto) {
|
||||
|
@ -2367,8 +2369,8 @@ public final class ProtobufUtil {
|
|||
}
|
||||
|
||||
/**
|
||||
* Convert a client ThrottleType to a protocol buffer ThrottleType n * @return the converted
|
||||
* protocol buffer ThrottleType
|
||||
* Convert a client ThrottleType to a protocol buffer ThrottleType
|
||||
* @return the converted protocol buffer ThrottleType
|
||||
*/
|
||||
public static QuotaProtos.ThrottleType toProtoThrottleType(final ThrottleType type) {
|
||||
switch (type) {
|
||||
|
@ -2396,8 +2398,8 @@ public final class ProtobufUtil {
|
|||
}
|
||||
|
||||
/**
|
||||
* Convert a protocol buffer QuotaScope to a client QuotaScope n * @return the converted client
|
||||
* QuotaScope
|
||||
* Convert a protocol buffer QuotaScope to a client QuotaScope
|
||||
* @return the converted client QuotaScope
|
||||
*/
|
||||
public static QuotaScope toQuotaScope(final QuotaProtos.QuotaScope proto) {
|
||||
switch (proto) {
|
||||
|
@ -2410,8 +2412,8 @@ public final class ProtobufUtil {
|
|||
}
|
||||
|
||||
/**
|
||||
* Convert a client QuotaScope to a protocol buffer QuotaScope n * @return the converted protocol
|
||||
* buffer QuotaScope
|
||||
* Convert a client QuotaScope to a protocol buffer QuotaScope
|
||||
* @return the converted protocol buffer QuotaScope
|
||||
*/
|
||||
public static QuotaProtos.QuotaScope toProtoQuotaScope(final QuotaScope scope) {
|
||||
switch (scope) {
|
||||
|
@ -2424,8 +2426,8 @@ public final class ProtobufUtil {
|
|||
}
|
||||
|
||||
/**
|
||||
* Convert a protocol buffer QuotaType to a client QuotaType n * @return the converted client
|
||||
* QuotaType
|
||||
* Convert a protocol buffer QuotaType to a client QuotaType
|
||||
* @return the converted client QuotaType
|
||||
*/
|
||||
public static QuotaType toQuotaScope(final QuotaProtos.QuotaType proto) {
|
||||
switch (proto) {
|
||||
|
@ -2438,8 +2440,8 @@ public final class ProtobufUtil {
|
|||
}
|
||||
|
||||
/**
|
||||
* Convert a client QuotaType to a protocol buffer QuotaType n * @return the converted protocol
|
||||
* buffer QuotaType
|
||||
* Convert a client QuotaType to a protocol buffer QuotaType
|
||||
* @return the converted protocol buffer QuotaType
|
||||
*/
|
||||
public static QuotaProtos.QuotaType toProtoQuotaScope(final QuotaType type) {
|
||||
switch (type) {
|
||||
|
@ -2566,7 +2568,7 @@ public final class ProtobufUtil {
|
|||
* This version of protobuf's mergeDelimitedFrom avoid the hard-coded 64MB limit for decoding
|
||||
* buffers
|
||||
* @param builder current message builder
|
||||
* @param in Inputsream with delimited protobuf data n
|
||||
* @param in Inputsream with delimited protobuf data
|
||||
*/
|
||||
public static void mergeDelimitedFrom(Message.Builder builder, InputStream in)
|
||||
throws IOException {
|
||||
|
@ -2588,7 +2590,7 @@ public final class ProtobufUtil {
|
|||
* where the message size is known
|
||||
* @param builder current message builder
|
||||
* @param in InputStream containing protobuf data
|
||||
* @param size known size of protobuf data n
|
||||
* @param size known size of protobuf data
|
||||
*/
|
||||
public static void mergeFrom(Message.Builder builder, InputStream in, int size)
|
||||
throws IOException {
|
||||
|
@ -2602,7 +2604,7 @@ public final class ProtobufUtil {
|
|||
* This version of protobuf's mergeFrom avoids the hard-coded 64MB limit for decoding buffers
|
||||
* where the message size is not known
|
||||
* @param builder current message builder
|
||||
* @param in InputStream containing protobuf data n
|
||||
* @param in InputStream containing protobuf data
|
||||
*/
|
||||
public static void mergeFrom(Message.Builder builder, InputStream in) throws IOException {
|
||||
final CodedInputStream codedInput = CodedInputStream.newInstance(in);
|
||||
|
@ -2615,7 +2617,7 @@ public final class ProtobufUtil {
|
|||
* This version of protobuf's mergeFrom avoids the hard-coded 64MB limit for decoding buffers when
|
||||
* working with ByteStrings
|
||||
* @param builder current message builder
|
||||
* @param bs ByteString containing the n
|
||||
* @param bs ByteString containing the
|
||||
*/
|
||||
public static void mergeFrom(Message.Builder builder, ByteString bs) throws IOException {
|
||||
final CodedInputStream codedInput = bs.newCodedInput();
|
||||
|
@ -2628,7 +2630,7 @@ public final class ProtobufUtil {
|
|||
* This version of protobuf's mergeFrom avoids the hard-coded 64MB limit for decoding buffers when
|
||||
* working with byte arrays
|
||||
* @param builder current message builder
|
||||
* @param b byte array n
|
||||
* @param b byte array
|
||||
*/
|
||||
public static void mergeFrom(Message.Builder builder, byte[] b) throws IOException {
|
||||
final CodedInputStream codedInput = CodedInputStream.newInstance(b);
|
||||
|
@ -2641,7 +2643,7 @@ public final class ProtobufUtil {
|
|||
* This version of protobuf's mergeFrom avoids the hard-coded 64MB limit for decoding buffers when
|
||||
* working with byte arrays
|
||||
* @param builder current message builder
|
||||
* @param b byte array nnn
|
||||
* @param b byte array
|
||||
*/
|
||||
public static void mergeFrom(Message.Builder builder, byte[] b, int offset, int length)
|
||||
throws IOException {
|
||||
|
@ -2821,7 +2823,7 @@ public final class ProtobufUtil {
|
|||
|
||||
/**
|
||||
* Creates {@link CompactionState} from {@link GetRegionInfoResponse.CompactionState} state
|
||||
* @param state the protobuf CompactionState n
|
||||
* @param state the protobuf CompactionState
|
||||
*/
|
||||
public static CompactionState createCompactionState(GetRegionInfoResponse.CompactionState state) {
|
||||
return CompactionState.valueOf(state.toString());
|
||||
|
@ -2833,7 +2835,7 @@ public final class ProtobufUtil {
|
|||
|
||||
/**
|
||||
* Creates {@link CompactionState} from {@link RegionLoad.CompactionState} state
|
||||
* @param state the protobuf CompactionState n
|
||||
* @param state the protobuf CompactionState
|
||||
*/
|
||||
public static CompactionState
|
||||
createCompactionStateForRegionLoad(RegionLoad.CompactionState state) {
|
||||
|
@ -2938,9 +2940,7 @@ public final class ProtobufUtil {
|
|||
stats.getCompactionPressure());
|
||||
}
|
||||
|
||||
/**
|
||||
* n * @return A String version of the passed in <code>msg</code>
|
||||
*/
|
||||
/** Returns A String version of the passed in <code>msg</code> */
|
||||
public static String toText(Message msg) {
|
||||
return TextFormat.shortDebugString(msg);
|
||||
}
|
||||
|
@ -2950,7 +2950,7 @@ public final class ProtobufUtil {
|
|||
}
|
||||
|
||||
/**
|
||||
* Contain ServiceException inside here. Take a callable that is doing our pb rpc and run it. n
|
||||
* Contain ServiceException inside here. Take a callable that is doing our pb rpc and run it.
|
||||
*/
|
||||
public static <T> T call(Callable<T> callable) throws IOException {
|
||||
try {
|
||||
|
@ -3061,7 +3061,7 @@ public final class ProtobufUtil {
|
|||
* magic and that is then followed by a protobuf that has a serialized
|
||||
* {@link ServerName} in it.
|
||||
* @return Returns null if <code>data</code> is null else converts passed data to a ServerName
|
||||
* instance. n
|
||||
* instance.
|
||||
*/
|
||||
public static ServerName parseServerNameFrom(final byte[] data) throws DeserializationException {
|
||||
if (data == null || data.length <= 0) return null;
|
||||
|
|
|
@ -195,7 +195,7 @@ public final class RequestConverter {
|
|||
|
||||
/**
|
||||
* Create a protocol buffer MutateRequest for a conditioned put/delete/increment/append
|
||||
* @return a mutate request n
|
||||
* @return a mutate request
|
||||
*/
|
||||
public static MutateRequest buildMutateRequest(final byte[] regionName, final byte[] row,
|
||||
final byte[] family, final byte[] qualifier, final CompareOperator op, final byte[] value,
|
||||
|
@ -215,7 +215,7 @@ public final class RequestConverter {
|
|||
|
||||
/**
|
||||
* Create a protocol buffer MultiRequest for conditioned row mutations
|
||||
* @return a multi request n
|
||||
* @return a multi request
|
||||
*/
|
||||
public static ClientProtos.MultiRequest buildMultiRequest(final byte[] regionName,
|
||||
final byte[] row, final byte[] family, final byte[] qualifier, final CompareOperator op,
|
||||
|
@ -272,7 +272,8 @@ public final class RequestConverter {
|
|||
}
|
||||
|
||||
/**
|
||||
* Create a protocol buffer MutateRequest for a put nn * @return a mutate request n
|
||||
* Create a protocol buffer MutateRequest for a put
|
||||
* @return a mutate request
|
||||
*/
|
||||
public static MutateRequest buildMutateRequest(final byte[] regionName, final Put put)
|
||||
throws IOException {
|
||||
|
@ -284,7 +285,8 @@ public final class RequestConverter {
|
|||
}
|
||||
|
||||
/**
|
||||
* Create a protocol buffer MutateRequest for an append nn * @return a mutate request n
|
||||
* Create a protocol buffer MutateRequest for an append
|
||||
* @return a mutate request
|
||||
*/
|
||||
public static MutateRequest buildMutateRequest(final byte[] regionName, final Append append,
|
||||
long nonceGroup, long nonce) throws IOException {
|
||||
|
@ -300,7 +302,8 @@ public final class RequestConverter {
|
|||
}
|
||||
|
||||
/**
|
||||
* Create a protocol buffer MutateRequest for a client increment nn * @return a mutate request
|
||||
* Create a protocol buffer MutateRequest for a client increment
|
||||
* @return a mutate request
|
||||
*/
|
||||
public static MutateRequest buildMutateRequest(final byte[] regionName, final Increment increment,
|
||||
final long nonceGroup, final long nonce) throws IOException {
|
||||
|
@ -316,7 +319,8 @@ public final class RequestConverter {
|
|||
}
|
||||
|
||||
/**
|
||||
* Create a protocol buffer MutateRequest for a delete nn * @return a mutate request n
|
||||
* Create a protocol buffer MutateRequest for a delete
|
||||
* @return a mutate request
|
||||
*/
|
||||
public static MutateRequest buildMutateRequest(final byte[] regionName, final Delete delete)
|
||||
throws IOException {
|
||||
|
@ -336,7 +340,8 @@ public final class RequestConverter {
|
|||
}
|
||||
|
||||
/**
|
||||
* Create a protocol buffer ScanRequest for a client Scan nnnn * @return a scan request n
|
||||
* Create a protocol buffer ScanRequest for a client Scan
|
||||
* @return a scan request
|
||||
*/
|
||||
public static ScanRequest buildScanRequest(byte[] regionName, Scan scan, int numberOfRows,
|
||||
boolean closeScanner) throws IOException {
|
||||
|
@ -356,7 +361,8 @@ public final class RequestConverter {
|
|||
}
|
||||
|
||||
/**
|
||||
* Create a protocol buffer ScanRequest for a scanner id nnn * @return a scan request
|
||||
* Create a protocol buffer ScanRequest for a scanner id
|
||||
* @return a scan request
|
||||
*/
|
||||
public static ScanRequest buildScanRequest(long scannerId, int numberOfRows, boolean closeScanner,
|
||||
boolean trackMetrics) {
|
||||
|
@ -371,7 +377,8 @@ public final class RequestConverter {
|
|||
}
|
||||
|
||||
/**
|
||||
* Create a protocol buffer ScanRequest for a scanner id nnnn * @return a scan request
|
||||
* Create a protocol buffer ScanRequest for a scanner id
|
||||
* @return a scan request
|
||||
*/
|
||||
public static ScanRequest buildScanRequest(long scannerId, int numberOfRows, boolean closeScanner,
|
||||
long nextCallSeq, boolean trackMetrics, boolean renew, int limitOfRows) {
|
||||
|
@ -391,7 +398,8 @@ public final class RequestConverter {
|
|||
}
|
||||
|
||||
/**
|
||||
* Create a protocol buffer bulk load request nnnnnn * @return a bulk load request
|
||||
* Create a protocol buffer bulk load request
|
||||
* @return a bulk load request
|
||||
*/
|
||||
public static BulkLoadHFileRequest buildBulkLoadHFileRequest(
|
||||
final List<Pair<byte[], String>> familyPaths, final byte[] regionName, boolean assignSeqNum,
|
||||
|
@ -457,7 +465,7 @@ public final class RequestConverter {
|
|||
* @param mutationBuilder mutationBuilder to be used to build mutation.
|
||||
* @param nonceGroup nonceGroup to be applied.
|
||||
* @param indexMap Map of created RegionAction to the original index for a
|
||||
* RowMutations/CheckAndMutate within the original list of actions n
|
||||
* RowMutations/CheckAndMutate within the original list of actions
|
||||
*/
|
||||
public static void buildNoDataRegionActions(final byte[] regionName,
|
||||
final Iterable<Action> actions, final List<CellScannable> cells,
|
||||
|
@ -825,7 +833,8 @@ public final class RequestConverter {
|
|||
/**
|
||||
* Create a CompactRegionRequest for a given region name
|
||||
* @param regionName the name of the region to get info
|
||||
* @param major indicator if it is a major compaction n * @return a CompactRegionRequest
|
||||
* @param major indicator if it is a major compaction
|
||||
* @return a CompactRegionRequest
|
||||
*/
|
||||
public static CompactRegionRequest buildCompactRegionRequest(byte[] regionName, boolean major,
|
||||
byte[] columnFamily) {
|
||||
|
@ -883,7 +892,8 @@ public final class RequestConverter {
|
|||
}
|
||||
|
||||
/**
|
||||
* Create a protocol buffer AddColumnRequest nn * @return an AddColumnRequest
|
||||
* Create a protocol buffer AddColumnRequest
|
||||
* @return an AddColumnRequest
|
||||
*/
|
||||
public static AddColumnRequest buildAddColumnRequest(final TableName tableName,
|
||||
final ColumnFamilyDescriptor column, final long nonceGroup, final long nonce) {
|
||||
|
@ -896,7 +906,8 @@ public final class RequestConverter {
|
|||
}
|
||||
|
||||
/**
|
||||
* Create a protocol buffer DeleteColumnRequest nn * @return a DeleteColumnRequest
|
||||
* Create a protocol buffer DeleteColumnRequest
|
||||
* @return a DeleteColumnRequest
|
||||
*/
|
||||
public static DeleteColumnRequest buildDeleteColumnRequest(final TableName tableName,
|
||||
final byte[] columnName, final long nonceGroup, final long nonce) {
|
||||
|
@ -909,7 +920,8 @@ public final class RequestConverter {
|
|||
}
|
||||
|
||||
/**
|
||||
* Create a protocol buffer ModifyColumnRequest nn * @return an ModifyColumnRequest
|
||||
* Create a protocol buffer ModifyColumnRequest
|
||||
* @return an ModifyColumnRequest
|
||||
*/
|
||||
public static ModifyColumnRequest buildModifyColumnRequest(final TableName tableName,
|
||||
final ColumnFamilyDescriptor column, final long nonceGroup, final long nonce) {
|
||||
|
@ -935,7 +947,8 @@ public final class RequestConverter {
|
|||
}
|
||||
|
||||
/**
|
||||
* Create a protocol buffer MoveRegionRequest nn * @return A MoveRegionRequest
|
||||
* Create a protocol buffer MoveRegionRequest
|
||||
* @return A MoveRegionRequest
|
||||
*/
|
||||
public static MoveRegionRequest buildMoveRegionRequest(byte[] encodedRegionName,
|
||||
ServerName destServerName) {
|
||||
|
@ -976,7 +989,8 @@ public final class RequestConverter {
|
|||
}
|
||||
|
||||
/**
|
||||
* Create a protocol buffer AssignRegionRequest n * @return an AssignRegionRequest
|
||||
* Create a protocol buffer AssignRegionRequest
|
||||
* @return an AssignRegionRequest
|
||||
*/
|
||||
public static AssignRegionRequest buildAssignRegionRequest(final byte[] regionName) {
|
||||
AssignRegionRequest.Builder builder = AssignRegionRequest.newBuilder();
|
||||
|
@ -985,7 +999,8 @@ public final class RequestConverter {
|
|||
}
|
||||
|
||||
/**
|
||||
* Creates a protocol buffer UnassignRegionRequest n * @return an UnassignRegionRequest
|
||||
* Creates a protocol buffer UnassignRegionRequest
|
||||
* @return an UnassignRegionRequest
|
||||
*/
|
||||
public static UnassignRegionRequest buildUnassignRegionRequest(final byte[] regionName) {
|
||||
UnassignRegionRequest.Builder builder = UnassignRegionRequest.newBuilder();
|
||||
|
@ -994,7 +1009,8 @@ public final class RequestConverter {
|
|||
}
|
||||
|
||||
/**
|
||||
* Creates a protocol buffer OfflineRegionRequest n * @return an OfflineRegionRequest
|
||||
* Creates a protocol buffer OfflineRegionRequest
|
||||
* @return an OfflineRegionRequest
|
||||
*/
|
||||
public static OfflineRegionRequest buildOfflineRegionRequest(final byte[] regionName) {
|
||||
OfflineRegionRequest.Builder builder = OfflineRegionRequest.newBuilder();
|
||||
|
@ -1003,7 +1019,8 @@ public final class RequestConverter {
|
|||
}
|
||||
|
||||
/**
|
||||
* Creates a protocol buffer DeleteTableRequest n * @return a DeleteTableRequest
|
||||
* Creates a protocol buffer DeleteTableRequest
|
||||
* @return a DeleteTableRequest
|
||||
*/
|
||||
public static DeleteTableRequest buildDeleteTableRequest(final TableName tableName,
|
||||
final long nonceGroup, final long nonce) {
|
||||
|
@ -1031,7 +1048,8 @@ public final class RequestConverter {
|
|||
}
|
||||
|
||||
/**
|
||||
* Creates a protocol buffer EnableTableRequest n * @return an EnableTableRequest
|
||||
* Creates a protocol buffer EnableTableRequest
|
||||
* @return an EnableTableRequest
|
||||
*/
|
||||
public static EnableTableRequest buildEnableTableRequest(final TableName tableName,
|
||||
final long nonceGroup, final long nonce) {
|
||||
|
@ -1043,7 +1061,8 @@ public final class RequestConverter {
|
|||
}
|
||||
|
||||
/**
|
||||
* Creates a protocol buffer DisableTableRequest n * @return a DisableTableRequest
|
||||
* Creates a protocol buffer DisableTableRequest
|
||||
* @return a DisableTableRequest
|
||||
*/
|
||||
public static DisableTableRequest buildDisableTableRequest(final TableName tableName,
|
||||
final long nonceGroup, final long nonce) {
|
||||
|
@ -1055,7 +1074,8 @@ public final class RequestConverter {
|
|||
}
|
||||
|
||||
/**
|
||||
* Creates a protocol buffer CreateTableRequest nn * @return a CreateTableRequest
|
||||
* Creates a protocol buffer CreateTableRequest
|
||||
* @return a CreateTableRequest
|
||||
*/
|
||||
public static CreateTableRequest buildCreateTableRequest(final TableDescriptor tableDescriptor,
|
||||
final byte[][] splitKeys, final long nonceGroup, final long nonce) {
|
||||
|
@ -1072,7 +1092,8 @@ public final class RequestConverter {
|
|||
}
|
||||
|
||||
/**
|
||||
* Creates a protocol buffer ModifyTableRequest nn * @return a ModifyTableRequest
|
||||
* Creates a protocol buffer ModifyTableRequest
|
||||
* @return a ModifyTableRequest
|
||||
*/
|
||||
public static ModifyTableRequest buildModifyTableRequest(final TableName tableName,
|
||||
final TableDescriptor tableDesc, final long nonceGroup, final long nonce) {
|
||||
|
@ -1096,7 +1117,8 @@ public final class RequestConverter {
|
|||
}
|
||||
|
||||
/**
|
||||
* Creates a protocol buffer GetTableDescriptorsRequest n * @return a GetTableDescriptorsRequest
|
||||
* Creates a protocol buffer GetTableDescriptorsRequest
|
||||
* @return a GetTableDescriptorsRequest
|
||||
*/
|
||||
public static GetTableDescriptorsRequest
|
||||
buildGetTableDescriptorsRequest(final List<TableName> tableNames) {
|
||||
|
@ -1193,7 +1215,8 @@ public final class RequestConverter {
|
|||
}
|
||||
|
||||
/**
|
||||
* Creates a protocol buffer SetBalancerRunningRequest nn * @return a SetBalancerRunningRequest
|
||||
* Creates a protocol buffer SetBalancerRunningRequest
|
||||
* @return a SetBalancerRunningRequest
|
||||
*/
|
||||
public static SetBalancerRunningRequest buildSetBalancerRunningRequest(boolean on,
|
||||
boolean synchronous) {
|
||||
|
@ -1278,8 +1301,8 @@ public final class RequestConverter {
|
|||
}
|
||||
|
||||
/**
|
||||
* Creates a request for querying the master the last flushed sequence Id for a region n * @return
|
||||
* A {@link GetLastFlushedSequenceIdRequest}
|
||||
* Creates a request for querying the master the last flushed sequence Id for a region
|
||||
* @return A {@link GetLastFlushedSequenceIdRequest}
|
||||
*/
|
||||
public static GetLastFlushedSequenceIdRequest
|
||||
buildGetLastFlushedSequenceIdRequest(byte[] regionName) {
|
||||
|
@ -1330,7 +1353,8 @@ public final class RequestConverter {
|
|||
}
|
||||
|
||||
/**
|
||||
* Creates a protocol buffer SetNormalizerRunningRequest n * @return a SetNormalizerRunningRequest
|
||||
* Creates a protocol buffer SetNormalizerRunningRequest
|
||||
* @return a SetNormalizerRunningRequest
|
||||
*/
|
||||
public static SetNormalizerRunningRequest buildSetNormalizerRunningRequest(boolean on) {
|
||||
return SetNormalizerRunningRequest.newBuilder().setOn(on).build();
|
||||
|
@ -1438,7 +1462,8 @@ public final class RequestConverter {
|
|||
}
|
||||
|
||||
/**
|
||||
* Creates a protocol buffer CreateNamespaceRequest n * @return a CreateNamespaceRequest
|
||||
* Creates a protocol buffer CreateNamespaceRequest
|
||||
* @return a CreateNamespaceRequest
|
||||
*/
|
||||
public static CreateNamespaceRequest
|
||||
buildCreateNamespaceRequest(final NamespaceDescriptor descriptor) {
|
||||
|
@ -1448,7 +1473,8 @@ public final class RequestConverter {
|
|||
}
|
||||
|
||||
/**
|
||||
* Creates a protocol buffer ModifyNamespaceRequest n * @return a ModifyNamespaceRequest
|
||||
* Creates a protocol buffer ModifyNamespaceRequest
|
||||
* @return a ModifyNamespaceRequest
|
||||
*/
|
||||
public static ModifyNamespaceRequest
|
||||
buildModifyNamespaceRequest(final NamespaceDescriptor descriptor) {
|
||||
|
@ -1458,7 +1484,8 @@ public final class RequestConverter {
|
|||
}
|
||||
|
||||
/**
|
||||
* Creates a protocol buffer DeleteNamespaceRequest n * @return a DeleteNamespaceRequest
|
||||
* Creates a protocol buffer DeleteNamespaceRequest
|
||||
* @return a DeleteNamespaceRequest
|
||||
*/
|
||||
public static DeleteNamespaceRequest buildDeleteNamespaceRequest(final String name) {
|
||||
DeleteNamespaceRequest.Builder builder = DeleteNamespaceRequest.newBuilder();
|
||||
|
@ -1467,8 +1494,8 @@ public final class RequestConverter {
|
|||
}
|
||||
|
||||
/**
|
||||
* Creates a protocol buffer GetNamespaceDescriptorRequest n * @return a
|
||||
* GetNamespaceDescriptorRequest
|
||||
* Creates a protocol buffer GetNamespaceDescriptorRequest
|
||||
* @return a GetNamespaceDescriptorRequest
|
||||
*/
|
||||
public static GetNamespaceDescriptorRequest
|
||||
buildGetNamespaceDescriptorRequest(final String name) {
|
||||
|
@ -1592,7 +1619,7 @@ public final class RequestConverter {
|
|||
|
||||
/**
|
||||
* Creates IsSnapshotCleanupEnabledRequest to determine if auto snapshot cleanup based on TTL
|
||||
* expiration is turned on n
|
||||
* expiration is turned on
|
||||
*/
|
||||
public static IsSnapshotCleanupEnabledRequest buildIsSnapshotCleanupEnabledRequest() {
|
||||
return IsSnapshotCleanupEnabledRequest.newBuilder().build();
|
||||
|
|
|
@ -90,7 +90,7 @@ public final class ResponseConverter {
|
|||
* @param request the original protocol buffer MultiRequest
|
||||
* @param response the protocol buffer MultiResponse to convert
|
||||
* @param cells Cells to go with the passed in <code>proto</code>. Can be null.
|
||||
* @return the results that were in the MultiResponse (a Result or an Exception). n
|
||||
* @return the results that were in the MultiResponse (a Result or an Exception).
|
||||
*/
|
||||
public static org.apache.hadoop.hbase.client.MultiResponse getResults(final MultiRequest request,
|
||||
final MultiResponse response, final CellScanner cells) throws IOException {
|
||||
|
@ -103,7 +103,7 @@ public final class ResponseConverter {
|
|||
* @param indexMap Used to support RowMutations/CheckAndMutate in batch
|
||||
* @param response the protocol buffer MultiResponse to convert
|
||||
* @param cells Cells to go with the passed in <code>proto</code>. Can be null.
|
||||
* @return the results that were in the MultiResponse (a Result or an Exception). n
|
||||
* @return the results that were in the MultiResponse (a Result or an Exception).
|
||||
*/
|
||||
public static org.apache.hadoop.hbase.client.MultiResponse getResults(final MultiRequest request,
|
||||
final Map<Integer, Integer> indexMap, final MultiResponse response, final CellScanner cells)
|
||||
|
@ -247,7 +247,8 @@ public final class ResponseConverter {
|
|||
}
|
||||
|
||||
/**
|
||||
* Wrap a throwable to an action result. n * @return an action result builder
|
||||
* Wrap a throwable to an action result.
|
||||
* @return an action result builder
|
||||
*/
|
||||
public static ResultOrException.Builder buildActionResult(final Throwable t) {
|
||||
ResultOrException.Builder builder = ResultOrException.newBuilder();
|
||||
|
@ -256,7 +257,8 @@ public final class ResponseConverter {
|
|||
}
|
||||
|
||||
/**
|
||||
* Wrap a throwable to an action result. n * @return an action result builder
|
||||
* Wrap a throwable to an action result.
|
||||
* @return an action result builder
|
||||
*/
|
||||
public static ResultOrException.Builder buildActionResult(final ClientProtos.Result r) {
|
||||
ResultOrException.Builder builder = ResultOrException.newBuilder();
|
||||
|
@ -264,9 +266,7 @@ public final class ResponseConverter {
|
|||
return builder;
|
||||
}
|
||||
|
||||
/**
|
||||
* n * @return NameValuePair of the exception name to stringified version os exception.
|
||||
*/
|
||||
/** Returns NameValuePair of the exception name to stringified version os exception. */
|
||||
public static NameBytesPair buildException(final Throwable t) {
|
||||
NameBytesPair.Builder parameterBuilder = NameBytesPair.newBuilder();
|
||||
parameterBuilder.setName(t.getClass().getName());
|
||||
|
@ -307,7 +307,8 @@ public final class ResponseConverter {
|
|||
}
|
||||
|
||||
/**
|
||||
* A utility to build a GetServerInfoResponse. nn * @return the response
|
||||
* A utility to build a GetServerInfoResponse.
|
||||
* @return the response
|
||||
*/
|
||||
public static GetServerInfoResponse buildGetServerInfoResponse(final ServerName serverName,
|
||||
final int webuiPort) {
|
||||
|
@ -322,7 +323,8 @@ public final class ResponseConverter {
|
|||
}
|
||||
|
||||
/**
|
||||
* A utility to build a GetOnlineRegionResponse. n * @return the response
|
||||
* A utility to build a GetOnlineRegionResponse.
|
||||
* @return the response
|
||||
*/
|
||||
public static GetOnlineRegionResponse
|
||||
buildGetOnlineRegionResponse(final List<RegionInfo> regions) {
|
||||
|
@ -405,7 +407,7 @@ public final class ResponseConverter {
|
|||
}
|
||||
|
||||
/**
|
||||
* Create Results from the cells using the cells meta data. nnn
|
||||
* Create Results from the cells using the cells meta data.
|
||||
*/
|
||||
public static Result[] getResults(CellScanner cellScanner, ScanResponse response)
|
||||
throws IOException {
|
||||
|
|
|
@ -91,7 +91,7 @@ public class Writables {
|
|||
* @return The passed Writable after its readFields has been called fed by the passed
|
||||
* <code>bytes</code> array or IllegalArgumentException if passed null or an empty
|
||||
* <code>bytes</code> array.
|
||||
* @throws IOException e n
|
||||
* @throws IOException e
|
||||
*/
|
||||
public static Writable getWritable(final byte[] bytes, final Writable w) throws IOException {
|
||||
return getWritable(bytes, 0, bytes.length, w);
|
||||
|
@ -107,7 +107,7 @@ public class Writables {
|
|||
* @return The passed Writable after its readFields has been called fed by the passed
|
||||
* <code>bytes</code> array or IllegalArgumentException if passed null or an empty
|
||||
* <code>bytes</code> array.
|
||||
* @throws IOException e n
|
||||
* @throws IOException e
|
||||
*/
|
||||
public static Writable getWritable(final byte[] bytes, final int offset, final int length,
|
||||
final Writable w) throws IOException {
|
||||
|
|
|
@ -144,7 +144,7 @@ public class ZNodePaths {
|
|||
|
||||
/**
|
||||
* Parses the meta replicaId from the passed path.
|
||||
* @param path the name of the full path which includes baseZNode. n
|
||||
* @param path the name of the full path which includes baseZNode.
|
||||
*/
|
||||
public int getMetaReplicaIdFromPath(String path) {
|
||||
// Extract the znode from path. The prefix is of the following format.
|
||||
|
@ -155,7 +155,7 @@ public class ZNodePaths {
|
|||
|
||||
/**
|
||||
* Parse the meta replicaId from the passed znode
|
||||
* @param znode the name of the znode, does not include baseZNode n
|
||||
* @param znode the name of the znode, does not include baseZNode
|
||||
*/
|
||||
public int getMetaReplicaIdFromZNode(String znode) {
|
||||
return znode.equals(metaZNodePrefix)
|
||||
|
|
|
@ -42,7 +42,7 @@ public class TestDeleteTimeStamp {
|
|||
private static final byte[] QUALIFIER = Bytes.toBytes("testQualifier");
|
||||
|
||||
/*
|
||||
* Test for verifying that the timestamp in delete object is being honored. n
|
||||
* Test for verifying that the timestamp in delete object is being honored.
|
||||
*/
|
||||
@Test
|
||||
public void testTimeStamp() {
|
||||
|
|
|
@ -100,7 +100,8 @@ public final class AuthUtil {
|
|||
/**
|
||||
* For kerberized cluster, return login user (from kinit or from keytab if specified). For
|
||||
* non-kerberized cluster, return system user.
|
||||
* @param conf configuartion file n * @throws IOException login exception
|
||||
* @param conf configuartion file
|
||||
* @throws IOException login exception
|
||||
*/
|
||||
@InterfaceAudience.Private
|
||||
public static User loginClient(Configuration conf) throws IOException {
|
||||
|
@ -160,7 +161,8 @@ public final class AuthUtil {
|
|||
* <p>
|
||||
* NOT recommend to use to method unless you're sure what you're doing, it is for canary only.
|
||||
* Please use User#loginClient.
|
||||
* @param conf configuration file n * @throws IOException login exception
|
||||
* @param conf configuration file
|
||||
* @throws IOException login exception
|
||||
*/
|
||||
private static User loginClientAsService(Configuration conf) throws IOException {
|
||||
UserProvider provider = UserProvider.instantiate(conf);
|
||||
|
|
|
@ -54,7 +54,7 @@ public class ByteBufferKeyOnlyKeyValue extends ByteBufferExtendedCell {
|
|||
|
||||
/**
|
||||
* A setter that helps to avoid object creation every time and whenever there is a need to create
|
||||
* new OffheapKeyOnlyKeyValue. nnn
|
||||
* new OffheapKeyOnlyKeyValue.
|
||||
*/
|
||||
public void setKey(ByteBuffer key, int offset, int length) {
|
||||
setKey(key, offset, length, ByteBufferUtils.toShort(key, offset));
|
||||
|
|
|
@ -48,7 +48,7 @@ public interface CellBuilder {
|
|||
Cell build();
|
||||
|
||||
/**
|
||||
* Remove all internal elements from builder. n
|
||||
* Remove all internal elements from builder.
|
||||
*/
|
||||
CellBuilder clear();
|
||||
}
|
||||
|
|
|
@ -661,9 +661,8 @@ public class CellComparatorImpl implements CellComparator {
|
|||
/**
|
||||
* Compares the row part of the cell with a simple plain byte[] like the stopRow in Scan. This
|
||||
* should be used with context where for hbase:meta cells the
|
||||
* {{@link MetaCellComparator#META_COMPARATOR} should be used n * the cell to be compared n * the
|
||||
* kv serialized byte[] to be compared with n * the offset in the byte[] n * the length in the
|
||||
* byte[]
|
||||
* {{@link MetaCellComparator#META_COMPARATOR} should be used the cell to be compared the kv
|
||||
* serialized byte[] to be compared with the offset in the byte[] the length in the byte[]
|
||||
* @return 0 if both cell and the byte[] are equal, 1 if the cell is bigger than byte[], -1
|
||||
* otherwise
|
||||
*/
|
||||
|
|
|
@ -77,7 +77,8 @@ public final class CellUtil {
|
|||
/**
|
||||
* Makes a column in family:qualifier form from separate byte arrays.
|
||||
* <p>
|
||||
* Not recommended for usage as this is old-style API. nn * @return family:qualifier
|
||||
* Not recommended for usage as this is old-style API.
|
||||
* @return family:qualifier
|
||||
*/
|
||||
public static byte[] makeColumn(byte[] family, byte[] qualifier) {
|
||||
return Bytes.add(family, COLUMN_FAMILY_DELIM_ARRAY, qualifier);
|
||||
|
@ -292,9 +293,7 @@ public final class CellUtil {
|
|||
return destinationOffset + vlen;
|
||||
}
|
||||
|
||||
/**
|
||||
* n * @return CellScanner interface over <code>cellIterables</code>
|
||||
*/
|
||||
/** Returns CellScanner interface over <code>cellIterables</code> */
|
||||
public static CellScanner
|
||||
createCellScanner(final List<? extends CellScannable> cellScannerables) {
|
||||
return new CellScanner() {
|
||||
|
@ -320,17 +319,15 @@ public final class CellUtil {
|
|||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* n * @return CellScanner interface over <code>cellIterable</code>
|
||||
*/
|
||||
/** Returns CellScanner interface over <code>cellIterable</code> */
|
||||
public static CellScanner createCellScanner(final Iterable<Cell> cellIterable) {
|
||||
if (cellIterable == null) return null;
|
||||
return createCellScanner(cellIterable.iterator());
|
||||
}
|
||||
|
||||
/**
|
||||
* n * @return CellScanner interface over <code>cellIterable</code> or null if <code>cells</code>
|
||||
* is null
|
||||
* Returns CellScanner interface over <code>cellIterable</code> or null if <code>cells</code> is
|
||||
* null
|
||||
*/
|
||||
public static CellScanner createCellScanner(final Iterator<Cell> cells) {
|
||||
if (cells == null) return null;
|
||||
|
@ -352,9 +349,7 @@ public final class CellUtil {
|
|||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* n * @return CellScanner interface over <code>cellArray</code>
|
||||
*/
|
||||
/** Returns CellScanner interface over <code>cellArray</code> */
|
||||
public static CellScanner createCellScanner(final Cell[] cellArray) {
|
||||
return new CellScanner() {
|
||||
private final Cell[] cells = cellArray;
|
||||
|
|
|
@ -145,7 +145,7 @@ public class CompoundConfiguration extends Configuration {
|
|||
/**
|
||||
* Add Bytes map to config list. This map is generally created by HTableDescriptor or
|
||||
* HColumnDescriptor, but can be abstractly used. The added configuration overrides the previous
|
||||
* ones if there are name collisions. n * Bytes map
|
||||
* ones if there are name collisions. Bytes map
|
||||
* @return this, for builder pattern
|
||||
*/
|
||||
public CompoundConfiguration addBytesMap(final Map<Bytes, Bytes> map) {
|
||||
|
|
|
@ -41,7 +41,7 @@ public interface ExtendedCell extends RawCell, HeapSize {
|
|||
* <tags></code>
|
||||
* @param out Stream to which cell has to be written
|
||||
* @param withTags Whether to write tags.
|
||||
* @return how many bytes are written. n
|
||||
* @return how many bytes are written.
|
||||
*/
|
||||
// TODO remove the boolean param once HBASE-16706 is done.
|
||||
default int write(OutputStream out, boolean withTags) throws IOException {
|
||||
|
|
|
@ -182,7 +182,7 @@ public class HBaseConfiguration extends Configuration {
|
|||
* @param conf configuration instance for accessing the passwords
|
||||
* @param alias the name of the password element
|
||||
* @param defPass the default password
|
||||
* @return String password or default password n
|
||||
* @return String password or default password
|
||||
*/
|
||||
public static String getPassword(Configuration conf, String alias, String defPass)
|
||||
throws IOException {
|
||||
|
|
|
@ -1840,8 +1840,8 @@ public class KeyValue implements ExtendedCell, Cloneable {
|
|||
* Compare columnFamily, qualifier, timestamp, and key type (everything except the row). This
|
||||
* method is used both in the normal comparator and the "same-prefix" comparator. Note that we
|
||||
* are assuming that row portions of both KVs have already been parsed and found identical, and
|
||||
* we don't validate that assumption here. n * the length of the common prefix of the two
|
||||
* key-values being compared, including row length and row
|
||||
* we don't validate that assumption here. the length of the common prefix of the two key-values
|
||||
* being compared, including row length and row
|
||||
*/
|
||||
private int compareWithoutRow(int commonPrefix, byte[] left, int loffset, int llength,
|
||||
byte[] right, int roffset, int rlength, short rowlength) {
|
||||
|
|
|
@ -55,8 +55,8 @@ public class KeyValueTestUtil {
|
|||
|
||||
/**
|
||||
* Checks whether KeyValues from kvCollection2 are contained in kvCollection1. The comparison is
|
||||
* made without distinguishing MVCC version of the KeyValues nn * @return true if KeyValues from
|
||||
* kvCollection2 are contained in kvCollection1
|
||||
* made without distinguishing MVCC version of the KeyValues
|
||||
* @return true if KeyValues from kvCollection2 are contained in kvCollection1
|
||||
*/
|
||||
public static boolean containsIgnoreMvccVersion(Collection<? extends Cell> kvCollection1,
|
||||
Collection<? extends Cell> kvCollection2) {
|
||||
|
|
|
@ -58,8 +58,8 @@ public class KeyValueUtil {
|
|||
|
||||
/**
|
||||
* Returns number of bytes this cell's key part would have been used if serialized as in
|
||||
* {@link KeyValue}. Key includes rowkey, family, qualifier, timestamp and type. n * @return the
|
||||
* key length
|
||||
* {@link KeyValue}. Key includes rowkey, family, qualifier, timestamp and type.
|
||||
* @return the key length
|
||||
*/
|
||||
public static int keyLength(final Cell cell) {
|
||||
return keyLength(cell.getRowLength(), cell.getFamilyLength(), cell.getQualifierLength());
|
||||
|
@ -96,8 +96,8 @@ public class KeyValueUtil {
|
|||
}
|
||||
|
||||
/**
|
||||
* The position will be set to the beginning of the new ByteBuffer n * @return the Bytebuffer
|
||||
* containing the key part of the cell
|
||||
* The position will be set to the beginning of the new ByteBuffer
|
||||
* @return the Bytebuffer containing the key part of the cell
|
||||
*/
|
||||
public static ByteBuffer copyKeyToNewByteBuffer(final Cell cell) {
|
||||
byte[] bytes = new byte[keyLength(cell)];
|
||||
|
@ -107,8 +107,8 @@ public class KeyValueUtil {
|
|||
}
|
||||
|
||||
/**
|
||||
* Copies the key to a new KeyValue n * @return the KeyValue that consists only the key part of
|
||||
* the incoming cell
|
||||
* Copies the key to a new KeyValue
|
||||
* @return the KeyValue that consists only the key part of the incoming cell
|
||||
*/
|
||||
public static KeyValue toNewKeyCell(final Cell cell) {
|
||||
byte[] bytes = new byte[keyLength(cell)];
|
||||
|
@ -203,7 +203,7 @@ public class KeyValueUtil {
|
|||
|
||||
/**
|
||||
* Creates a new KeyValue object positioned in the supplied ByteBuffer and sets the ByteBuffer's
|
||||
* position to the start of the next KeyValue. Does not allocate a new array or copy data. nnn
|
||||
* position to the start of the next KeyValue. Does not allocate a new array or copy data.
|
||||
*/
|
||||
public static KeyValue nextShallowCopy(final ByteBuffer bb, final boolean includesMvccVersion,
|
||||
boolean includesTags) {
|
||||
|
@ -236,7 +236,8 @@ public class KeyValueUtil {
|
|||
|
||||
/**
|
||||
* Decrement the timestamp. For tests (currently wasteful) Remember timestamps are sorted reverse
|
||||
* chronologically. n * @return previous key
|
||||
* chronologically.
|
||||
* @return previous key
|
||||
*/
|
||||
public static KeyValue previousKey(final KeyValue in) {
|
||||
return createFirstOnRow(CellUtil.cloneRow(in), CellUtil.cloneFamily(in),
|
||||
|
@ -246,9 +247,8 @@ public class KeyValueUtil {
|
|||
/**
|
||||
* Create a KeyValue for the specified row, family and qualifier that would be larger than or
|
||||
* equal to all other possible KeyValues that have the same row, family, qualifier. Used for
|
||||
* reseeking. Should NEVER be returned to a client. n * row key n * row offset n * row length n *
|
||||
* family name n * family offset n * family length n * column qualifier n * qualifier offset n *
|
||||
* qualifier length
|
||||
* reseeking. Should NEVER be returned to a client. row key row offset row length family name
|
||||
* family offset family length column qualifier qualifier offset qualifier length
|
||||
* @return Last possible key on passed row, family, qualifier.
|
||||
*/
|
||||
public static KeyValue createLastOnRow(final byte[] row, final int roffset, final int rlength,
|
||||
|
@ -408,11 +408,11 @@ public class KeyValueUtil {
|
|||
|
||||
/*************** misc **********************************/
|
||||
/**
|
||||
* n * @return <code>cell</code> if it is an object of class {@link KeyValue} else we will return
|
||||
* a new {@link KeyValue} instance made from <code>cell</code> Note: Even if the cell is an object
|
||||
* of any of the subclass of {@link KeyValue}, we will create a new {@link KeyValue} object
|
||||
* wrapping same buffer. This API is used only with MR based tools which expect the type to be
|
||||
* exactly KeyValue. That is the reason for doing this way.
|
||||
* @return <code>cell</code> if it is an object of class {@link KeyValue} else we will return a
|
||||
* new {@link KeyValue} instance made from <code>cell</code> Note: Even if the cell is an
|
||||
* object of any of the subclass of {@link KeyValue}, we will create a new
|
||||
* {@link KeyValue} object wrapping same buffer. This API is used only with MR based tools
|
||||
* which expect the type to be exactly KeyValue. That is the reason for doing this way.
|
||||
* @deprecated without any replacement.
|
||||
*/
|
||||
@Deprecated
|
||||
|
@ -444,8 +444,9 @@ public class KeyValueUtil {
|
|||
}
|
||||
|
||||
/**
|
||||
* Write out a KeyValue in the manner in which we used to when KeyValue was a Writable. nn
|
||||
* * @return Length written on stream n * @see #create(DataInput) for the inverse function
|
||||
* Write out a KeyValue in the manner in which we used to when KeyValue was a Writable.
|
||||
* @return Length written on stream
|
||||
* @see #create(DataInput) for the inverse function
|
||||
*/
|
||||
public static long write(final KeyValue kv, final DataOutput out) throws IOException {
|
||||
// This is how the old Writables write used to serialize KVs. Need to figure
|
||||
|
@ -639,7 +640,7 @@ public class KeyValueUtil {
|
|||
* @param in inputStream to read.
|
||||
* @param withTags whether the keyvalue should include tags are not
|
||||
* @return Created KeyValue OR if we find a length of zero, we will return null which can be
|
||||
* useful marking a stream as done. n
|
||||
* useful marking a stream as done.
|
||||
*/
|
||||
public static KeyValue createKeyValueFromInputStream(InputStream in, boolean withTags)
|
||||
throws IOException {
|
||||
|
@ -663,24 +664,24 @@ public class KeyValueUtil {
|
|||
}
|
||||
|
||||
/**
|
||||
* n * @return A KeyValue made of a byte array that holds the key-only part. Needed to convert
|
||||
* hfile index members to KeyValues.
|
||||
* Returns a KeyValue made of a byte array that holds the key-only part. Needed to convert hfile
|
||||
* index members to KeyValues.
|
||||
*/
|
||||
public static KeyValue createKeyValueFromKey(final byte[] b) {
|
||||
return createKeyValueFromKey(b, 0, b.length);
|
||||
}
|
||||
|
||||
/**
|
||||
* n * @return A KeyValue made of a byte buffer that holds the key-only part. Needed to convert
|
||||
* hfile index members to KeyValues.
|
||||
* Return a KeyValue made of a byte buffer that holds the key-only part. Needed to convert hfile
|
||||
* index members to KeyValues.
|
||||
*/
|
||||
public static KeyValue createKeyValueFromKey(final ByteBuffer bb) {
|
||||
return createKeyValueFromKey(bb.array(), bb.arrayOffset(), bb.limit());
|
||||
}
|
||||
|
||||
/**
|
||||
* nnn * @return A KeyValue made of a byte array that holds the key-only part. Needed to convert
|
||||
* hfile index members to KeyValues.
|
||||
* Return a KeyValue made of a byte array that holds the key-only part. Needed to convert hfile
|
||||
* index members to KeyValues.
|
||||
*/
|
||||
public static KeyValue createKeyValueFromKey(final byte[] b, final int o, final int l) {
|
||||
byte[] newb = new byte[l + KeyValue.ROW_OFFSET];
|
||||
|
@ -691,19 +692,19 @@ public class KeyValueUtil {
|
|||
}
|
||||
|
||||
/**
|
||||
* n * Where to read bytes from. Creates a byte array to hold the KeyValue backing bytes copied
|
||||
* from the steam.
|
||||
* Where to read bytes from. Creates a byte array to hold the KeyValue backing bytes copied from
|
||||
* the steam.
|
||||
* @return KeyValue created by deserializing from <code>in</code> OR if we find a length of zero,
|
||||
* we will return null which can be useful marking a stream as done. n
|
||||
* we will return null which can be useful marking a stream as done.
|
||||
*/
|
||||
public static KeyValue create(final DataInput in) throws IOException {
|
||||
return create(in.readInt(), in);
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a KeyValue reading <code>length</code> from <code>in</code> nn * @return Created
|
||||
* KeyValue OR if we find a length of zero, we will return null which can be useful marking a
|
||||
* stream as done. n
|
||||
* Create a KeyValue reading <code>length</code> from <code>in</code>
|
||||
* @return Created KeyValue OR if we find a length of zero, we will return null which can be
|
||||
* useful marking a stream as done.
|
||||
*/
|
||||
public static KeyValue create(int length, final DataInput in) throws IOException {
|
||||
|
||||
|
|
|
@ -1046,7 +1046,7 @@ public final class PrivateCellUtil {
|
|||
* Writes the row from the given cell to the output stream excluding the common prefix
|
||||
* @param out The dataoutputstream to which the data has to be written
|
||||
* @param cell The cell whose contents has to be written
|
||||
* @param rlength the row length n
|
||||
* @param rlength the row length
|
||||
*/
|
||||
public static void writeRowSkippingBytes(DataOutputStream out, Cell cell, short rlength,
|
||||
int commonPrefix) throws IOException {
|
||||
|
@ -1234,7 +1234,6 @@ public final class PrivateCellUtil {
|
|||
|
||||
/**
|
||||
* Compares only the key portion of a cell. It does not include the sequence id/mvcc of the cell
|
||||
* nn
|
||||
* @return an int greater than 0 if left > than right lesser than 0 if left < than right
|
||||
* equal to 0 if left is equal to right
|
||||
*/
|
||||
|
@ -2195,7 +2194,7 @@ public final class PrivateCellUtil {
|
|||
/**
|
||||
* Writes the Cell's key part as it would have serialized in a KeyValue. The format is <2 bytes
|
||||
* rk len><rk><1 byte cf len><cf><qualifier><8 bytes
|
||||
* timestamp><1 byte type> nnn
|
||||
* timestamp><1 byte type>
|
||||
*/
|
||||
public static void writeFlatKey(Cell cell, DataOutput out) throws IOException {
|
||||
short rowLen = cell.getRowLength();
|
||||
|
@ -2227,7 +2226,7 @@ public final class PrivateCellUtil {
|
|||
/**
|
||||
* Deep clones the given cell if the cell supports deep cloning
|
||||
* @param cell the cell to be cloned
|
||||
* @return the cloned cell n
|
||||
* @return the cloned cell
|
||||
*/
|
||||
public static Cell deepClone(Cell cell) throws CloneNotSupportedException {
|
||||
if (cell instanceof ExtendedCell) {
|
||||
|
@ -2241,7 +2240,7 @@ public final class PrivateCellUtil {
|
|||
* @param cell the cell to be written
|
||||
* @param out the outputstream
|
||||
* @param withTags if tags are to be written or not
|
||||
* @return the total bytes written n
|
||||
* @return the total bytes written
|
||||
*/
|
||||
public static int writeCell(Cell cell, OutputStream out, boolean withTags) throws IOException {
|
||||
if (cell instanceof ExtendedCell) {
|
||||
|
@ -2316,8 +2315,8 @@ public final class PrivateCellUtil {
|
|||
|
||||
/**
|
||||
* Sets the given seqId to the cell. Marked as audience Private as of 1.2.0. Setting a Cell
|
||||
* sequenceid is an internal implementation detail not for general public use. nn * @throws
|
||||
* IOException when the passed cell is not of type {@link ExtendedCell}
|
||||
* sequenceid is an internal implementation detail not for general public use.
|
||||
* @throws IOException when the passed cell is not of type {@link ExtendedCell}
|
||||
*/
|
||||
public static void setSequenceId(Cell cell, long seqId) throws IOException {
|
||||
if (cell instanceof ExtendedCell) {
|
||||
|
@ -2329,8 +2328,8 @@ public final class PrivateCellUtil {
|
|||
}
|
||||
|
||||
/**
|
||||
* Sets the given timestamp to the cell. nn * @throws IOException when the passed cell is not of
|
||||
* type {@link ExtendedCell}
|
||||
* Sets the given timestamp to the cell.
|
||||
* @throws IOException when the passed cell is not of type {@link ExtendedCell}
|
||||
*/
|
||||
public static void setTimestamp(Cell cell, long ts) throws IOException {
|
||||
if (cell instanceof ExtendedCell) {
|
||||
|
@ -2386,7 +2385,7 @@ public final class PrivateCellUtil {
|
|||
* Writes the row from the given cell to the output stream
|
||||
* @param out The outputstream to which the data has to be written
|
||||
* @param cell The cell whose contents has to be written
|
||||
* @param rlength the row length n
|
||||
* @param rlength the row length
|
||||
*/
|
||||
public static void writeRow(OutputStream out, Cell cell, short rlength) throws IOException {
|
||||
if (cell instanceof ByteBufferExtendedCell) {
|
||||
|
@ -2401,7 +2400,7 @@ public final class PrivateCellUtil {
|
|||
* Writes the family from the given cell to the output stream
|
||||
* @param out The outputstream to which the data has to be written
|
||||
* @param cell The cell whose contents has to be written
|
||||
* @param flength the family length n
|
||||
* @param flength the family length
|
||||
*/
|
||||
public static void writeFamily(OutputStream out, Cell cell, byte flength) throws IOException {
|
||||
if (cell instanceof ByteBufferExtendedCell) {
|
||||
|
@ -2416,7 +2415,7 @@ public final class PrivateCellUtil {
|
|||
* Writes the qualifier from the given cell to the output stream
|
||||
* @param out The outputstream to which the data has to be written
|
||||
* @param cell The cell whose contents has to be written
|
||||
* @param qlength the qualifier length n
|
||||
* @param qlength the qualifier length
|
||||
*/
|
||||
public static void writeQualifier(OutputStream out, Cell cell, int qlength) throws IOException {
|
||||
if (cell instanceof ByteBufferExtendedCell) {
|
||||
|
@ -2432,7 +2431,7 @@ public final class PrivateCellUtil {
|
|||
* Writes the qualifier from the given cell to the output stream excluding the common prefix
|
||||
* @param out The dataoutputstream to which the data has to be written
|
||||
* @param cell The cell whose contents has to be written
|
||||
* @param qlength the qualifier length n
|
||||
* @param qlength the qualifier length
|
||||
*/
|
||||
public static void writeQualifierSkippingBytes(DataOutputStream out, Cell cell, int qlength,
|
||||
int commonPrefix) throws IOException {
|
||||
|
@ -2451,7 +2450,7 @@ public final class PrivateCellUtil {
|
|||
* Writes the value from the given cell to the output stream
|
||||
* @param out The outputstream to which the data has to be written
|
||||
* @param cell The cell whose contents has to be written
|
||||
* @param vlength the value length n
|
||||
* @param vlength the value length
|
||||
*/
|
||||
public static void writeValue(OutputStream out, Cell cell, int vlength) throws IOException {
|
||||
if (cell instanceof ByteBufferExtendedCell) {
|
||||
|
@ -2466,7 +2465,7 @@ public final class PrivateCellUtil {
|
|||
* Writes the tag from the given cell to the output stream
|
||||
* @param out The outputstream to which the data has to be written
|
||||
* @param cell The cell whose contents has to be written
|
||||
* @param tagsLength the tag length n
|
||||
* @param tagsLength the tag length
|
||||
*/
|
||||
public static void writeTags(OutputStream out, Cell cell, int tagsLength) throws IOException {
|
||||
if (cell instanceof ByteBufferExtendedCell) {
|
||||
|
@ -2499,7 +2498,8 @@ public final class PrivateCellUtil {
|
|||
}
|
||||
|
||||
/**
|
||||
* Converts the rowkey bytes of the given cell into an int value n * @return rowkey as int
|
||||
* Converts the rowkey bytes of the given cell into an int value
|
||||
* @return rowkey as int
|
||||
*/
|
||||
public static int getRowAsInt(Cell cell) {
|
||||
if (cell instanceof ByteBufferExtendedCell) {
|
||||
|
@ -2510,7 +2510,8 @@ public final class PrivateCellUtil {
|
|||
}
|
||||
|
||||
/**
|
||||
* Converts the value bytes of the given cell into a long value n * @return value as long
|
||||
* Converts the value bytes of the given cell into a long value
|
||||
* @return value as long
|
||||
*/
|
||||
public static long getValueAsLong(Cell cell) {
|
||||
if (cell instanceof ByteBufferExtendedCell) {
|
||||
|
@ -2521,7 +2522,8 @@ public final class PrivateCellUtil {
|
|||
}
|
||||
|
||||
/**
|
||||
* Converts the value bytes of the given cell into a int value n * @return value as int
|
||||
* Converts the value bytes of the given cell into a int value
|
||||
* @return value as int
|
||||
*/
|
||||
public static int getValueAsInt(Cell cell) {
|
||||
if (cell instanceof ByteBufferExtendedCell) {
|
||||
|
@ -2532,7 +2534,8 @@ public final class PrivateCellUtil {
|
|||
}
|
||||
|
||||
/**
|
||||
* Converts the value bytes of the given cell into a double value n * @return value as double
|
||||
* Converts the value bytes of the given cell into a double value
|
||||
* @return value as double
|
||||
*/
|
||||
public static double getValueAsDouble(Cell cell) {
|
||||
if (cell instanceof ByteBufferExtendedCell) {
|
||||
|
@ -2543,7 +2546,8 @@ public final class PrivateCellUtil {
|
|||
}
|
||||
|
||||
/**
|
||||
* Converts the value bytes of the given cell into a BigDecimal n * @return value as BigDecimal
|
||||
* Converts the value bytes of the given cell into a BigDecimal
|
||||
* @return value as BigDecimal
|
||||
*/
|
||||
public static BigDecimal getValueAsBigDecimal(Cell cell) {
|
||||
if (cell instanceof ByteBufferExtendedCell) {
|
||||
|
@ -2764,8 +2768,9 @@ public final class PrivateCellUtil {
|
|||
/**
|
||||
* Estimate based on keyvalue's serialization format in the RPC layer. Note that there is an extra
|
||||
* SIZEOF_INT added to the size here that indicates the actual length of the cell for cases where
|
||||
* cell's are serialized in a contiguous format (For eg in RPCs). n * @return Estimate of the
|
||||
* <code>cell</code> size in bytes plus an extra SIZEOF_INT indicating the actual cell length.
|
||||
* cell's are serialized in a contiguous format (For eg in RPCs).
|
||||
* @return Estimate of the <code>cell</code> size in bytes plus an extra SIZEOF_INT indicating the
|
||||
* actual cell length.
|
||||
*/
|
||||
public static int estimatedSerializedSizeOf(final Cell cell) {
|
||||
return cell.getSerializedSize() + Bytes.SIZEOF_INT;
|
||||
|
@ -2785,9 +2790,9 @@ public final class PrivateCellUtil {
|
|||
/**
|
||||
* This method exists just to encapsulate how we serialize keys. To be replaced by a factory that
|
||||
* we query to figure what the Cell implementation is and then, what serialization engine to use
|
||||
* and further, how to serialize the key for inclusion in hfile index. TODO. n * @return The key
|
||||
* portion of the Cell serialized in the old-school KeyValue way or null if passed a null
|
||||
* <code>cell</code>
|
||||
* and further, how to serialize the key for inclusion in hfile index. TODO.
|
||||
* @return The key portion of the Cell serialized in the old-school KeyValue way or null if passed
|
||||
* a null <code>cell</code>
|
||||
*/
|
||||
public static byte[] getCellKeySerializedAsKeyValueKey(final Cell cell) {
|
||||
if (cell == null) return null;
|
||||
|
@ -2797,8 +2802,8 @@ public final class PrivateCellUtil {
|
|||
}
|
||||
|
||||
/**
|
||||
* Create a Cell that is smaller than all other possible Cells for the given Cell's row. n
|
||||
* * @return First possible Cell on passed Cell's row.
|
||||
* Create a Cell that is smaller than all other possible Cells for the given Cell's row.
|
||||
* @return First possible Cell on passed Cell's row.
|
||||
*/
|
||||
public static Cell createFirstOnRow(final Cell cell) {
|
||||
if (cell instanceof ByteBufferExtendedCell) {
|
||||
|
@ -2862,8 +2867,8 @@ public final class PrivateCellUtil {
|
|||
|
||||
/**
|
||||
* Create a Cell that is smaller than all other possible Cells for the given Cell's rk:cf and
|
||||
* passed qualifier. nnnn * @return Last possible Cell on passed Cell's rk:cf and passed
|
||||
* qualifier.
|
||||
* passed qualifier.
|
||||
* @return Last possible Cell on passed Cell's rk:cf and passed qualifier.
|
||||
*/
|
||||
public static Cell createFirstOnRowCol(final Cell cell, byte[] qArray, int qoffest, int qlength) {
|
||||
if (cell instanceof ByteBufferExtendedCell) {
|
||||
|
@ -2883,7 +2888,7 @@ public final class PrivateCellUtil {
|
|||
* Creates the first cell with the row/family/qualifier of this cell and the given timestamp. Uses
|
||||
* the "maximum" type that guarantees that the new cell is the lowest possible for this
|
||||
* combination of row, family, qualifier, and timestamp. This cell's own timestamp is ignored.
|
||||
* @param cell - cell n
|
||||
* @param cell - cell
|
||||
*/
|
||||
public static Cell createFirstOnRowColTS(Cell cell, long ts) {
|
||||
if (cell instanceof ByteBufferExtendedCell) {
|
||||
|
@ -2901,8 +2906,8 @@ public final class PrivateCellUtil {
|
|||
}
|
||||
|
||||
/**
|
||||
* Create a Cell that is larger than all other possible Cells for the given Cell's row. n
|
||||
* * @return Last possible Cell on passed Cell's row.
|
||||
* Create a Cell that is larger than all other possible Cells for the given Cell's row.
|
||||
* @return Last possible Cell on passed Cell's row.
|
||||
*/
|
||||
public static Cell createLastOnRow(final Cell cell) {
|
||||
if (cell instanceof ByteBufferExtendedCell) {
|
||||
|
@ -2919,7 +2924,8 @@ public final class PrivateCellUtil {
|
|||
/**
|
||||
* Create a Cell that is larger than all other possible Cells for the given Cell's rk:cf:q. Used
|
||||
* in creating "fake keys" for the multi-column Bloom filter optimization to skip the row/column
|
||||
* we already know is not in the file. n * @return Last possible Cell on passed Cell's rk:cf:q.
|
||||
* we already know is not in the file.
|
||||
* @return Last possible Cell on passed Cell's rk:cf:q.
|
||||
*/
|
||||
public static Cell createLastOnRowCol(final Cell cell) {
|
||||
if (cell instanceof ByteBufferExtendedCell) {
|
||||
|
|
|
@ -95,7 +95,7 @@ public abstract class BaseDecoder implements Codec.Decoder {
|
|||
/**
|
||||
* Extract a Cell.
|
||||
* @return a parsed Cell or throws an Exception. EOFException or a generic IOException maybe
|
||||
* thrown if EOF is reached prematurely. Does not return null. n
|
||||
* thrown if EOF is reached prematurely. Does not return null.
|
||||
*/
|
||||
@NonNull
|
||||
protected abstract Cell parseCell() throws IOException;
|
||||
|
|
|
@ -62,7 +62,7 @@ public class CellCodec implements Codec {
|
|||
}
|
||||
|
||||
/**
|
||||
* Write int length followed by array bytes. nnnn
|
||||
* Write int length followed by array bytes.
|
||||
*/
|
||||
private void write(final byte[] bytes, final int offset, final int length) throws IOException {
|
||||
// TODO add BB backed os check and do for write. Pass Cell
|
||||
|
|
|
@ -65,7 +65,7 @@ public class CellCodecWithTags implements Codec {
|
|||
}
|
||||
|
||||
/**
|
||||
* Write int length followed by array bytes. nnnn
|
||||
* Write int length followed by array bytes.
|
||||
*/
|
||||
private void write(final byte[] bytes, final int offset, final int length) throws IOException {
|
||||
this.out.write(Bytes.toBytes(length));
|
||||
|
|
|
@ -82,7 +82,7 @@ public class ByteBufferOutputStream extends OutputStream implements ByteBufferWr
|
|||
}
|
||||
|
||||
/**
|
||||
* This flips the underlying BB so be sure to use it _last_! n
|
||||
* This flips the underlying BB so be sure to use it _last_!
|
||||
*/
|
||||
public ByteBuffer getByteBuffer() {
|
||||
curBuf.flip();
|
||||
|
|
|
@ -38,14 +38,14 @@ public interface CellOutputStream {
|
|||
* Implementation must copy the entire state of the Cell. If the written Cell is modified
|
||||
* immediately after the write method returns, the modifications must have absolutely no effect on
|
||||
* the copy of the Cell that was added in the write.
|
||||
* @param cell Cell to write out n
|
||||
* @param cell Cell to write out
|
||||
*/
|
||||
void write(Cell cell) throws IOException;
|
||||
|
||||
/**
|
||||
* Let the implementation decide what to do. Usually means writing accumulated data into a byte[]
|
||||
* that can then be read from the implementation to be sent to disk, put in the block cache, or
|
||||
* sent over the network. n
|
||||
* sent over the network.
|
||||
*/
|
||||
void flush() throws IOException;
|
||||
}
|
||||
|
|
|
@ -154,8 +154,9 @@ public class ImmutableBytesWritable implements WritableComparable<ImmutableBytes
|
|||
}
|
||||
|
||||
/**
|
||||
* Compares the bytes in this object to the specified byte array n * @return Positive if left is
|
||||
* bigger than right, 0 if they are equal, and negative if left is smaller than right.
|
||||
* Compares the bytes in this object to the specified byte array
|
||||
* @return Positive if left is bigger than right, 0 if they are equal, and negative if left is
|
||||
* smaller than right.
|
||||
*/
|
||||
public int compareTo(final byte[] that) {
|
||||
return WritableComparator.compareBytes(this.bytes, this.offset, this.length, that, 0,
|
||||
|
|
|
@ -57,7 +57,7 @@ public class TagCompressionContext {
|
|||
* @param out Stream to which the compressed tags to be written
|
||||
* @param in Source where tags are available
|
||||
* @param offset Offset for the tags bytes
|
||||
* @param length Length of all tag bytes n
|
||||
* @param length Length of all tag bytes
|
||||
*/
|
||||
public void compressTags(OutputStream out, byte[] in, int offset, int length) throws IOException {
|
||||
int pos = offset;
|
||||
|
@ -76,7 +76,7 @@ public class TagCompressionContext {
|
|||
* @param out Stream to which the compressed tags to be written
|
||||
* @param in Source buffer where tags are available
|
||||
* @param offset Offset for the tags byte buffer
|
||||
* @param length Length of all tag bytes n
|
||||
* @param length Length of all tag bytes
|
||||
*/
|
||||
public void compressTags(OutputStream out, ByteBuffer in, int offset, int length)
|
||||
throws IOException {
|
||||
|
@ -101,7 +101,7 @@ public class TagCompressionContext {
|
|||
* @param src Stream where the compressed tags are available
|
||||
* @param dest Destination array where to write the uncompressed tags
|
||||
* @param offset Offset in destination where tags to be written
|
||||
* @param length Length of all tag bytes n
|
||||
* @param length Length of all tag bytes
|
||||
*/
|
||||
public void uncompressTags(InputStream src, byte[] dest, int offset, int length)
|
||||
throws IOException {
|
||||
|
@ -133,7 +133,7 @@ public class TagCompressionContext {
|
|||
* @param dest Destination array where to write the uncompressed tags
|
||||
* @param offset Offset in destination where tags to be written
|
||||
* @param length Length of all tag bytes
|
||||
* @return bytes count read from source to uncompress all tags. n
|
||||
* @return bytes count read from source to uncompress all tags.
|
||||
*/
|
||||
public int uncompressTags(ByteBuff src, byte[] dest, int offset, int length) throws IOException {
|
||||
int srcBeginPos = src.position();
|
||||
|
|
|
@ -86,7 +86,7 @@ public abstract class Cipher {
|
|||
* @param out the output stream to wrap
|
||||
* @param context the encryption context
|
||||
* @param iv initialization vector
|
||||
* @return the encrypting wrapper n
|
||||
* @return the encrypting wrapper
|
||||
*/
|
||||
public abstract OutputStream createEncryptionStream(OutputStream out, Context context, byte[] iv)
|
||||
throws IOException;
|
||||
|
@ -95,7 +95,7 @@ public abstract class Cipher {
|
|||
* Create an encrypting output stream given an initialized encryptor
|
||||
* @param out the output stream to wrap
|
||||
* @param encryptor the encryptor
|
||||
* @return the encrypting wrapper n
|
||||
* @return the encrypting wrapper
|
||||
*/
|
||||
public abstract OutputStream createEncryptionStream(OutputStream out, Encryptor encryptor)
|
||||
throws IOException;
|
||||
|
@ -105,7 +105,7 @@ public abstract class Cipher {
|
|||
* @param in the input stream to wrap
|
||||
* @param context the encryption context
|
||||
* @param iv initialization vector
|
||||
* @return the decrypting wrapper n
|
||||
* @return the decrypting wrapper
|
||||
*/
|
||||
public abstract InputStream createDecryptionStream(InputStream in, Context context, byte[] iv)
|
||||
throws IOException;
|
||||
|
@ -114,7 +114,7 @@ public abstract class Cipher {
|
|||
* Create a decrypting output stream given an initialized decryptor
|
||||
* @param in the input stream to wrap
|
||||
* @param decryptor the decryptor
|
||||
* @return the decrypting wrapper n
|
||||
* @return the decrypting wrapper
|
||||
*/
|
||||
public abstract InputStream createDecryptionStream(InputStream in, Decryptor decryptor)
|
||||
throws IOException;
|
||||
|
|
|
@ -28,7 +28,7 @@ import org.apache.yetus.audience.InterfaceAudience;
|
|||
public interface Decryptor {
|
||||
|
||||
/**
|
||||
* Set the secret key n
|
||||
* Set the secret key
|
||||
*/
|
||||
public void setKey(Key key);
|
||||
|
||||
|
@ -45,12 +45,12 @@ public interface Decryptor {
|
|||
public int getBlockSize();
|
||||
|
||||
/**
|
||||
* Set the initialization vector n
|
||||
* Set the initialization vector
|
||||
*/
|
||||
public void setIv(byte[] iv);
|
||||
|
||||
/**
|
||||
* Create a stream for decryption n
|
||||
* Create a stream for decryption
|
||||
*/
|
||||
public InputStream createDecryptionStream(InputStream in);
|
||||
|
||||
|
|
|
@ -318,7 +318,7 @@ public final class Encryption {
|
|||
* <p>
|
||||
* The encryptor's state will be finalized. It should be reinitialized or returned to the pool.
|
||||
* @param out ciphertext
|
||||
* @param src plaintext nnnn
|
||||
* @param src plaintext
|
||||
*/
|
||||
public static void encrypt(OutputStream out, byte[] src, int offset, int length, Encryptor e)
|
||||
throws IOException {
|
||||
|
@ -333,7 +333,7 @@ public final class Encryption {
|
|||
/**
|
||||
* Encrypt a block of plaintext
|
||||
* @param out ciphertext
|
||||
* @param src plaintext nnnnn
|
||||
* @param src plaintext
|
||||
*/
|
||||
public static void encrypt(OutputStream out, byte[] src, int offset, int length, Context context,
|
||||
byte[] iv) throws IOException {
|
||||
|
@ -349,7 +349,7 @@ public final class Encryption {
|
|||
* <p>
|
||||
* The encryptor's state will be finalized. It should be reinitialized or returned to the pool.
|
||||
* @param out ciphertext
|
||||
* @param in plaintext nn
|
||||
* @param in plaintext
|
||||
*/
|
||||
public static void encrypt(OutputStream out, InputStream in, Encryptor e) throws IOException {
|
||||
OutputStream cout = e.createEncryptionStream(out);
|
||||
|
@ -363,7 +363,7 @@ public final class Encryption {
|
|||
/**
|
||||
* Encrypt a stream of plaintext given a context and IV
|
||||
* @param out ciphertext
|
||||
* @param in plaintet nnn
|
||||
* @param in plaintet
|
||||
*/
|
||||
public static void encrypt(OutputStream out, InputStream in, Context context, byte[] iv)
|
||||
throws IOException {
|
||||
|
@ -378,7 +378,6 @@ public final class Encryption {
|
|||
* Decrypt a block of ciphertext read in from a stream with the given cipher and context
|
||||
* <p>
|
||||
* The decryptor's state will be finalized. It should be reinitialized or returned to the pool.
|
||||
* nnnnnn
|
||||
*/
|
||||
public static void decrypt(byte[] dest, int destOffset, InputStream in, int destSize, Decryptor d)
|
||||
throws IOException {
|
||||
|
@ -391,7 +390,7 @@ public final class Encryption {
|
|||
}
|
||||
|
||||
/**
|
||||
* Decrypt a block of ciphertext from a stream given a context and IV nnnnnnn
|
||||
* Decrypt a block of ciphertext from a stream given a context and IV
|
||||
*/
|
||||
public static void decrypt(byte[] dest, int destOffset, InputStream in, int destSize,
|
||||
Context context, byte[] iv) throws IOException {
|
||||
|
@ -402,7 +401,7 @@ public final class Encryption {
|
|||
}
|
||||
|
||||
/**
|
||||
* Decrypt a stream of ciphertext given a decryptor nnnnn
|
||||
* Decrypt a stream of ciphertext given a decryptor
|
||||
*/
|
||||
public static void decrypt(OutputStream out, InputStream in, int outLen, Decryptor d)
|
||||
throws IOException {
|
||||
|
@ -425,7 +424,7 @@ public final class Encryption {
|
|||
}
|
||||
|
||||
/**
|
||||
* Decrypt a stream of ciphertext given a context and IV nnnnnn
|
||||
* Decrypt a stream of ciphertext given a context and IV
|
||||
*/
|
||||
public static void decrypt(OutputStream out, InputStream in, int outLen, Context context,
|
||||
byte[] iv) throws IOException {
|
||||
|
@ -436,7 +435,8 @@ public final class Encryption {
|
|||
}
|
||||
|
||||
/**
|
||||
* Resolves a key for the given subject nn * @return a key for the given subject
|
||||
* Resolves a key for the given subject
|
||||
* @return a key for the given subject
|
||||
* @throws IOException if the key is not found
|
||||
*/
|
||||
public static Key getSecretKeyForSubject(String subject, Configuration conf) throws IOException {
|
||||
|
@ -460,7 +460,7 @@ public final class Encryption {
|
|||
* @param in plaintext
|
||||
* @param conf configuration
|
||||
* @param cipher the encryption algorithm
|
||||
* @param iv the initialization vector, can be null n
|
||||
* @param iv the initialization vector, can be null
|
||||
*/
|
||||
public static void encryptWithSubjectKey(OutputStream out, InputStream in, String subject,
|
||||
Configuration conf, Cipher cipher, byte[] iv) throws IOException {
|
||||
|
@ -482,7 +482,7 @@ public final class Encryption {
|
|||
* @param subject the subject's key alias
|
||||
* @param conf configuration
|
||||
* @param cipher the encryption algorithm
|
||||
* @param iv the initialization vector, can be null n
|
||||
* @param iv the initialization vector, can be null
|
||||
*/
|
||||
public static void decryptWithSubjectKey(OutputStream out, InputStream in, int outLen,
|
||||
String subject, Configuration conf, Cipher cipher, byte[] iv) throws IOException {
|
||||
|
|
|
@ -28,7 +28,7 @@ import org.apache.yetus.audience.InterfaceAudience;
|
|||
public interface Encryptor {
|
||||
|
||||
/**
|
||||
* Set the secret key n
|
||||
* Set the secret key
|
||||
*/
|
||||
public void setKey(Key key);
|
||||
|
||||
|
@ -50,12 +50,12 @@ public interface Encryptor {
|
|||
public byte[] getIv();
|
||||
|
||||
/**
|
||||
* Set the initialization vector n
|
||||
* Set the initialization vector
|
||||
*/
|
||||
public void setIv(byte[] iv);
|
||||
|
||||
/**
|
||||
* Create a stream for encryption n
|
||||
* Create a stream for encryption
|
||||
*/
|
||||
public OutputStream createEncryptionStream(OutputStream out);
|
||||
|
||||
|
|
|
@ -31,13 +31,13 @@ public interface KeyProvider {
|
|||
public static final String PASSWORDFILE = "passwordfile";
|
||||
|
||||
/**
|
||||
* Initialize the key provider n
|
||||
* Initialize the key provider
|
||||
*/
|
||||
public void init(String params);
|
||||
|
||||
/**
|
||||
* Retrieve the key for a given key aliase n * @return the keys corresponding to the supplied
|
||||
* alias, or null if a key is not found
|
||||
* Retrieve the key for a given key aliase
|
||||
* @return the keys corresponding to the supplied alias, or null if a key is not found
|
||||
*/
|
||||
public Key getKey(String alias);
|
||||
|
||||
|
|
|
@ -90,9 +90,8 @@ public interface DataBlockEncoder {
|
|||
EncodedSeeker createSeeker(HFileBlockDecodingContext decodingCtx);
|
||||
|
||||
/**
|
||||
* Creates a encoder specific encoding context n * store configuration n * encoding strategy used
|
||||
* n * header bytes to be written, put a dummy header here if the header is unknown n * HFile meta
|
||||
* data
|
||||
* Creates a encoder specific encoding context store configuration encoding strategy used header
|
||||
* bytes to be written, put a dummy header here if the header is unknown HFile meta data
|
||||
* @return a newly created encoding context
|
||||
*/
|
||||
HFileBlockEncodingContext newDataBlockEncodingContext(Configuration conf,
|
||||
|
@ -100,7 +99,7 @@ public interface DataBlockEncoder {
|
|||
|
||||
/**
|
||||
* Creates an encoder specific decoding context, which will prepare the data before actual
|
||||
* decoding n * store configuration n * HFile meta data
|
||||
* decoding store configuration HFile meta data
|
||||
* @return a newly created decoding context
|
||||
*/
|
||||
HFileBlockDecodingContext newDataBlockDecodingContext(Configuration conf, HFileContext meta);
|
||||
|
|
|
@ -99,7 +99,7 @@ public enum DataBlockEncoding {
|
|||
/**
|
||||
* Writes id bytes to the given array starting from offset.
|
||||
* @param dest output array
|
||||
* @param offset starting offset of the output array n
|
||||
* @param offset starting offset of the output array
|
||||
*/
|
||||
// System.arraycopy is static native. Nothing we can do this until we have minimum JDK 9.
|
||||
@SuppressWarnings("UnsafeFinalization")
|
||||
|
|
|
@ -181,7 +181,7 @@ public class EncodedDataBlock {
|
|||
* @param inputBuffer Array to be compressed.
|
||||
* @param offset Offset to beginning of the data.
|
||||
* @param length Length to be compressed.
|
||||
* @return Size of compressed data in bytes. n
|
||||
* @return Size of compressed data in bytes.
|
||||
*/
|
||||
@edu.umd.cs.findbugs.annotations.SuppressWarnings(value = "NP_NULL_ON_SOME_PATH_EXCEPTION",
|
||||
justification = "No sure what findbugs wants but looks to me like no NPE")
|
||||
|
|
|
@ -32,9 +32,9 @@ public interface HFileBlockDecodingContext {
|
|||
/**
|
||||
* Perform all actions that need to be done before the encoder's real decoding process.
|
||||
* Decompression needs to be done if {@link HFileContext#getCompression()} returns a valid
|
||||
* compression algorithm. n * numBytes after block and encoding headers n * numBytes without
|
||||
* header required to store the block after decompressing (not decoding) n * ByteBuffer pointed
|
||||
* after the header but before the data n * on disk data to be decoded
|
||||
* compression algorithm. numBytes after block and encoding headers numBytes without header
|
||||
* required to store the block after decompressing (not decoding) ByteBuffer pointed after the
|
||||
* header but before the data on disk data to be decoded
|
||||
*/
|
||||
void prepareDecoding(int onDiskSizeWithoutHeader, int uncompressedSizeWithoutHeader,
|
||||
ByteBuff blockBufferWithoutHeader, ByteBuff onDiskBlock) throws IOException;
|
||||
|
|
|
@ -91,7 +91,7 @@ public enum IndexBlockEncoding {
|
|||
/**
|
||||
* Writes id bytes to the given array starting from offset.
|
||||
* @param dest output array
|
||||
* @param offset starting offset of the output array n
|
||||
* @param offset starting offset of the output array
|
||||
*/
|
||||
public void writeIdInBytes(byte[] dest, int offset) throws IOException {
|
||||
System.arraycopy(idInBytes, 0, dest, offset, ID_SIZE);
|
||||
|
|
|
@ -93,7 +93,8 @@ public class ThrottledInputStream extends InputStream {
|
|||
|
||||
/**
|
||||
* Read bytes starting from the specified position. This requires rawStream is an instance of
|
||||
* {@link PositionedReadable}. nnnn * @return the number of bytes read
|
||||
* {@link PositionedReadable}.
|
||||
* @return the number of bytes read
|
||||
*/
|
||||
public int read(long position, byte[] buffer, int offset, int length) throws IOException {
|
||||
if (!(rawStream instanceof PositionedReadable)) {
|
||||
|
|
|
@ -80,7 +80,7 @@ public interface Dictionary {
|
|||
* @param data the data to be written in byte[]
|
||||
* @param offset the offset
|
||||
* @param length length to be written
|
||||
* @param dict the dictionary whose contents are to written n
|
||||
* @param dict the dictionary whose contents are to written
|
||||
*/
|
||||
public static void write(OutputStream out, byte[] data, int offset, int length, Dictionary dict)
|
||||
throws IOException {
|
||||
|
@ -103,7 +103,7 @@ public interface Dictionary {
|
|||
* @param data the data to be written in ByteBuffer
|
||||
* @param offset the offset
|
||||
* @param length length to be written
|
||||
* @param dict the dictionary whose contents are to written n
|
||||
* @param dict the dictionary whose contents are to written
|
||||
*/
|
||||
public static void write(OutputStream out, ByteBuffer data, int offset, int length,
|
||||
Dictionary dict) throws IOException {
|
||||
|
|
|
@ -118,8 +118,8 @@ public class StreamUtils {
|
|||
}
|
||||
|
||||
/**
|
||||
* Reads a varInt value stored in an array. n * Input array where the varInt is available n *
|
||||
* Offset in the input array where varInt is available
|
||||
* Reads a varInt value stored in an array. Input array where the varInt is available Offset in
|
||||
* the input array where varInt is available
|
||||
* @return A pair of integers in which first value is the actual decoded varInt value and second
|
||||
* value as number of bytes taken by this varInt for it's storage in the input array.
|
||||
* @throws IOException When varint is malformed and not able to be read correctly
|
||||
|
|
|
@ -85,7 +85,8 @@ public abstract class ByteBuff implements HBaseReferenceCounted {
|
|||
public abstract int position();
|
||||
|
||||
/**
|
||||
* Sets this ByteBuff's position to the given value. n * @return this object
|
||||
* Sets this ByteBuff's position to the given value.
|
||||
* @return this object
|
||||
*/
|
||||
public abstract ByteBuff position(int position);
|
||||
|
||||
|
@ -184,7 +185,7 @@ public abstract class ByteBuff implements HBaseReferenceCounted {
|
|||
public abstract byte get();
|
||||
|
||||
/**
|
||||
* Fetches the byte at the given index. Does not change position of the underlying ByteBuffers n
|
||||
* Fetches the byte at the given index. Does not change position of the underlying ByteBuffers
|
||||
* @return the byte at the given index
|
||||
*/
|
||||
public abstract byte get(int index);
|
||||
|
@ -244,7 +245,8 @@ public abstract class ByteBuff implements HBaseReferenceCounted {
|
|||
public abstract ByteBuff put(byte[] src, int offset, int length);
|
||||
|
||||
/**
|
||||
* Copies from the given byte[] to this ByteBuff n * @return this ByteBuff
|
||||
* Copies from the given byte[] to this ByteBuff
|
||||
* @return this ByteBuff
|
||||
* @param src source byte array
|
||||
* @return this ByteBuff
|
||||
*/
|
||||
|
@ -269,14 +271,15 @@ public abstract class ByteBuff implements HBaseReferenceCounted {
|
|||
* Fetches the short value at the given index. Does not change position of the underlying
|
||||
* ByteBuffers. The caller is sure that the index will be after the current position of this
|
||||
* ByteBuff. So even if the current short does not fit in the current item we can safely move to
|
||||
* the next item and fetch the remaining bytes forming the short n * @return the short value at
|
||||
* the given index
|
||||
* the next item and fetch the remaining bytes forming the short
|
||||
* @return the short value at the given index
|
||||
*/
|
||||
public abstract short getShort(int index);
|
||||
|
||||
/**
|
||||
* Fetches the short value at the given offset from current position. Does not change position of
|
||||
* the underlying ByteBuffers. n * @return the short value at the given index.
|
||||
* the underlying ByteBuffers.
|
||||
* @return the short value at the given index.
|
||||
*/
|
||||
public abstract short getShortAfterPosition(int offset);
|
||||
|
||||
|
@ -319,13 +322,15 @@ public abstract class ByteBuff implements HBaseReferenceCounted {
|
|||
* Fetches the long at the given index. Does not change position of the underlying ByteBuffers.
|
||||
* The caller is sure that the index will be after the current position of this ByteBuff. So even
|
||||
* if the current long does not fit in the current item we can safely move to the next item and
|
||||
* fetch the remaining bytes forming the long n * @return the long value at the given index
|
||||
* fetch the remaining bytes forming the long
|
||||
* @return the long value at the given index
|
||||
*/
|
||||
public abstract long getLong(int index);
|
||||
|
||||
/**
|
||||
* Fetches the long value at the given offset from current position. Does not change position of
|
||||
* the underlying ByteBuffers. n * @return the long value at the given index.
|
||||
* the underlying ByteBuffers.
|
||||
* @return the long value at the given index.
|
||||
*/
|
||||
public abstract long getLongAfterPosition(int offset);
|
||||
|
||||
|
|
|
@ -149,8 +149,8 @@ public class MultiByteBuff extends ByteBuff {
|
|||
}
|
||||
|
||||
/**
|
||||
* Fetches the byte at the given index. Does not change position of the underlying ByteBuffers n
|
||||
* * @return the byte at the given index
|
||||
* Fetches the byte at the given index. Does not change position of the underlying ByteBuffers
|
||||
* @return the byte at the given index
|
||||
*/
|
||||
@Override
|
||||
public byte get(int index) {
|
||||
|
@ -201,8 +201,8 @@ public class MultiByteBuff extends ByteBuff {
|
|||
}
|
||||
|
||||
/**
|
||||
* Fetches the int at the given index. Does not change position of the underlying ByteBuffers n
|
||||
* * @return the int value at the given index
|
||||
* Fetches the int at the given index. Does not change position of the underlying ByteBuffers
|
||||
* @return the int value at the given index
|
||||
*/
|
||||
@Override
|
||||
public int getInt(int index) {
|
||||
|
@ -235,8 +235,8 @@ public class MultiByteBuff extends ByteBuff {
|
|||
}
|
||||
|
||||
/**
|
||||
* Fetches the short at the given index. Does not change position of the underlying ByteBuffers n
|
||||
* * @return the short value at the given index
|
||||
* Fetches the short at the given index. Does not change position of the underlying ByteBuffers
|
||||
* @return the short value at the given index
|
||||
*/
|
||||
@Override
|
||||
public short getShort(int index) {
|
||||
|
@ -347,8 +347,8 @@ public class MultiByteBuff extends ByteBuff {
|
|||
}
|
||||
|
||||
/**
|
||||
* Fetches the long at the given index. Does not change position of the underlying ByteBuffers n
|
||||
* * @return the long value at the given index
|
||||
* Fetches the long at the given index. Does not change position of the underlying ByteBuffers
|
||||
* @return the long value at the given index
|
||||
*/
|
||||
@Override
|
||||
public long getLong(int index) {
|
||||
|
@ -388,7 +388,8 @@ public class MultiByteBuff extends ByteBuff {
|
|||
}
|
||||
|
||||
/**
|
||||
* Sets this MBB's position to the given value. n * @return this object
|
||||
* Sets this MBB's position to the given value.
|
||||
* @return this object
|
||||
*/
|
||||
@Override
|
||||
public MultiByteBuff position(int position) {
|
||||
|
@ -569,7 +570,7 @@ public class MultiByteBuff extends ByteBuff {
|
|||
|
||||
/**
|
||||
* Copies the content from this MBB's current position to the byte array and fills it. Also
|
||||
* advances the position of the MBB by the length of the byte[]. n
|
||||
* advances the position of the MBB by the length of the byte[].
|
||||
*/
|
||||
@Override
|
||||
public void get(byte[] dst) {
|
||||
|
@ -615,7 +616,8 @@ public class MultiByteBuff extends ByteBuff {
|
|||
}
|
||||
|
||||
/**
|
||||
* Marks the limit of this MBB. n * @return This MBB
|
||||
* Marks the limit of this MBB.
|
||||
* @return This MBB
|
||||
*/
|
||||
@Override
|
||||
public MultiByteBuff limit(int limit) {
|
||||
|
@ -686,8 +688,8 @@ public class MultiByteBuff extends ByteBuff {
|
|||
}
|
||||
|
||||
/**
|
||||
* Writes a byte to this MBB at the current position and increments the position n * @return this
|
||||
* object
|
||||
* Writes a byte to this MBB at the current position and increments the position
|
||||
* @return this object
|
||||
*/
|
||||
@Override
|
||||
public MultiByteBuff put(byte b) {
|
||||
|
@ -960,7 +962,7 @@ public class MultiByteBuff extends ByteBuff {
|
|||
}
|
||||
|
||||
/**
|
||||
* Jumps the current position of this MBB by specified length. n
|
||||
* Jumps the current position of this MBB by specified length.
|
||||
*/
|
||||
@Override
|
||||
public MultiByteBuff skip(int length) {
|
||||
|
@ -982,7 +984,7 @@ public class MultiByteBuff extends ByteBuff {
|
|||
}
|
||||
|
||||
/**
|
||||
* Jumps back the current position of this MBB by specified length. n
|
||||
* Jumps back the current position of this MBB by specified length.
|
||||
*/
|
||||
@Override
|
||||
public MultiByteBuff moveBack(int length) {
|
||||
|
@ -1109,8 +1111,8 @@ public class MultiByteBuff extends ByteBuff {
|
|||
}
|
||||
|
||||
/**
|
||||
* Copy the content from this MBB to a byte[] based on the given offset and length n * the
|
||||
* position from where the copy should start n * the length upto which the copy has to be done
|
||||
* Copy the content from this MBB to a byte[] based on the given offset and length the position
|
||||
* from where the copy should start the length upto which the copy has to be done
|
||||
* @return byte[] with the copied contents from this MBB.
|
||||
*/
|
||||
@Override
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue