name stringlengths 12 178 | code_snippet stringlengths 8 36.5k | score float64 3.26 3.68 |
|---|---|---|
hbase_Query_setReplicaId_rdh | /**
* 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
*/
public... | 3.26 |
hbase_Query_getLoadColumnFamiliesOnDemandValue_rdh | /**
* Get the raw loadColumnFamiliesOnDemand setting; if it's not set, can be null.
*/
public Boolean getLoadColumnFamiliesOnDemandValue() {
return this.loadColumnFamiliesOnDemand;
} | 3.26 |
hbase_KeyStoreFileType_fromFilename_rdh | /**
* Detects the type of KeyStore / TrustStore file from the file extension. If the file name ends
* with ".jks", returns <code>StoreFileType.JKS</code>. If the file name ends with ".pem", returns
* <code>StoreFileType.PEM</code>. If the file name ends with ".p12", returns
* <code>StoreFileType.PKCS12</code>. If t... | 3.26 |
hbase_KeyStoreFileType_fromPropertyValueOrFileName_rdh | /**
* If <code>propertyValue</code> is not null or empty, returns the result of
* <code>KeyStoreFileType.fromPropertyValue(propertyValue)</code>. Else, returns the result of
* <code>KeyStoreFileType.fromFileName(filename)</code>.
*
* @param propertyValue
* property value describing the KeyStoreFileType, or null... | 3.26 |
hbase_KeyStoreFileType_m0_rdh | /**
* The file extension that is associated with this file type.
*/
public String m0() {
return
defaultFileExtension;
} | 3.26 |
hbase_KeyStoreFileType_getPropertyValue_rdh | /**
* The property string that specifies that a key store or trust store should use this store file
* type.
*/
public String getPropertyValue() {
return this.name();
} | 3.26 |
hbase_VisibilityLabelServiceManager_getVisibilityLabelService_rdh | /**
*
* @return singleton instance of {@link VisibilityLabelService}.
* @throws IllegalStateException
* if this called before initialization of singleton instance.
*/
public VisibilityLabelService getVisibilityLabelService() {
// By the time this method is called, the singleton instance of visibilityLabelSer... | 3.26 |
hbase_RpcHandler_getCallRunner_rdh | /**
* Returns A {@link CallRunner} n
*/
protected CallRunner getCallRunner() throws InterruptedException {
return this.q.take();
} | 3.26 |
hbase_ProcedureWALPrettyPrinter_run_rdh | /**
* Pass one or more log file names and formatting options and it will dump out a text version of
* the contents on <code>stdout</code>. Command line arguments Thrown upon file system errors etc.
*/
@Override
public int run(final String[] args) throws IOException {
// create options
Options options = new ... | 3.26 |
hbase_ProcedureWALPrettyPrinter_processFile_rdh | /**
* Reads a log file and outputs its contents.
*
* @param conf
* HBase configuration relevant to this log file
* @param p
* path of the log file to be read
* @throws IOException
* IOException
*/
public void processFile(final Configuration conf, final Path p)... | 3.26 |
hbase_CellCodec_readByteArray_rdh | /**
* Returns Byte array read from the stream. n
*/
private byte[] readByteArray(final InputStream in) throws IOException {
byte[] intArray = new byte[Bytes.SIZEOF_INT];
IOUtils.readFully(in, intArray);
int length = Bytes.toInt(intArray);
byte[] bytes = new byte[length];
IOUtils.readFully(in, by... | 3.26 |
hbase_CellCodec_write_rdh | /**
* 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
this.out.write(Bytes.toBytes(length));
this.out.write(bytes, offset, length);
} | 3.26 |
hbase_RSAnnotationReadingPriorityFunction_getDeadline_rdh | /**
* Based on the request content, returns the deadline of the request.
*
* @return Deadline of this request. 0 now, otherwise msec of 'delay'
*/
@Override
public long getDeadline(RequestHeader header, Message param) {
if (param instanceof ScanRequest) {
ScanRequest request = ((ScanRequest) (param));
if (!... | 3.26 |
hbase_DNS_getHostname_rdh | /**
* Get the configured hostname for a given ServerType. Gets the default hostname if not specified
* in the configuration.
*
* @param conf
* Configuration to look up.
* @param serverType
* ServerType to look up in the configuration for overrides.
*/
public static String getHostname(@NonNull
Configuration ... | 3.26 |
hbase_DNS_getDefaultHost_rdh | /**
* Wrapper around DNS.getDefaultHost(String, String), calling DNS.getDefaultHost(String, String,
* boolean) when available.
*
* @param strInterface
* The network interface to query.
* @param nameserver
* The DNS host name.
* @return The default host names associated with IPs bound to the network interfac... | 3.26 |
hbase_LruBlockCache_runEviction_rdh | /**
* Multi-threaded call to run the eviction process.
*/
private void runEviction() {
if ((evictionThread == null) ||
(!evictionThread.isGo()))
{evict();
} else {
evictionThread.evict();}
} | 3.26 |
hbase_LruBlockCache_m0_rdh | /**
* Get the buffer of the block with the specified name.
*
* @param cacheKey
* block's cache key
* @param caching
* true if the caller caches blocks on cache misses
* @param repeat
* Whether this is a repeat lookup for the same block (used to avoid
* double counting cache misses when doing double-che... | 3.26 |
hbase_LruBlockCache_getCachedFileNamesForTest_rdh | /**
* Used in testing. May be very inefficient.
*
* @return the set of cached file names
*/
SortedSet<String> getCachedFileNamesForTest() {
SortedSet<String> fileNames = new TreeSet<>();
for (BlockCacheKey cacheKey : map.keySet()) {
fileNames.add(cacheKey.getHfileName());
}
return fileNames; } | 3.26 |
hbase_LruBlockCache_evict_rdh | /**
* Eviction method.
*/ void evict() {
// Ensure only one eviction at a time
if (!evictionLock.tryLock()) {
return;
}
try {
evictionInProgress = true;
long currentSize = this.size.get();
long bytesToFree = currentSize - minSize();
if (LOG.isTraceEnabled()) {
LOG.trace((("Block cache LRU eviction started; Attempt... | 3.26 |
hbase_LruBlockCache_isEnteringRun_rdh | /**
* Used for the test.
*/
boolean isEnteringRun() {
return this.enteringRun;
} | 3.26 |
hbase_LruBlockCache_assertCounterSanity_rdh | /**
* Sanity-checking for parity between actual block cache content and metrics. Intended only for
* use with TRACE level logging and -ea JVM.
*/
private static void assertCounterSanity(long mapSize, long
counterVal) {
if (counterVal < 0) {
LOG.trace((("counterVal overflow. Assertions unreliable. counterVal=" + coun... | 3.26 |
hbase_LruBlockCache_updateSizeMetrics_rdh | /**
* Helper function that updates the local size counter and also updates any per-cf or
* per-blocktype metrics it can discern from given {@link LruCachedBlock}
*/
private long updateSizeMetrics(LruCachedBlock cb, boolean evict) {
long heapsize = cb.heapSize();
BlockType bt = cb.getBuffer().getBlockType();
if (evi... | 3.26 |
hbase_LruBlockCache_getStats_rdh | /**
* Get counter statistics for this cache.
* <p>
* Includes: total accesses, hits, misses, evicted blocks, and runs of the eviction processes.
*/
@Override
public CacheStats getStats() {
return this.stats;
} | 3.26 |
hbase_LruBlockCache_evictBlock_rdh | /**
* Evict the block, and it will be cached by the victim handler if exists && block may be
* read again later
*
* @param evictedByEvictionProcess
* true if the given block is evicted by EvictionThread
* @return the heap size of evicted block
*/
protected long evictBlock(LruCachedBlock block, boolea... | 3.26 |
hbase_LruBlockCache_acceptableSize_rdh | // Simple calculators of sizes given factors and maxSize
long acceptableSize() {
return ((long) (Math.floor(this.maxSize *
this.acceptableFactor)));
} | 3.26 |
hbase_LruBlockCache_clearCache_rdh | /**
* Clears the cache. Used in tests.
*/
public void clearCache() {
this.map.clear();
this.elements.set(0);
} | 3.26 |
hbase_LruBlockCache_evictBlocksByHfileName_rdh | /**
* Evicts all blocks for a specific HFile. This is an expensive operation implemented as a
* linear-time search through all blocks in the cache. Ideally this should be a search in a
* log-access-time map.
* <p>
* This is used for evict-on-close to remove all blocks of a specific HFile.
*
* @return the number ... | 3.26 |
hbase_LruBlockCache_cacheBlock_rdh | /**
* Cache the block with the specified name and buffer.
* <p>
* TODO after HBASE-22005, we may cache an block which allocated from off-heap, but our LRU cache
* sizing is based on heap size, so we should handle this in HBASE-22127. It will introduce an
* switch whether make the LRU on-heap or not, if so we may n... | 3.26 |
hbase_LruBlockCache_containsBlock_rdh | /**
* Whether the cache contains block with specified cacheKey
*
* @return true if contains the block
*/
@Override
public boolean containsBlock(BlockCacheKey cacheKey) {
return
map.containsKey(cacheKey);
} | 3.26 |
hbase_TableResource_getName_rdh | /**
* Returns the table name
*/
String getName() {
return table;
} | 3.26 |
hbase_TableResource_exists_rdh | /**
* Returns true if the table exists n
*/
boolean exists() throws IOException {
return servlet.getAdmin().tableExists(TableName.valueOf(table));
} | 3.26 |
hbase_BlockIOUtils_readFullyWithHeapBuffer_rdh | /**
* Copying bytes from InputStream to {@link ByteBuff} by using an temporary heap byte[] (default
* size is 1024 now).
*
* @param in
* the InputStream to read
* @param out
* the destination {@link ByteBuff}
* @param length
* to read
* @throws IOException
... | 3.26 |
hbase_BlockIOUtils_readFully_rdh | /**
* Read length bytes into ByteBuffers directly.
*
* @param buf
* the destination {@link ByteBuff}
* @param dis
* the HDFS input stream which implement the ByteBufferReadable interface.
* @param length
* bytes to read.
* @throws IOException
* exception to throw if any error happen
*/
public static ... | 3.26 |
hbase_BlockIOUtils_readWithExtraOnHeap_rdh | /**
* Read from an input stream at least <code>necessaryLen</code> and if possible,
* <code>extraLen</code> also if available. Analogous to
* {@link IOUtils#readFully(InputStream, byte[], int, int)}, but specifies a number of "extra"
* bytes to also optionally read.
*
* @param in
* the input stream to read fro... | 3.26 |
hbase_BlockIOUtils_annotateBytesRead_rdh | /**
* Conditionally annotate {@code attributesBuilder} with appropriate attributes when values are
* non-zero.
*/private static void annotateBytesRead(AttributesBuilder attributesBuilder, long directBytesRead, long heapBytesRead) {
if (directBytesRead > 0) {
attributesBuilder.put(DIRECT_BYTES_READ_KEY, directBy... | 3.26 |
hbase_BlockIOUtils_builderFromContext_rdh | /**
* Construct a fresh {@link AttributesBuilder} from the provided {@link Context}, populated with
* relevant attributes populated by {@link HFileContextAttributesBuilderConsumer#CONTEXT_KEY}.
*/private static AttributesBuilder builderFromContext(Context context) {final AttributesBuilder attributesBuilder = Attribu... | 3.26 |
hbase_BlockIOUtils_annotateHeapBytesRead_rdh | /**
* Conditionally annotate {@code span} with the appropriate attribute when value is non-zero.
*/
private static void annotateHeapBytesRead(AttributesBuilder attributesBuilder, int heapBytesRead) {
annotateBytesRead(attributesBuilder, 0, heapBytesRead);
} | 3.26 |
hbase_BlockIOUtils_preadWithExtra_rdh | /**
* Read from an input stream at least <code>necessaryLen</code> and if possible,
* <code>extraLen</code> also if available. Analogous to
* {@link IOUtils#readFully(InputStream, byte[], int, int)}, but uses positional read and
* specifies a number of "extra" bytes that would be desirable but not absolutely necess... | 3.26 |
hbase_NamespacesInstanceModel_toString_rdh | /* (non-Javadoc)
@see java.lang.Object#toString()
*/
@Override
public String toString() {
StringBuilder v1 = new StringBuilder();
v1.append("{NAME => '");
v1.append(namespaceName);v1.append("'");
if (properties != null) {
for (Map.Entry<String, String> entry : properties.entrySet()) {
v1.append(", ");
... | 3.26 |
hbase_NamespacesInstanceModel_getProperties_rdh | /**
* Returns The map of uncategorized namespace properties.
*/public Map<String, String> getProperties() {
if (properties == null) {
properties = new
HashMap<>();
}
return properties;
} | 3.26 |
hbase_NamespacesInstanceModel_addProperty_rdh | /**
* Add property to the namespace.
*
* @param key
* attribute name
* @param value
* attribute value
*/
public void addProperty(String key, String value) {
if (properties == null) {
properties = new HashMap<>();
}
properties.put(key, value);
} | 3.26 |
hbase_OutputSink_updateStatusWithMsg_rdh | /**
* Set status message in {@link MonitoredTask} instance that is set in this OutputSink
*
* @param msg
* message to update the status with
*/protected final void updateStatusWithMsg(String msg) {
if (status != null) {
status.setStatus(msg);
}
} | 3.26 |
hbase_OutputSink_finishWriterThreads_rdh | /**
* Wait for writer threads to dump all info to the sink
*
* @return true when there is no error
*/
boolean finishWriterThreads() throws IOException {
LOG.debug("Waiting for split writer threads to finish");
boolean progressFailed
= false;
for (WriterThread t : writerThreads) {
t.finish(... | 3.26 |
hbase_OutputSink_startWriterThreads_rdh | /**
* Start the threads that will pump data from the entryBuffers to the output files.
*/
void startWriterThreads() throws IOException {
for (int i = 0; i < numThreads; i++) {
WriterThread t = new WriterThread(controller, entryBuffers, this, i);
t.start();
writerThreads.add(t);
}
} | 3.26 |
hbase_ColumnRangeFilter_isMinColumnInclusive_rdh | /**
* Returns if min column range is inclusive.
*/
public boolean isMinColumnInclusive() {
return minColumnInclusive;
} | 3.26 |
hbase_ColumnRangeFilter_getMaxColumnInclusive_rdh | /**
* Returns true if max column is inclusive, false otherwise
*/
public boolean
getMaxColumnInclusive() {return this.maxColumnInclusive;
} | 3.26 |
hbase_ColumnRangeFilter_getMaxColumn_rdh | /**
* Returns the max column range for the filter
*/
public byte[] getMaxColumn() {
return this.maxColumn;
} | 3.26 |
hbase_ColumnRangeFilter_toByteArray_rdh | /**
* Returns The filter serialized using pb
*/
@Override
public byte[] toByteArray() {
FilterProtos.ColumnRangeFilter.Builder builder = FilterProtos.ColumnRangeFilter.newBuilder();
if (this.minColumn != null)
builder.setMinColumn(UnsafeByteOperations.unsafeWrap(this.minColumn));
builder.setMinCo... | 3.26 |
hbase_ColumnRangeFilter_areSerializedFieldsEqual_rdh | /**
* Returns 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 o) {if (o == this) { return true;
}
if (!(o instanceof ColumnRangeFilter)) {
return false;
}
Column... | 3.26 |
hbase_ColumnRangeFilter_getMinColumnInclusive_rdh | /**
* Returns true if min column is inclusive, false otherwise
*/
public boolean getMinColumnInclusive() {
return this.minColumnInclusive;
} | 3.26 |
hbase_ColumnRangeFilter_isMaxColumnInclusive_rdh | /**
* Returns if max column range is inclusive.
*/
public boolean isMaxColumnInclusive() {
return maxColumnInclusive;
} | 3.26 |
hbase_ColumnRangeFilter_parseFrom_rdh | /**
* Parse a serialized representation of {@link ColumnRangeFilter}
*
* @param pbBytes
* A pb serialized {@link ColumnRangeFilter} instance
* @return An instance of {@link ColumnRangeFilter} made from <code>bytes</code>
* @throws DeserializationException
* if an error occurre... | 3.26 |
hbase_ColumnRangeFilter_getMinColumn_rdh | /**
* Returns the min column range for the filter
*/
public byte[] getMinColumn() {
return this.minColumn;
} | 3.26 |
hbase_FixedLengthWrapper_getLength_rdh | /**
* Retrieve the maximum length (in bytes) of encoded values.
*/
public int getLength() {
return length;
} | 3.26 |
hbase_BackupAdminImpl_finalizeDelete_rdh | /**
* Updates incremental backup set for every backupRoot
*
* @param tablesMap
* map [backupRoot: {@code Set<TableName>}]
* @param table
* backup system table
* @throws IOException
* if a table operation fails
*/
private void finalizeDelete(Map<String, HashSet<TableName>> tablesMap, BackupSystemTable tab... | 3.26 |
hbase_BackupAdminImpl_deleteBackup_rdh | /**
* Delete single backup and all related backups <br>
* Algorithm:<br>
* Backup type: FULL or INCREMENTAL <br>
* Is this last backup session for table T: YES or NO <br>
* For every table T from table list 'tables':<br>
* if(FULL, YES) deletes only physical data (PD) <br>
* if(FULL, NO), deletes PD, scans all n... | 3.26 |
hbase_BackupAdminImpl_checkIfValidForMerge_rdh | /**
* Verifies that backup images are valid for merge.
* <ul>
* <li>All backups MUST be in the same destination
* <li>No FULL backups are allowed - only INCREMENTAL
* <li>All backups must be in COMPLETE state
* <li>No holes in backup list are allowed
* </ul>
* <p>
*
* @param backupIds
* list of backup ids
... | 3.26 |
hbase_BackupAdminImpl_cleanupBackupDir_rdh | /**
* Clean up the data at target directory
*
* @throws IOException
* if cleaning up the backup directory fails
*/
private void cleanupBackupDir(BackupInfo backupInfo, TableName table, Configuration conf) throws IOException {
try {
// clean up the data at target directory
String targetDir = backupInfo.g... | 3.26 |
hbase_SplitLogManagerCoordination_getServerName_rdh | /**
* Returns server name
*/
public ServerName getServerName() {return master.getServerName();
} | 3.26 |
hbase_SplitLogManagerCoordination_getMaster_rdh | /**
* Returns the master value
*/
public MasterServices getMaster() {
return master;
} | 3.26 |
hbase_SplitLogManagerCoordination_getFailedDeletions_rdh | /**
* Returns a set of failed deletions
*/
public Set<String> getFailedDeletions() {
return failedDeletions;
} | 3.26 |
hbase_SplitLogManagerCoordination_getTasks_rdh | /**
* Returns map of tasks
*/
public ConcurrentMap<String, Task> getTasks() {
return tasks;
} | 3.26 |
hbase_WALFactory_createStreamReader_rdh | /**
* Create a one-way stream reader for a given path.
*/
public static WALStreamReader createStreamReader(FileSystem fs, Path path, Configuration conf) throws IOException {
return createStreamReader(fs, path, conf, -1);
} | 3.26 |
hbase_WALFactory_m1_rdh | /**
* If you already have a WALFactory, you should favor the instance method. Uses defaults.
*
* @return a writer that won't overwrite files. Caller must close.
*/
public static Writer m1(final FileSystem fs, final Path path, final Configuration configuration) throws IOException {
return FSHLogProvider.createWriter... | 3.26 |
hbase_WALFactory_getAllWALProviders_rdh | /**
* Returns all the wal providers, for example, the default one, the one for hbase:meta and the one
* for hbase:replication.
*/
public List<WALProvider>
getAllWALProviders() {
List<WALProvider> providers = new ArrayList<>();
if (provider != null) {
providers.add(provider);
}
WALProvider v18 = metaProvider.getPr... | 3.26 |
hbase_WALFactory_createWALWriter_rdh | /**
* Create a writer for the WAL. Uses defaults.
* <p>
* Should be package-private. public only for tests and
* {@link org.apache.hadoop.hbase.regionserver.wal.Compressor}
*
* @return A WAL writer. Close when done with it.
*/
public Writer createWALWriter(final FileSystem fs, final Path path) throws IOExceptio... | 3.26 |
hbase_WALFactory_m0_rdh | /**
*
* @param region
* the region which we want to get a WAL for. Could be null.
*/
public WAL m0(RegionInfo region) throws IOException {
// Use different WAL for hbase:meta. Instantiates the meta WALProvider if not already up.
if ((region != null) && RegionReplicaUtil.isDefaultReplica(region)) {
if (region.isMe... | 3.26 |
hbase_WALFactory_createRecoveredEditsWriter_rdh | /**
* If you already have a WALFactory, you should favor the instance method. Uses defaults.
*
* @return a Writer that will overwrite files. Caller must close.
*/
static Writer createRecoveredEditsWriter(final FileSystem fs, final Path path, final Configuration configuration) throws IOException {
return FSHLogProv... | 3.26 |
hbase_WALFactory_getInstance_rdh | // Public only for FSHLog
public static WALFactory getInstance(Configuration configuration) {
WALFactory factory = singleton.get();
if (null == factory) {
WALFactory temp = new WALFactory(configuration);if (singleton.compareAndSet(null, temp)) {
factory = temp;
} else {
// someone else beat us to initializing
try {
... | 3.26 |
hbase_WALFactory_shutdown_rdh | /**
* Tell the underlying WAL providers to shut down, but do not clean up underlying storage. If you
* are not ending cleanly and will need to replay edits from this factory's wals, use this method
* if you can as it will try to leave things as tidy as possible.
*/
public void shutdown()
throws IOException {
Li... | 3.26 |
hbase_WALFactory_close_rdh | /**
* Shutdown all WALs and clean up any underlying storage. Use only when you will not need to
* replay and edits that have gone to any wals from this factory.
*/
public void close() throws IOException {
List<IOException> ioes = new ArrayList<>();
// these fields could be null if the WALFactory is created o... | 3.26 |
hbase_BigDecimalComparator_parseFrom_rdh | /**
* Parse a serialized representation of {@link BigDecimalComparator}
*
* @param pbBytes
* A pb serialized {@link BigDecimalComparator} instance
* @return An instance of {@link BigDecimalComparator} made from <code>bytes</code>
* @throws DeserializationException
* if an error occurred
* @see #toByteArray
... | 3.26 |
hbase_BigDecimalComparator_toByteArray_rdh | /**
* Returns The comparator serialized using pb
*/
@Override
public byte[] toByteArray() {
ComparatorProtos.BigDecimalComparator.Builder builder = ComparatorProtos.BigDecimalComparator.newBuilder();
builder.setComparable(ProtobufUtil.toByteArrayComparable(this.value));return builder.build().toByteArray();
} | 3.26 |
hbase_BigDecimalComparator_areSerializedFieldsEqual_rdh | /**
* Returns true if and only if the fields of the comparator that are serialized are equal to the
* corresponding fields in other. Used for testing.
*/
@SuppressWarnings("ReferenceEquality")
boolean areSerializedFieldsEqual(BigDecimalComparator other)
{
if (other == this) {
return true;
}
retur... | 3.26 |
hbase_RateLimiter_update_rdh | /**
* Sets the current instance of RateLimiter to a new values. if current limit is smaller than the
* new limit, bump up the available resources. Otherwise allow clients to use up the previously
* available resources.
*/
public synchronized void update(final RateLimiter other) {
this.tunit = other.tunit;
i... | 3.26 |
hbase_RateLimiter_waitInterval_rdh | /**
* Returns estimate of the ms required to wait before being able to provide "amount" resources.
*/
public synchronized long waitInterval(final long amount) {
// TODO Handle over quota?
return amount <= avail ? 0
: getWaitInterval(getLimit(), avail, amount);
} | 3.26 |
hbase_RateLimiter_set_rdh | /**
* Set the RateLimiter max available resources and refill period.
*
* @param limit
* The max value available resource units can be refilled to.
* @param timeUnit
* Timeunit factor for translating to ms.
*/
public synchronized void set(final long
limit, final TimeUnit timeUnit) {
switch (timeUnit) {
... | 3.26 |
hbase_RateLimiter_consume_rdh | /**
* consume amount available units, amount could be a negative number
*
* @param amount
* the number of units to consume
*/
public synchronized void consume(final long amount) {
if (isBypass()) {
return;
}
if (amount >= 0) {
this.avail -= amount;
} else if
(this.avail <= (Lo... | 3.26 |
hbase_RateLimiter_canExecute_rdh | /**
* Are there enough available resources to allow execution?
*
* @param amount
* the number of required resources, a non-negative number
* @return true if there are enough available resources, otherwise false
*/
public synchronized boolean canExecute(final long amount) {
if (isBypass()) {
return t... | 3.26 |
hbase_IndexOnlyLruBlockCache_cacheBlock_rdh | /**
* Cache only index block with the specified name and buffer
*
* @param cacheKey
* block's cache key
* @param buf
* block buffer
* @param inMemory
* if block is in-memory
*/
@Override
public void cacheBlock(BlockCacheKey cacheKey, Cacheable buf, boolean ... | 3.26 |
hbase_ZstdCodec_getBufferSize_rdh | // Package private
static int getBufferSize(Configuration conf) {
return conf.getInt(f0, // IO_COMPRESSION_CODEC_ZSTD_BUFFER_SIZE_DEFAULT is 0! We can't allow that.
conf.getInt(CommonConfigurationKeys.IO_COMPRESSION_CODEC_ZSTD_BUFFER_SIZE_KEY, ZSTD_BUFFER_SIZE_DEFAULT));} | 3.26 |
hbase_Pair_getSecond_rdh | /**
* Return the second element stored in the pair.
*/
public T2 getSecond() {
return f0;
} | 3.26 |
hbase_Pair_getFirst_rdh | /**
* Return the first element stored in the pair.
*/
public T1 getFirst() {
return first;
} | 3.26 |
hbase_Pair_setSecond_rdh | /**
* Replace the second element of the pair.
*
* @param b
* operand
*/public void setSecond(T2 b) {
this.second = b;
} | 3.26 |
hbase_MultipleColumnPrefixFilter_parseFrom_rdh | /**
* Parse a serialized representation of {@link MultipleColumnPrefixFilter}
*
* @param pbBytes
* A pb serialized {@link MultipleColumnPrefixFilter} instance
* @return An instance of {@link MultipleColumnPrefixFilter} made from <code>bytes</code>
* @throws DeserializationException
* if an error occurred
* ... | 3.26 |
hbase_MultipleColumnPrefixFilter_toByteArray_rdh | /**
* Returns The filter serialized using pb
*/
@Override
public byte[] toByteArray() {
FilterProtos.MultipleColumnPrefixFilter.Builder builder = FilterProtos.MultipleColumnPrefixFilter.newBuilder();
for (byte[]
element : sortedPrefixes)
{if (element != null)
builder.addSortedPrefixes(Un... | 3.26 |
hbase_MultipleColumnPrefixFilter_areSerializedFieldsEqual_rdh | /**
* Returns 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 o) {
if (o == this) {
return true;
}
if (!(o instanceof MultipleColumnPrefixFilter)) {
return... | 3.26 |
hbase_ZooKeeperHelper_ensureConnectedZooKeeper_rdh | /**
* Ensure passed zookeeper is connected.
*
* @param timeout
* Time to wait on established Connection
*/
public static ZooKeeper ensureConnectedZooKeeper(ZooKeeper zookeeper, int timeout) throws ZooKeeperConnectionException {
if (zookeeper.getState().isConnected()) {
return zookeeper;
}
Sto... | 3.26 |
hbase_ZooKeeperHelper_getConnectedZooKeeper_rdh | /**
* Get a ZooKeeper instance and wait until it connected before returning.
*
* @param sessionTimeoutMs
* Used as session timeout passed to the created ZooKeeper AND as the
* timeout to wait on connection establishment.
*/public static ZooKeeper getConnectedZooKeeper(String connectString, int sessionTimeoutM... | 3.26 |
hbase_StochasticLoadBalancer_createRegionPlans_rdh | /**
* Create all of the RegionPlan's needed to move from the initial cluster state to the desired
* state.
*
* @param cluster
* The state of the cluster
* @return List of RegionPlan's that represent the moves needed to get to desired final state.
*/
private List<RegionPlan> createRegionPlans(BalancerClusterSta... | 3.26 |
hbase_StochasticLoadBalancer_getRandomGenerator_rdh | /**
* Select the candidate generator to use based on the cost of cost functions. The chance of
* selecting a candidate generator is propotional to the share of cost of all cost functions among
* all cost functions that benefit from it.
*/
protected CandidateGenerator getRandomGenerator() {double sum = 0;
for (i... | 3.26 |
hbase_StochasticLoadBalancer_updateCostsAndWeightsWithAction_rdh | /**
* Update both the costs of costfunctions and the weights of candidate generators
*/
@RestrictedApi(explanation = "Should only be called in tests", link = "", allowedOnPath = ".*(/src/test/.*|StochasticLoadBalancer).java")
void updateCostsAndWeightsWithAction(BalancerClusterState cluster, BalanceAction action) {//... | 3.26 |
hbase_StochasticLoadBalancer_updateMetricsSize_rdh | /**
* Update the number of metrics that are reported to JMX
*/
@RestrictedApi(explanation = "Should only be called in tests", link = "", allowedOnPath = ".*(/src/test/.*|StochasticLoadBalancer).java")
void updateMetricsSize(int size) {
if (metricsBalancer instanceof MetricsStochasticBalancer) {
((MetricsStochasti... | 3.26 |
hbase_StochasticLoadBalancer_getCostFunctionNames_rdh | /**
* Get the names of the cost functions
*/
@RestrictedApi(explanation = "Should only be called in tests", link = "", allowedOnPath = ".*(/src/test/.*|StochasticLoadBalancer).java")
String[] getCostFunctionNames() {
String[] v66 = new String[costFunctions.size()];
for (int i = 0; i < costFunctions.size(); i+... | 3.26 |
hbase_StochasticLoadBalancer_updateStochasticCosts_rdh | /**
* update costs to JMX
*/
private void updateStochasticCosts(TableName tableName, double overall, double[] subCosts) {
if (tableName == null) {
return;}
// check if the metricsBalancer is MetricsStochasticBalancer before casting
if (metricsBalancer instanceof MetricsStochasticBalancer) {
... | 3.26 |
hbase_StochasticLoadBalancer_composeAttributeName_rdh | /**
* A helper function to compose the attribute name from tablename and costfunction name
*/
static String composeAttributeName(String tableName, String costFunctionName) {
return (tableName + TABLE_FUNCTION_SEP) + costFunctionName;
} | 3.26 |
hbase_EncodedDataBlock_getCompressedSize_rdh | /**
* Find the size of compressed data assuming that buffer will be compressed using given algorithm.
*
* @param algo
* compression algorithm
* @param compressor
* compressor already requested from codec
* @param inputBuffer
* Array to be compressed.
* @param offset
* Offset to beginning of the data.
... | 3.26 |
hbase_EncodedDataBlock_encodeData_rdh | /**
* Do the encoding, but do not cache the encoded data.
*
* @return encoded data block with header and checksum
*/
public byte[] encodeData() {
ByteArrayOutputStream baos = new ByteArrayOutputStream();
byte[] baosBytes = null;
try {
baos.write(HConstants.HFILEBLOCK_DUMMY_HEADER);
DataO... | 3.26 |
hbase_EncodedDataBlock_getEncodedCompressedSize_rdh | /**
* Estimate size after second stage of compression (e.g. LZO).
*
* @param comprAlgo
* compression algorithm to be used for compression
* @param compressor
* compressor corresponding to the given compression algorithm
* @return Size after second stage of compression.
*/
public int getEncodedCompressedSize... | 3.26 |
hbase_EncodedDataBlock_getIterator_rdh | /**
* Provides access to compressed value.
*
* @param headerSize
* header size of the block.
* @return Forwards sequential iterator.
*/public Iterator<Cell> getIterator(int headerSize) {
final int rawSize = rawKVs.length;
byte[] encodedDataWithHeader = getEncodedData();
int bytesToSkip = headerSize ... | 3.26 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.