name stringlengths 12 178 | code_snippet stringlengths 8 36.5k | score float64 3.26 3.68 |
|---|---|---|
hbase_DependentColumnFilter_parseFrom_rdh | /**
* Parse a seralized representation of {@link DependentColumnFilter}
*
* @param pbBytes
* A pb serialized {@link DependentColumnFilter} instance
* @return An instance of {@link DependentColumnFilter} made from <code>bytes</code>
* @throws DeserializationException
* if an error occurred
* @see #toByteArra... | 3.26 |
hbase_DependentColumnFilter_toByteArray_rdh | /**
* Returns The filter serialized using pb
*/
@Override
public byte[] toByteArray() {
FilterProtos.DependentColumnFilter.Builder builder = FilterProtos.DependentColumnFilter.newBuilder();
builder.setCompareFilter(super.convert());
if (this.columnFamily != null) {
builder.setColumnFamily(UnsafeB... | 3.26 |
hbase_DependentColumnFilter_dropDependentColumn_rdh | /**
* Returns true if we should drop the dependent column, false otherwise
*/
public boolean dropDependentColumn() {
return this.dropDependentColumn;} | 3.26 |
hbase_DependentColumnFilter_getFamily_rdh | /**
* Returns the column family
*/
public byte[] getFamily() {
return this.columnFamily;
} | 3.26 |
hbase_Client_executePathOnly_rdh | /**
* Execute a transaction method given only the path. Will select at random one of the members of
* the supplied cluster definition and iterate through the list until a transaction can be
* successfully completed. The definition of success here is a complete HTTP transaction,
* irrespective of result code.
*
* ... | 3.26 |
hbase_Client_getCluster_rdh | /**
* Returns the cluster definition
*/
public Cluster getCluster() {
return cluster;
} | 3.26 |
hbase_Client_put_rdh | /**
* Send a PUT request
*
* @param cluster
* the cluster definition
* @param path
* the path or URI
* @param headers
* the HTTP headers to include, <tt>Content-Type</tt> must be supplied
* @param content
* the content bytes
* @return a Response object with response detail
*/
public Response put(Clu... | 3.26 |
hbase_Client_post_rdh | /**
* Send a POST request
*
* @param cluster
* the cluster definition
* @param path
* the path or URI
* @param headers
* the HTTP headers to include, <tt>Content-Type</tt> must be supplied
* @param content
* the content bytes
* @return a Response object with response detail
*/
public Response post(C... | 3.26 |
hbase_Client_delete_rdh | /**
* Send a DELETE request
*
* @param cluster
* the cluster definition
* @param path
* the path or URI
* @return a Response object with response detail
* @throws IOException
* for error
*/
public Response delete(Cluster cluster, String path, Header extraHdr) throws IOException {
HttpDelete method = ne... | 3.26 |
hbase_Client_head_rdh | /**
* Send a HEAD request
*
* @param path
* the path or URI
* @return a Response object with response detail
*/
public Response head(String path) throws IOException {
return m0(cluster, path, null);
} | 3.26 |
hbase_Client_executeURI_rdh | /**
* Execute a transaction method given a complete URI.
*
* @param method
* the transaction method
* @param headers
* HTTP header values to send
* @param uri
* a properly urlencoded URI
* @return the HTTP response code
*/
public HttpResponse executeURI(HttpUriRequest method, Header[] headers, String u... | 3.26 |
hbase_Client_setCluster_rdh | /**
*
* @param cluster
* the cluster definition
*/
public void setCluster(Cluster cluster) {
this.cluster = cluster;
} | 3.26 |
hbase_Client_m1_rdh | /**
* Send a POST request
*
* @param cluster
* the cluster definition
* @param path
* the path or URI
* @param contentType
* the content MIME type
* @param content
* the content bytes
* @param extraHdr
* additional Header to send
* @return a Response object with response detail
* @throws IOExcep... | 3.26 |
hbase_Client_shutdown_rdh | /**
* Shut down the client. Close any open persistent connections.
*/
public void shutdown() {
} | 3.26 |
hbase_Client_getHttpClient_rdh | /**
* Returns the wrapped HttpClient
*/
public HttpClient getHttpClient() {
return httpClient;
} | 3.26 |
hbase_Client_addExtraHeader_rdh | /**
* Add extra headers. These extra headers will be applied to all http methods before they are
* removed. If any header is not used any more, client needs to remove it explicitly.
*/
public void addExtraHeader(final String name, final String value) {
extraHeaders.put(name, value);
} | 3.26 |
hbase_Client_negotiate_rdh | /**
* Initiate client side Kerberos negotiation with the server.
*
* @param method
* method to inject the authentication token into.
* @param uri
* the String to parse as a URL.
* @throws IOException
* if unknown protocol is found.
*/
private void negotiate(HttpUriRequest method, String uri) throws IOEx... | 3.26 |
hbase_Client_get_rdh | /**
* Send a GET request
*
* @param c
* the cluster definition
* @param path
* the path or URI
* @param headers
* the HTTP headers to include in the request
* @return a Response object with response detail
*/
public Response get(Cluster c, String path, Header[] headers) throws IOException {if (httpGet... | 3.26 |
hbase_Client_getExtraHeaders_rdh | /**
* Get all extra headers (read-only).
*/
public Map<String, String> getExtraHeaders() {
return Collections.unmodifiableMap(extraHeaders);
} | 3.26 |
hbase_Client_injectToken_rdh | /**
* Helper method that injects an authentication token to send with the method.
*
* @param method
* method to inject the authentication token into.
* @param token
* authentication token to inject.
*/
private void injectToken(HttpUriRequest method, AuthenticatedURL.Token token) {
String t = token.toStri... | 3.26 |
hbase_Client_execute_rdh | /**
* Execute a transaction method. Will call either <tt>executePathOnly</tt> or <tt>executeURI</tt>
* depending on whether a path only is supplied in 'path', or if a complete URI is passed instead,
* respectively.
*
* @param cluster
* the cluster definition
* @param method
* the HTTP method
* @param heade... | 3.26 |
hbase_Client_getExtraHeader_rdh | /**
* Get an extra header value.
*/
public String getExtraHeader(final String name) {
return extraHeaders.get(name);
} | 3.26 |
hbase_Client_m0_rdh | /**
* Send a HEAD request
*
* @param cluster
* the cluster definition
* @param path
* the path or URI
* @param headers
* the HTTP headers to include in the request
* @return a Response object with response detail
*/
public Response m0(Cluster cluster, String path, Header[] headers) throws IOException {
... | 3.26 |
hbase_Client_removeExtraHeader_rdh | /**
* Remove an extra header.
*/
public void removeExtraHeader(final String name) {
extraHeaders.remove(name);
} | 3.26 |
hbase_MonitoredRPCHandlerImpl_getClient_rdh | /**
* If an RPC call is currently running, produces a String representation of the connection from
* which it was received.
*
* @return A human-readable string representation of the address and port of the client.
*/
@Override
public String getClient() {
return (clientAddress + ":") + remotePort;
} | 3.26 |
hbase_MonitoredRPCHandlerImpl_isRPCRunning_rdh | /**
* Indicates to the client whether this task is monitoring a currently active RPC call.
*
* @return true if the monitored handler is currently servicing an RPC call.
*/
@Override
public boolean isRPCRunning() {
return getState() == State.RUNNING;
} | 3.26 |
hbase_MonitoredRPCHandlerImpl_setRPC_rdh | /**
* Tells this instance that it is monitoring a new RPC call.
*
* @param methodName
* The name of the method that will be called by the RPC.
* @param params
* The parameters that will be passed to the indicated method.
*/
@Override
public synchronized void setRPC(String methodName, Object[] params, long qu... | 3.26 |
hbase_MonitoredRPCHandlerImpl_getStatus_rdh | /**
* Gets the status of this handler; if it is currently servicing an RPC, this status will include
* the RPC information.
*
* @return a String describing the current status.
*/@Override
public String getStatus() {if (getState() != State.RUNNING) {
return super.getStatus();
}
return (((super.get... | 3.26 |
hbase_MonitoredRPCHandlerImpl_isOperationRunning_rdh | /**
* Indicates to the client whether this task is monitoring a currently active RPC call to a
* database command. (as defined by o.a.h.h.client.Operation)
*
* @return true if the monitored handler is currently servicing an RPC call to a database command.
*/
@Override
public synchronized boolean isOperationRunning... | 3.26 |
hbase_MonitoredRPCHandlerImpl_m1_rdh | /**
* Registers current handler client details.
*
* @param clientAddress
* the address of the current client
* @param remotePort
* the port from which the client connected
*/
@Override
public void m1(String clientAddress, int remotePort) {
this.clientAddress = clientAddress;
this.remotePort = remote... | 3.26 |
hbase_MonitoredRPCHandlerImpl_getRPCPacketLength_rdh | /**
* Produces a string representation of the method currently being serviced by this Handler.
*
* @return A human-readable string representation of the method call.
*/
@Override
public long getRPCPacketLength() {
if ((getState() != State.RUNNING) || (packet == null)) {
// no RPC is currently running,... | 3.26 |
hbase_MonitoredRPCHandlerImpl_getRPC_rdh | /**
* Produces a string representation of the method currently being serviced by this Handler.
*
* @param withParams
* toggle inclusion of parameters in the RPC String
* @return A human-readable string representation of the method call.
*/
@Override
public synchronized String getRPC(boolean
withParams) {
if... | 3.26 |
hbase_MonitoredRPCHandlerImpl_setRPCPacket_rdh | /**
* Gives this instance a reference to the protobuf received by the RPC, so that it can later
* compute its size if asked for it.
*
* @param param
* The protobuf received by the RPC for this call
*/
@Override
public void setRPCPacket(Message param) {
this.packet = param;
} | 3.26 |
hbase_MonitoredRPCHandlerImpl_getRPCStartTime_rdh | /**
* Accesses the start time for the currently running RPC on the monitored Handler.
*
* @return the start timestamp or -1 if there is no RPC currently running.
*/
@Override
public long getRPCStartTime() {
if (getState() != State.RUNNING) {
return -1;
}
return rpcStartTime;
} | 3.26 |
hbase_MonitoredRPCHandlerImpl_m0_rdh | /**
* Accesses the queue time for the currently running RPC on the monitored Handler.
*
* @return the queue timestamp or -1 if there is no RPC currently running.
*/
@Override
public long m0() {
if (getState() != State.RUNNING) {
return -1;
}return rpcQueueTime;
} | 3.26 |
hbase_IncrementCoalescer_dynamicallySetCoreSize_rdh | /**
* This method samples the incoming requests and, if selected, will check if the corePoolSize
* should be changed.
*
* @param countersMapSize
* the size of the counters map
*/
private void dynamicallySetCoreSize(int countersMapSize) {
// Here we are using countersMapSize as a random number, meaning this
// ... | 3.26 |
hbase_IncrementCoalescer_getQueueSize_rdh | // MBean get/set methods
@Override
public int getQueueSize() {
return pool.getQueue().size();
} | 3.26 |
hbase_FailedServers_addToFailedServers_rdh | /**
* Add an address to the list of the failed servers list.
*/
public synchronized void addToFailedServers(Address address, Throwable throwable) {
final long expiry = EnvironmentEdgeManager.currentTime() + recheckServersTimeout;
this.failedServers.put(address, expiry);
this.latestExpiry = expiry;
if ... | 3.26 |
hbase_FailedServers_isFailedServer_rdh | /**
* Check if the server should be considered as bad. Clean the old entries of the list.
*
* @return true if the server is in the failed servers list
*/
public synchronized boolean isFailedServer(final
Address address) {
if (failedServers.isEmpty()) {
return false;
}
final long now = Environmen... | 3.26 |
hbase_ConnectionUtils_getPauseTime_rdh | /**
* Calculate pause time. Built on {@link HConstants#RETRY_BACKOFF}.
*
* @param pause
* time to pause
* @param tries
* amount of tries
* @return How long to wait after <code>tries</code> retries
*/public static long getPauseTime(final long pause,
final int tries) {
int ntries = tries;
if (ntries ... | 3.26 |
hbase_ConnectionUtils_setServerSideHConnectionRetriesConfig_rdh | /**
* Changes the configuration to set the number of retries needed when using Connection internally,
* e.g. for updating catalog tables, etc. Call this method before we create any Connections.
*
* @param c
* The Configuration instance to set the retries into.
* @param log
* Used to log what we set in here.
... | 3.26 |
hbase_ConnectionUtils_getStubKey_rdh | /**
* Get a unique key for the rpc stub to the given server.
*/
static String getStubKey(String serviceName, ServerName serverName) {
return String.format("%s@%s", serviceName, serverName);
} | 3.26 |
hbase_ConnectionUtils_createCloseRowBefore_rdh | /**
* Create a row before the specified row and very close to the specified row.
*/
static byte[] createCloseRowBefore(byte[] row) {
if (row.length == 0) {
return MAX_BYTE_ARRAY;
}
if (row[row.length - 1] == 0) {
return Arrays.copyOf(row, row.length - 1);
} else {
byte[] nextRow = new byte[row.length + MAX_BY... | 3.26 |
hbase_ConnectionUtils_m0_rdh | /**
* Use the scan metrics returned by the server to add to the identically named counters in the
* client side metrics. If a counter does not exist with the same name as the server side metric,
* the attempt to increase the counter will fail.
*/
static void m0(ScanMetrics scanMetrics, ScanResponse response) {
if (... | 3.26 |
hbase_ConnectionUtils_calcPriority_rdh | /**
* Select the priority for the rpc call.
* <p/>
* The rules are:
* <ol>
* <li>If user set a priority explicitly, then just use it.</li>
* <li>For system table, use {@link HConstants#SYSTEMTABLE_QOS}.</li>
* <li>For other tables, use {@link HConstants#NORMAL_QOS}.</li>
* </ol>
*
* @param priority
* the p... | 3.26 |
hbase_ConnectionUtils_createClosestRowAfter_rdh | /**
* Create the closest row after the specified row
*/
static byte[] createClosestRowAfter(byte[] row) {
return Arrays.copyOf(row, row.length + 1);
} | 3.26 |
hbase_ConnectionUtils_connect_rdh | /**
* Connect the two futures, if the src future is done, then mark the dst future as done. And if
* the dst future is done, then cancel the src future. This is used for timeline consistent read.
* <p/>
* Pass empty metrics if you want to link the primary future and the dst future so we will not
* increase the hed... | 3.26 |
hbase_ConnectionUtils_retries2Attempts_rdh | /**
* Return retires + 1. The returned value will be in range [1, Integer.MAX_VALUE].
*/
static int retries2Attempts(int retries) {
return Math.max(1, retries == Integer.MAX_VALUE ? Integer.MAX_VALUE : retries + 1);
} | 3.26 |
hbase_ConnectionUtils_validatePut_rdh | // validate for well-formedness
static void validatePut(Put
put, int maxKeyValueSize) {
if (put.isEmpty()) {
throw new IllegalArgumentException("No columns to insert");
}if (maxKeyValueSize > 0) {
for (List<Cell> list : put.getFamilyCellMap().values()) {for (Cell cell : list) {
if (cell.getSerializedSize() > m... | 3.26 |
hbase_GroupingTableMapper_map_rdh | /**
* Extract the grouping columns from value to construct a new key. Pass the new key and value to
* reduce. If any of the grouping columns are not found in the value, the record is skipped.
*
* @param key
* The current key.
* @param value
* The current value.
* @param c... | 3.26 |
hbase_GroupingTableMapper_extractKeyValues_rdh | /**
* Extract columns values from the current record. This method returns null if any of the columns
* are not found.
* <p>
* Override this method if you want to deal with nulls differently.
*
* @param r
* The current values.
* @return Array of byte values.
*/
protected byte[][] extractKeyValues(Result r) {
... | 3.26 |
hbase_GroupingTableMapper_getConf_rdh | /**
* Returns the current configuration.
*
* @return The current configuration.
* @see org.apache.hadoop.conf.Configurable#getConf()
*/
@Override
public Configuration getConf() {
return conf;
} | 3.26 |
hbase_GroupingTableMapper_setConf_rdh | /**
* Sets the configuration. This is used to set up the grouping details.
*
* @param configuration
* The configuration to set.
* @see org.apache.hadoop.conf.Configurable#setConf( org.apache.hadoop.conf.Configuration)
*/
@Override
public void setConf(Configuration configuration) {
this.conf = configuration;... | 3.26 |
hbase_GroupingTableMapper_m0_rdh | /**
* Create a key by concatenating multiple column values.
* <p>
* Override this function in order to produce different types of keys.
*
* @param vals
* The current key/values.
* @return A key generated by concatenating multiple column values.
*/
protected ImmutableBytesWritable m0(byte[][] vals) {
... | 3.26 |
hbase_NamespacePermission_implies_rdh | /**
* check if given action is granted in given namespace.
*
* @param namespace
* namespace's name
* @param action
* action to be checked
* @return true if granted, false otherwise
*/
public boolean implies(String namespace, Action action) {
return namespace.equal... | 3.26 |
hbase_FSVisitor_visitRegionStoreFiles_rdh | /**
* Iterate over the region store files
*
* @param fs
* {@link FileSystem}
* @param regionDir
* {@link Path} to the region directory
* @param visitor
* callback object to get the store files
* @throws IOException
* if an error occurred while scanning the directory
*/
public static void visitRegionS... | 3.26 |
hbase_FSVisitor_visitTableStoreFiles_rdh | /**
* Iterate over the table store files
*
* @param fs
* {@link FileSystem}
* @param tableDir
* {@link Path} to the table directory
* @param visitor
* callback object to get the store files
* @throws IOException
* if an error occurred while scanning the directory
*/
public static void visitTableStor... | 3.26 |
hbase_LruCachedBlock_access_rdh | /**
* Block has been accessed.
*
* @param accessTime
* Last access; this is actually a incremented sequence number rather than an
* actual time.
*/
public void access(long accessTime) {
this.accessTime = accessTime;
if ... | 3.26 |
hbase_TestingHBaseClusterOption_convert_rdh | /**
* Convert to the internal option. Not for public use so package private.
*/
StartTestingClusterOption convert() {
return StartTestingClusterOption.builder().numMasters(numMasters).numAlwaysStandByMasters(numAlwaysStandByMasters).numRegionServers(numRegionServers).rsPorts(rsPorts).numDataNodes(numDataNodes).da... | 3.26 |
hbase_TestingHBaseClusterOption_builder_rdh | /**
* Returns a new builder.
*/
public static Builder builder() {
return new Builder();
} | 3.26 |
hbase_KeyValueCodecWithTags_getDecoder_rdh | /**
* Implementation depends on {@link InputStream#available()}
*/
@Override
public Decoder getDecoder(final InputStream is) {
return new KeyValueDecoder(is);
} | 3.26 |
hbase_SpaceQuotaSnapshotNotifierFactory_create_rdh | /**
* Instantiates the {@link SpaceQuotaSnapshotNotifier} implementation as defined in the
* configuration provided.
*
* @param conf
* Configuration object
* @return The SpaceQuotaSnapshotNotifier implementation
* @throws IllegalArgumentException
* if the class could not be instantiated
*/
public SpaceQuot... | 3.26 |
hbase_ReplicationSourceLogQueue_getQueueSize_rdh | /**
* Get the queue size for the given walGroupId.
*
* @param walGroupId
* walGroupId
*/
public int getQueueSize(String walGroupId) {
Queue<Path> queue = queues.get(walGroupId);
if (queue == null) {
return 0;
}
return queue.size();
} | 3.26 |
hbase_ReplicationSourceLogQueue_getNumQueues_rdh | /**
* Returns number of queues.
*/
public int
getNumQueues() {
return queues.size();
} | 3.26 |
hbase_ReplicationSourceLogQueue_enqueueLog_rdh | /**
* Enqueue the wal
*
* @param wal
* wal to be enqueued
* @param walGroupId
* Key for the wal in @queues map
* @return boolean whether this is the first time we are seeing this walGroupId.
*/
public boolean enqueueLog(Path wal, String walGroupId) {
boolean e... | 3.26 |
hbase_ReplicationSourceLogQueue_clear_rdh | /**
* Remove all the elements from the queue corresponding to walGroupId
*
* @param walGroupId
* walGroupId
*/
public void clear(String
walGroupId) {
PriorityBlockingQueue<Path> queue = getQueue(walGroupId);
while (!queue.isEmpty()) {
// Need to iterate since metrics#decrSizeOfLogQueue decremen... | 3.26 |
hbase_ReplicationSourceLogQueue_getQueue_rdh | /**
* Return queue for the given walGroupId Please don't add or remove elements from the returned
* queue. Use {@link #enqueueLog(Path, String)} and {@link #remove(String)} methods respectively.
*
* @param walGroupId
* walGroupId
*/
public PriorityBlockingQueue<Path> getQueue(String walGroupId)
{
return qu... | 3.26 |
hbase_ReplicationSourceLogQueue_getOldestWalAge_rdh | /* Returns the age of oldest wal. */
long getOldestWalAge() {
long now = EnvironmentEdgeManager.currentTime();
long timestamp = getOldestWalTimestamp();
if (timestamp == Long.MAX_VALUE) {
// If there are no wals in the queue then set the oldest wal timestamp to current time
// so that the ol... | 3.26 |
hbase_ReplicationSourceLogQueue_getOldestWalTimestamp_rdh | /* Get the oldest wal timestamp from all the queues. */
private long getOldestWalTimestamp() {
long oldestWalTimestamp = Long.MAX_VALUE;
for (Map.Entry<String, PriorityBlockingQueue<Path>> entry : queues.entrySet()) {
PriorityBlockingQueue<Path> queue = entry.getValue();
Path path = queue.peek()... | 3.26 |
hbase_ReplicationSourceLogQueue_remove_rdh | /**
* Remove head from the queue corresponding to given walGroupId.
*
* @param walGroupId
* walGroupId
*/
public void remove(String walGroupId) {
PriorityBlockingQueue<Path> queue = getQueue(walGroupId);
if ((queue == null) || queue.isEmpty()) {
return;
}
queue.remove();
// Decrease ... | 3.26 |
hbase_YammerHistogramUtils_getHistogramReport_rdh | /**
* Returns a summary of {@code hist}.
*/
public static String getHistogramReport(final Histogram hist) {
Snapshot sn =
hist.getSnapshot();
return (((((((((((((((((((("mean=" + DOUBLE_FORMAT.format(sn.getMean())) + ", min=") + DOUBLE_FORMAT.format(sn.getMin())) + ", max=") + DOUBLE_FORMAT.format(sn.get... | 3.26 |
hbase_YammerHistogramUtils_newHistogram_rdh | /**
* Create a new {@link com.codahale.metrics.Histogram} instance. These constructors are not public
* in 2.2.0, so we use reflection to find them.
*/
public static Histogram newHistogram(Reservoir sample) {
try {
Constructor<?> v0 = Histogram.class.getDeclaredConstructor(Res... | 3.26 |
hbase_YammerHistogramUtils_getShortHistogramReport_rdh | /**
* Returns an abbreviated summary of {@code hist}.
*/
public static String getShortHistogramReport(final Histogram hist) {
Snapshot sn = hist.getSnapshot();
return (((((((((("mean=" + DOUBLE_FORMAT.format(sn.getMean())) + ", min=") + DOUBLE_FORMAT.format(sn.getMin())) + ", max=") + DOUBLE_FORMAT.format(sn.... | 3.26 |
hbase_YammerHistogramUtils_getPrettyHistogramReport_rdh | /**
* Returns pretty summary of {@code hist}.
*/
public static String getPrettyHistogramReport(final Histogram h) {
Snapshot
sn = h.getSnapshot();
return (((((((((((((((((((((((((((((("Mean = " + DOUBLE_FORMAT.format(sn.getMean())) + "\n") + "Min = ") + DOUBLE_FORMAT.format(sn.getMin())) + "\n"... | 3.26 |
hbase_CheckAndMutate_getCompareOp_rdh | /**
* Returns the comparison operator
*/
public CompareOperator getCompareOp() {
return op;
} | 3.26 |
hbase_CheckAndMutate_getQualifier_rdh | /**
* Returns the qualifier to check
*/
public byte[] getQualifier() { return qualifier;
} | 3.26 |
hbase_CheckAndMutate_getAction_rdh | /**
* Returns the action done if check succeeds
*/
public Row getAction() {return action;
} | 3.26 |
hbase_CheckAndMutate_ifEquals_rdh | /**
* Check for equality
*
* @param family
* family to check
* @param qualifier
* qualifier to check
* @param value
* the expected value
* @return the CheckAndMutate object
*/public Builder ifEquals(byte[] family, byte[] qualifier, byte[] value) {
return ifMatches(family, qualifier,
CompareOpera... | 3.26 |
hbase_CheckAndMutate_ifMatches_rdh | /**
* Check for match
*
* @param filter
* filter to check
* @return the CheckAndMutate object
*/ public Builder ifMatches(Filter filter) {
this.filter = Preconditions.checkNotNull(filter, "filter is null");
return this;
} | 3.26 |
hbase_CheckAndMutate_getValue_rdh | /**
* Returns the expected value
*/
public byte[] getValue() {
return value;
} | 3.26 |
hbase_CheckAndMutate_getFamily_rdh | /**
* Returns the family to check
*/
public byte[] getFamily() {
return family;
} | 3.26 |
hbase_CheckAndMutate_timeRange_rdh | /**
* Specify a timerange
*
* @param timeRange
* time range to check
* @return the CheckAndMutate object
*/
public Builder timeRange(TimeRange timeRange) {
this.timeRange = timeRange;
return this;
} | 3.26 |
hbase_CheckAndMutate_ifNotExists_rdh | /**
* Check for lack of column
*
* @param family
* family to check
* @param qualifier
* qualifier to check
* @return the CheckAndMutate object
*/
public Builder ifNotExists(byte[] family, byte[] qualifier) {
return ifEquals(family, qualifier, null);
} | 3.26 |
hbase_CheckAndMutate_hasFilter_rdh | /**
* Returns whether this has a filter or not
*/
public boolean hasFilter() {
return filter != null;
} | 3.26 |
hbase_CheckAndMutate_getFilter_rdh | /**
* Returns the filter to check
*/
public Filter getFilter() {
return filter;
} | 3.26 |
hbase_CheckAndMutate_newBuilder_rdh | /**
* returns a builder object to build a CheckAndMutate object
*
* @param row
* row
* @return a builder object
*/public static Builder newBuilder(byte[]
row) {
return new Builder(row);
} | 3.26 |
hbase_CheckAndMutate_build_rdh | /**
* Build the CheckAndMutate object with a RowMutations to commit if the check succeeds.
*
* @param mutations
* mutations to perform if check succeeds
* @return a CheckAndMutate object
*/
public CheckAndMutate build(RowMutations mutations) {
preCheck(mutations);
if (filter != null) {return new CheckAn... | 3.26 |
hbase_CheckAndMutate_getRow_rdh | /**
* Returns the row
*/
@Overridepublic byte[] getRow() {
return row;
} | 3.26 |
hbase_CheckAndMutate_getTimeRange_rdh | /**
* Returns the time range to check
*/
public TimeRange getTimeRange() {
return f1;
} | 3.26 |
hbase_VerifyReplication_createSubmittableJob_rdh | /**
* Sets up the actual job.
*
* @param conf
* The current configuration.
* @param args
* The command line parameters.
* @return The newly created job.
* @throws java.io.IOException
* When setting up the job fails.
*/
public Job createSubmittableJob(Configuration conf, String[] args) throws IOException... | 3.26 |
hbase_VerifyReplication_map_rdh | /**
* Map method that compares every scanned row with the equivalent from a distant cluster.
*
* @param row
* The current table row key.
* @param value
* The columns.
* @param context
* The current context.
* @throws IOExcept... | 3.26 |
hbase_VerifyReplication_printUsage_rdh | /* @param errorMsg Error message. Can be null. */
private static void printUsage(final String errorMsg) {
if ((errorMsg != null) && (errorMsg.length() > 0)) {
System.err.println("ERROR: " + errorMsg);
}
System.err.println((((("Usage: verifyrep [--starttime=X]" + " [--endtime=Y] [--families=A] [--row-prefixes=B] [--deli... | 3.26 |
hbase_VerifyReplication_main_rdh | /**
* Main entry point.
*
* @param args
* The command line parameters.
* @throws Exception
* When running the job fails.
*/
public static void main(String[] args) throws Exception {int res = ToolRunner.run(HBaseConfiguration.create(), new VerifyReplication(), args);
System.exit(res);
} | 3.26 |
hbase_HtmlQuoting_needsQuoting_rdh | /**
* Does the given string need to be quoted?
*
* @param str
* the string to check
* @return does the string contain any of the active html characters?
*/
public static boolean needsQuoting(String str) {
if (str == null) {
return false;
}
byte[] bytes = Bytes.toBytes(str);
return needsQuoting(bytes, 0, b... | 3.26 |
hbase_HtmlQuoting_unquoteHtmlChars_rdh | /**
* Remove HTML quoting from a string.
*
* @param item
* the string to unquote
* @return the unquoted string
*/
public static String unquoteHtmlChars(String item) {
if (item == null) {
return null;
}
int next = item.indexOf('&');
// nothing was quoted
if (next == (-1)) {
return item;
}
int len = item... | 3.26 |
hbase_HtmlQuoting_quoteOutputStream_rdh | /**
* Return an output stream that quotes all of the output.
*
* @param out
* the stream to write the quoted output to
* @return a new stream that the application show write to
*/public static OutputStream quoteOutputStream(final OutputStream out) {
return new OutputStream() {
private byte[]
data = new ... | 3.26 |
hbase_HtmlQuoting_quoteHtmlChars_rdh | /**
* Quote the given item to make it html-safe.
*
* @param item
* the string to quote
* @return the quoted string
*/
public static String quoteHtmlChars(String item) {
if (item == null) {
return null;
}
byte[] bytes = Bytes.toBytes(item);
if (needsQuoting(bytes, 0, bytes.length)) {
ByteArrayOutputStrea... | 3.26 |
hbase_ZKWatcher_getMetaReplicaNodesAndWatchChildren_rdh | /**
* Same as {@link #getMetaReplicaNodes()} except that this also registers a watcher on base znode
* for subsequent CREATE/DELETE operations on child nodes.
*/
public List<String> getMetaReplicaNodesAndWatchChildren() throws KeeperException {
List<String> childrenOfBaseNode = ZKUtil.listChildrenAndWatchForNew... | 3.26 |
hbase_ZKWatcher_setZnodeAclsRecursive_rdh | /**
* Set the znode perms recursively. This will do post-order recursion, so that baseZnode ACLs will
* be set last in case the master fails in between.
*
* @param znode
* the ZNode to set the permissions for
*/
private void setZnodeAclsRecursive(String znode) throws KeeperException, InterruptedException {
... | 3.26 |
hbase_ZKWatcher_interruptedExceptionNoThrow_rdh | /**
* Log the InterruptedException and interrupt current thread
*
* @param ie
* The IterruptedException to log
* @param throwLater
* Whether we will throw the exception latter
*/
public void interruptedExceptionNoThrow(InterruptedException ie, boolean throwLater) {
LOG.debug(prefix("Received InterruptedE... | 3.26 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.