name stringlengths 12 178 | code_snippet stringlengths 8 36.5k | score float64 3.26 3.68 |
|---|---|---|
hbase_LocalHBaseCluster_getConfiguration_rdh | /**
* Returns the Configuration used by this LocalHBaseCluster
*/
public Configuration getConfiguration() {
return this.conf;
} | 3.26 |
hbase_LocalHBaseCluster_waitOnMaster_rdh | /**
* Wait for the specified master to stop. Removes this thread from list of running threads.
*
* @return Name of master that just went down.
*/
public String waitOnMaster(JVMClusterUtil.MasterThread masterThread) {
boolean interrupted = false;
while (masterThread.isAlive()) {
try {
LOG... | 3.26 |
hbase_LocalHBaseCluster_main_rdh | /**
* Test things basically work.
*/
public static void main(String[] args) throws IOException {
Configuration conf = HBaseConfiguration.create();
LocalHBaseCluster cluster = new LocalHBaseCluster(conf);
cluster.startup();
try (Connection connection = ConnectionFactory.createConnection(conf);Admin adm... | 3.26 |
hbase_LocalHBaseCluster_waitOnRegionServer_rdh | /**
* Wait for the specified region server to stop. Removes this thread from list of running threads.
*
* @return Name of region server that just went down.
*/
public String waitOnRegionServer(JVM... | 3.26 |
hbase_NettyServerCall_sendResponseIfReady_rdh | /**
* If we have a response, and delay is not set, then respond immediately. Otherwise, do not
* respond to client. This is called by the RPC code in the context of the Handler thread.
*/
@Override
public synchronized void sendResponseIfReady() throws IOException {
// set param null to reduce memory pressure
... | 3.26 |
hbase_MasterDDLOperationHelper_deleteColumnFamilyFromFileSystem_rdh | /**
* Remove the column family from the file system
*/
public static void
deleteColumnFamilyFromFileSystem(final MasterProcedureEnv env, final TableName tableName, final List<RegionInfo> regionInfoList, final byte[] familyName, final boolean hasMob) throws IOException {
final MasterFileSystem mfs = env.getMaste... | 3.26 |
hbase_AsyncRpcRetryingCallerFactory_start_rdh | /**
* Short cut for {@code build().start(HBaseRpcController, ScanResponse)}.
*/
public CompletableFuture<Boolean> start(HBaseRpcController controller, ScanResponse respWhenOpen) {
return build().start(controller, respWhenOpen);
} | 3.26 |
hbase_AsyncRpcRetryingCallerFactory_call_rdh | /**
* Shortcut for {@code build().call()}
*/
public CompletableFuture<T> call() {
return build().call(); } | 3.26 |
hbase_AsyncRpcRetryingCallerFactory_single_rdh | /**
* Create retry caller for single action, such as get, put, delete, etc.
*/public <T> SingleRequestCallerBuilder<T>
single() {
return new SingleRequestCallerBuilder<>();
} | 3.26 |
hbase_AsyncRpcRetryingCallerFactory_scanSingleRegion_rdh | /**
* Create retry caller for scanning a region.
*/
public ScanSingleRegionCallerBuilder scanSingleRegion() {return new ScanSingleRegionCallerBuilder();
} | 3.26 |
hbase_WALEntryBatch_getNbOperations_rdh | /**
* Returns total number of operations in this batch
*/
public int getNbOperations() {
return getNbRowKeys() + getNbHFiles();
} | 3.26 |
hbase_WALEntryBatch_getNbHFiles_rdh | /**
* Returns the number of HFiles in this batch
*/
public int getNbHFiles() {
return nbHFiles;
} | 3.26 |
hbase_WALEntryBatch_getLastSeqIds_rdh | /**
* Returns the last sequenceid for each region if the table has serial-replication scope
*/
public Map<String, Long> getLastSeqIds() {
return lastSeqIds;
} | 3.26 |
hbase_WALEntryBatch_getHeapSize_rdh | /**
* Returns the heap size of this batch
*/
public long getHeapSize() {
return heapSize;
} | 3.26 |
hbase_WALEntryBatch_getLastWalPosition_rdh | /**
* Returns the position in the last WAL that was read.
*/
public long getLastWalPosition() {
return lastWalPosition;
} | 3.26 |
hbase_WALEntryBatch_getWalEntries_rdh | /**
* Returns the WAL Entries.
*/
public List<Entry> getWalEntries() {
return walEntriesWithSize.stream().map(Pair::getFirst).collect(Collectors.toList());
} | 3.26 |
hbase_WALEntryBatch_getWalEntriesWithSize_rdh | /**
* Returns the WAL Entries.
*/
public List<Pair<Entry, Long>> getWalEntriesWithSize() {
return walEntriesWithSize;
} | 3.26 |
hbase_WALEntryBatch_getLastWalPath_rdh | /**
* Returns the path of the last WAL that was read.
*/ public Path getLastWalPath() {
return lastWalPath;
} | 3.26 |
hbase_MultiResponse_m0_rdh | /**
* Returns Number of pairs in this container
*/
public int m0() {
int size = 0;
for (RegionResult v1 : results.values()) { size += v1.size();
}
return size;
} | 3.26 |
hbase_MultiResponse_add_rdh | /**
* Add the pair to the container, grouped by the regionName.
*/
public void add(byte[] regionName, int originalIndex,
Object resOrEx) {
getResult(regionName).addResult(originalIndex, resOrEx);
} | 3.26 |
hbase_MultiResponse_getException_rdh | /**
* Returns the exception for the region, if any. Null otherwise.
*/
public Throwable getException(byte[] regionName) {
return exceptions.get(regionName);
} | 3.26 |
hbase_ZKDump_getReplicationZnodesDump_rdh | /**
* Appends replication znodes to the passed StringBuilder.
*
* @param zkw
* reference to the {@link ZKWatcher} which also contains configuration and operation
* @param sb
* the {@link StringBuilder} to append to
* @throws KeeperException
* if a ZooKeeper operation fails
*/
private static void getRepli... | 3.26 |
hbase_ZKDump_getServerStats_rdh | /**
* Gets the statistics from the given server.
*
* @param server
* The server to get the statistics from.
* @param timeout
* The socket timeout to use.
* @return The array of response strings.
* @throws IOException
* When the socket communication fails.
*/
private static String[] getServerStats(String... | 3.26 |
hbase_Branch1CoprocessorMethods_addMethods_rdh | /* This list of methods was generated from HBase 1.4.4. */
private void addMethods() {
/* BulkLoadObserver */
addMethod("prePrepareBulkLoad", "org.apache.hadoop.hbase.coprocessor.ObserverContext", "org.apache.hadoop.hbase.protobuf.generated.SecureBulkLoadProtos.PrepareBulkLoadRequest");
addMethod("preCleanu... | 3.26 |
hbase_Cluster_isEmpty_rdh | /**
* Returns true if no locations have been added, false otherwise
*/
public boolean isEmpty()
{
return nodes.isEmpty();
} | 3.26 |
hbase_Cluster_remove_rdh | /**
* Remove a node from the cluster
*
* @param name
* host name
* @param port
* service port
*/
public Cluster remove(String name, int port) {
StringBuilder sb = new StringBuilder();
sb.append(name);
sb.append(':');
sb.append(port);
return remove(sb.toString());
} | 3.26 |
hbase_Cluster_add_rdh | /**
* Add a node to the cluster
*
* @param name
* host name
* @param port
* service port
*/
public Cluster add(String name, int port) { StringBuilder sb = new StringBuilder();
sb.append(name);
sb.append(':');
sb.append(port);
return add(sb.toString());
} | 3.26 |
hbase_BaseEnvironment_startup_rdh | /**
* Initialize the environment
*/
public void startup() throws IOException {
if ((state == State.INSTALLED)
|| (state == State.STOPPED)) {
state = State.STARTING;
Thread currentThread = Thread.currentThread();
ClassLoader hostClassLoader =
currentThread.getContextClassLoader(... | 3.26 |
hbase_BaseEnvironment_getHBaseVersion_rdh | /**
* Returns the HBase release
*/
@Override
public String getHBaseVersion() {
return VersionInfo.getVersion();
} | 3.26 |
hbase_BaseEnvironment_getVersion_rdh | /**
* Returns the coprocessor environment version
*/
@Override
public int getVersion() {
return Coprocessor.VERSION;
} | 3.26 |
hbase_ReflectionUtils_printThreadInfo_rdh | /**
* Print all of the thread's information and stack traces.
*
* @param stream
* the stream to
* @param title
* a string title for the stack trace
*/
static void printThreadInfo(PrintStream stream, String title) {final int STACK_DEPTH = 20;
boolean contention = threadBean.isThreadContentionMonitoringEna... | 3.26 |
hbase_ReflectionUtils_logThreadInfo_rdh | /**
* Log the current thread stacks at INFO level.
*
* @param log
* the logger that logs the stack trace
* @param title
* a descriptive title for the call stacks
* @param minInterval
* the minimum time from the last
*/
public static void logThreadInfo(Logger log, String title, long minInterval) {
boo... | 3.26 |
hbase_ReflectionUtils_invokeMethod_rdh | /**
* Get and invoke the target method from the given object with given parameters
*
* @param obj
* the object to get and invoke method from
* @param methodName
* the name of the method to invoke
* @param params
* the parameters for the method to invoke
* @return the return value of the method invocation... | 3.26 |
hbase_ReflectionUtils_getOneArgStaticMethodAsFunction_rdh | /**
* Creates a Function which can be called to performantly execute a reflected static method. The
* creation of the Function itself may not be fast, but executing that method thereafter should be
* much faster than {@link #invokeMethod(Object, String, Object...)}.
*
* @param lookupClazz
* the class to find th... | 3.26 |
hbase_RetryCounter_sleepUntilNextRetry_rdh | /**
* Sleep for a back off time as supplied by the backoff policy, and increases the attempts
*/
public void sleepUntilNextRetry() throws InterruptedException {int attempts = getAttemptTimes();
long
sleepTime = getBackoffTime();
LOG.trace("Sleeping {} ms before retry #{}...", sleepTime, attempts);
ret... | 3.26 |
hbase_KeyValueTestUtil_containsIgnoreMvccVersion_rdh | /**
* Checks whether KeyValues from kvCollection2 are contained in kvCollection1. The comparison is
* made without distinguishing MVCC version of the KeyValues
*
* @return true if KeyValues from kvCollection2 are contained in kvCollection1
*/
public static boolean containsIgnoreMvccVe... | 3.26 |
hbase_KeyValueTestUtil_toStringWithPadding_rdh | /**
* ******************* toString ***********************************
*/public static String toStringWithPadding(final Collection<? extends KeyValue> kvs, final boolean includeMeta) {
int maxRowStringLength = 0;
int maxFamilyStringLength = 0;
int maxQualifierStringLength = 0;
int maxTimestampLengt... | 3.26 |
hbase_SizeCachedByteBufferKeyValue_getSerializedSize_rdh | /**
* Override by just returning the length for saving cost of method dispatching. If not, it will
* call {@link ExtendedCell#getSerializedSize()} firstly, then forward to
* {@link SizeCachedKeyValue#getSerializedSize(boolean)}. (See HBASE-21657)
*/
@Override
public int getSerializedSize() {return this.length; } | 3.26 |
hbase_CatalogFamilyFormat_isMergeQualifierPrefix_rdh | /**
* Returns True if the column in <code>cell</code> matches the regex 'info:merge.*'.
*/
public static boolean isMergeQualifierPrefix(Cell cell)
{
// Check to see if has family and that qualifier starts with the merge qualifier 'merge'
return CellUtil.matchingFamily(cell, HConstants.CATALOG_FAMILY) && Priva... | 3.26 |
hbase_CatalogFamilyFormat_getMergeRegions_rdh | /**
* Returns Deserialized regioninfo values taken from column values that match the regex
* 'info:merge.*' in array of <code>cells</code>.
*/
@Nullable
public static List<RegionInfo> getMergeRegions(Cell[] cells) {
Map<String, RegionInfo> mergeRegionsWithName = getMergeRegionsWithName(cells);
return mergeRe... | 3.26 |
hbase_CatalogFamilyFormat_getRegionInfo_rdh | /**
* Returns RegionInfo object from the column
* HConstants.CATALOG_FAMILY:HConstants.REGIONINFO_QUALIFIER of the catalog table Result.
*
* @param data
* a Result object from the catalog table scan
* @return RegionInfo or null
*/
public static RegionInfo getRegionInfo(Result data) {
return getRegionInfo(d... | 3.26 |
hbase_CatalogFamilyFormat_getTableState_rdh | /**
* Decode table state from META Result. Should contain cell from HConstants.TABLE_FAMILY
*
* @return null if not found
*/
@Nullable
public static TableState getTableState(Result r) throws IOException {
Cell cel... | 3.26 |
hbase_CatalogFamilyFormat_parseRegionInfoFromRegionName_rdh | /**
* Returns an HRI parsed from this regionName. Not all the fields of the HRI is stored in the
* name, so the returned object should only be used for the fields in the regionName.
* <p/>
* Since the returned object does not contain all the fields, we do not expose this method in
* public API, such as {@link Regi... | 3.26 |
hbase_CatalogFamilyFormat_getMetaKeyForRegion_rdh | /**
* Returns the row key to use for this regionInfo
*/
public static byte[] getMetaKeyForRegion(RegionInfo regionInfo) {
return RegionReplicaUtil.getRegionInfoForDefaultReplica(regionInfo).getRegionName();
} | 3.26 |
hbase_CatalogFamilyFormat_getRegionStateColumn_rdh | /**
* Returns the column qualifier for serialized region state
*
* @param replicaId
* the replicaId of the region
* @return a byte[] for state qualifier
*/
public static byte[] getRegionStateColumn(int replicaId) {
... | 3.26 |
hbase_CatalogFamilyFormat_hasMergeRegions_rdh | /**
* Returns True if any merge regions present in <code>cells</code>; i.e. the column in
* <code>cell</code> matches the regex 'info:merge.*'.
*/
public static boolean hasMergeRegions(Cell[] cells) {
for (Cell v29 : cells) {
if (isMergeQualifierPrefix(v29)) {
return true;
}
}
... | 3.26 |
hbase_CatalogFamilyFormat_getServerName_rdh | /**
* Returns a {@link ServerName} from catalog table {@link Result}.
*
* @param r
* Result to pull from
* @return A ServerName instance or null if necessary fields not found or empty.
*/
@Nullable
public static ServerName getServerName(Result r, int replicaId) {
byte[] serverColumn = m0(replicaId);
Cel... | 3.26 |
hbase_CatalogFamilyFormat_getServerNameColumn_rdh | /**
* Returns the column qualifier for serialized region state
*
* @param replicaId
* the replicaId of the region
* @return a byte[] for sn column qualifier
*/
public static byte[] getServerNameColumn(int replicaId) {
return replicaId == 0 ? HConstants.SERVERNAME_QUALIFIER : Bytes.toBytes((HConstants.SERVER... | 3.26 |
hbase_CatalogFamilyFormat_getStartCodeColumn_rdh | /**
* Returns the column qualifier for server start code column for replicaId
*
* @param replicaId
* the replicaId of the region
* @return a byte[] for server start code column qualifier
*/
public static byte[] getStartCodeColumn(int replicaId) {
return
replicaId == 0 ? HConstants.STARTCODE_QUALIFIER : ... | 3.26 |
hbase_CatalogFamilyFormat_getRegionLocation_rdh | /**
* Returns the HRegionLocation parsed from the given meta row Result for the given regionInfo and
* replicaId. The regionInfo can be the default region info for the replica.
*
* @param r
* the meta row result
* @param regionInfo
* RegionInfo for default replica
* @param replicaId
* the replicaId for t... | 3.26 |
hbase_CatalogFamilyFormat_m0_rdh | /**
* Returns the column qualifier for server column for replicaId
*
* @param replicaId
* the replicaId of the region
* @return a byte[] for server column qualifier
*/
public static byte[] m0(int replicaId) {
return replicaId == 0 ? HConstants.SERVER_QUALIFIER : Bytes.toBytes((HConstants.SERVER_QUALIFIER_... | 3.26 |
hbase_CatalogFamilyFormat_getSeqNumDuringOpen_rdh | /**
* The latest seqnum that the server writing to meta observed when opening the region. E.g. the
* seqNum when the result of {@link getServerName} was written.
*
* @param r
* Result to pull the seqNum from
* @return SeqNum, or HConstants.NO_SEQNUM if there's no value written.
*/
private static long getSeqNum... | 3.26 |
hbase_CatalogFamilyFormat_parseReplicaIdFromServerColumn_rdh | /**
* Parses the replicaId from the server column qualifier. See top of the class javadoc for the
* actual meta layout
*
* @param serverColumn
* the column qualifier
* @return an int for the replicaId
*/
static int parseReplicaIdFromServerColumn(byte[] serverColumn) {
String serverStr = Bytes.toString(serv... | 3.26 |
hbase_CatalogFamilyFormat_getSeqNumColumn_rdh | /**
* Returns the column qualifier for seqNum column for replicaId
*
* @param replicaId
* the replicaId of the region
* @return a byte[] for seqNum column qualifier
*/
public static byte[] getSeqNumColumn(int replicaId) {
return replicaId == 0 ? HConstants.SEQNUM_QUALIFIER : Bytes.toBytes((HConstants.SEQNUM... | 3.26 |
hbase_CatalogFamilyFormat_getMergeRegionsWithName_rdh | /**
* Returns Deserialized values of <qualifier,regioninfo> pairs taken from column values that
* match the regex 'info:merge.*' in array of <code>cells</code>.
*/@Nullable
public static Map<String, RegionInfo> getMergeRegionsWithName(Cell[] cells) {
if (cells == null) {
return null;
}Map<Str... | 3.26 |
hbase_InnerStoreCellComparator_getInnerStoreCellComparator_rdh | /**
* Utility method that makes a guess at comparator to use based off passed tableName. Use in
* extreme when no comparator specified.
*
* @return CellComparator to use going off the {@code tableName} passed.
*/
public static CellComparator getInnerStoreCellComparator(byte[] tableName) {
return Bytes.equals(t... | 3.26 |
hbase_VersionInfo_getSrcChecksum_rdh | /**
* Get the checksum of the source files from which Hadoop was compiled.
*
* @return a string that uniquely identifies the source
*/
public static String getSrcChecksum() {
return Version.srcChecksum;
} | 3.26 |
hbase_VersionInfo_getVersion_rdh | /**
* Get the hbase version.
*
* @return the hbase version string, eg. "0.6.3-dev"
*/
public static String getVersion() {
return
Version.version;
} | 3.26 |
hbase_VersionInfo_getUser_rdh | /**
* The user that compiled hbase.
*
* @return the username of the user
*/
public static String getUser() {
return Version.user;
} | 3.26 |
hbase_VersionInfo_getDate_rdh | /**
* The date that hbase was compiled.
*
* @return the compilation date in unix date format
*/
public static String getDate() {
return Version.date;
} | 3.26 |
hbase_VersionInfo_getRevision_rdh | /**
* Get the subversion revision number for the root directory
*
* @return the revision number, eg. "451451"
*/
public static String getRevision() {
return Version.revision;
} | 3.26 |
hbase_VersionInfo_getUrl_rdh | /**
* Get the subversion URL for the root hbase directory.
*
* @return the url
*/
public static String getUrl() {
return Version.url;
} | 3.26 |
hbase_VersionInfo_getVersionComponents_rdh | /**
* Returns the version components as String objects Examples: "1.4.3" returns ["1", "4", "3"],
* "4.5.6-SNAPSHOT" returns ["4", "5", "6", "-1"] "4.5.6-beta" returns ["4", "5", "6", "-2"],
* "4.5.6-alpha" returns ["4", "5", "6", "-3"] "4.5.6-UNKNOW" returns ["4", "5", "6", "-4"]
*
* @return the components of the... | 3.26 |
hbase_CacheConfig_isInMemory_rdh | /**
* Returns true if blocks in this file should be flagged as in-memory
*/
public boolean isInMemory() {
return this.inMemory;
} | 3.26 |
hbase_CacheConfig_enableCacheOnWrite_rdh | /**
* Enable cache on write including: cacheDataOnWrite cacheIndexesOnWrite cacheBloomsOnWrite
*/
public void enableCacheOnWrite() {
this.cacheDataOnWrite = true;
this.cacheIndexesOnWrite = true;
this.cacheBloomsOnWrite = true;
} | 3.26 |
hbase_CacheConfig_shouldCacheCompressed_rdh | /**
* Returns true if this {@link BlockCategory} should be compressed in blockcache, false otherwise
*/
public boolean shouldCacheCompressed(BlockCategory category) {
switch (category) {
case DATA :
return this.cacheDataOnRead && this.cacheDataCompressed;
default :
return f... | 3.26 |
hbase_CacheConfig_shouldCacheDataOnRead_rdh | /**
* Returns whether the DATA blocks of this HFile should be cached on read or not (we always cache
* the meta blocks, the INDEX and BLOOM blocks).
*
* @return true if blocks should be cached on read, false if not
*/
public boolean shouldCacheDataOnRead() {
return
cacheDataOnRead;
} | 3.26 |
hbase_CacheConfig_setCacheDataOnWrite_rdh | /**
*
* @param cacheDataOnWrite
* whether data blocks should be written to the cache when an HFile is
* written
*/
public void setCacheDataOnWrite(boolean cacheDataOnWrite) {
this.cacheDataOnWrite = cacheDataOnWrite;
} | 3.26 |
hbase_CacheConfig_getCacheCompactedBlocksOnWriteThreshold_rdh | /**
* Returns total file size in bytes threshold for caching while writing during compaction
*/
public long getCacheCompactedBlocksOnWriteThreshold() {return this.cacheCompactedDataOnWriteThreshold;
} | 3.26 |
hbase_CacheConfig_shouldReadBlockFromCache_rdh | /**
* Return true if we may find this type of block in block cache.
* <p>
* TODO: today {@code family.isBlockCacheEnabled()} only means {@code cacheDataOnRead}, so here we
* consider lots of other configurations such as {@code cacheDataOnWrite}. We should fix this in
* the future, {@code cacheDataOnWrite} should h... | 3.26 |
hbase_CacheConfig_setEvictOnClose_rdh | /**
* Only used for testing.
*
* @param evictOnClose
* whether blocks should be evicted from the cache when an HFile reader is
* closed
*/
public void setEvictOnClose(boolean evictOnClose) {this.evictOnClose = evictOnClose;
} | 3.26 |
hbase_CacheConfig_m0_rdh | /**
* Should we cache a block of a particular category? We always cache important blocks such as
* index blocks, as long as the block cache is available.
*/
public boolean m0(BlockCategory category) {
return ((cacheDataOnRead || (category == BlockCategory.INDEX)) || (category == BlockCategory.BLOOM)) || (prefetc... | 3.26 |
hbase_CacheConfig_shouldCacheDataCompressed_rdh | /**
* Returns true if data blocks should be compressed in the cache, false if not
*/
public boolean shouldCacheDataCompressed() {
return this.cacheDataOnRead && this.cacheDataCompressed;
} | 3.26 |
hbase_CacheConfig_shouldPrefetchOnOpen_rdh | /**
* Returns true if blocks should be prefetched into the cache on open, false if not
*/
public boolean shouldPrefetchOnOpen() {
return this.prefetchOnOpen;
} | 3.26 |
hbase_CacheConfig_getBlockCache_rdh | /**
* Returns the block cache.
*
* @return the block cache, or null if caching is completely disabled
*/
public Optional<BlockCache> getBlockCache() {
return Optional.ofNullable(this.blockCache);
} | 3.26 |
hbase_CacheConfig_shouldCacheCompactedBlocksOnWrite_rdh | /**
* Returns true if blocks should be cached while writing during compaction, false if not
*/
public boolean shouldCacheCompactedBlocksOnWrite() {
return this.cacheCompactedDataOnWrite;
} | 3.26 |
hbase_FullTableBackupClient_execute_rdh | /**
* Backup request execution.
*
* @throws IOException
* if the execution of the backup fails
*/
@Override
public void execute() throws IOException {try (Admin admin = conn.getAdmin()) {
// Begin BACKUP
beginBackup(backupManager, backupInfo);
String savedStartCode;
boolean fi... | 3.26 |
hbase_FullTableBackupClient_snapshotCopy_rdh | /**
* Do snapshot copy.
*
* @param backupInfo
* backup info
* @throws Exception
* exception
*/
protected void snapshotCopy(BackupInfo backupInfo) throws Exception {
f0.info("Snapshot copy is starting.");
// set overall backup phase: snapshot_copy
backupInfo.setPhase(BackupPhase.SNAPSHOTCOPY);
... | 3.26 |
hbase_KeyValue_getTypeByte_rdh | /**
* Return the KeyValue.TYPE byte representation
*/
byte getTypeByte(int keyLength) {return this.bytes[((this.offset + keyLength)
- 1) + ROW_OFFSET];
} | 3.26 |
hbase_KeyValue_toString_rdh | // ---------------------------------------------------------------------------
//
// String representation
//
// ---------------------------------------------------------------------------
@Override
public String
toString() {
if ((this.bytes == null) || (this.bytes.length == 0)) {
return "empty";
} r... | 3.26 |
hbase_KeyValue_getSequenceId_rdh | /**
* Here be dragons *
*/
/**
* used to achieve atomic operations in the memstore.
*/
@Override
public long getSequenceId() {
return seqId;
} | 3.26 |
hbase_KeyValue_getDelimiterInReverse_rdh | /**
* Find index of passed delimiter walking from end of buffer backwards.
*
* @param b
* the kv serialized byte[] to process
* @param offset
* the offset in the byte[]
* @param length
* the length in the byte[]
* @param delimiter
* input delimeter to fetch index from end
* @return Index of delimiter... | 3.26 |
hbase_KeyValue_getKeyOffset_rdh | /**
* Returns Key offset in backing buffer..
*/
public int getKeyOffset() {
return this.offset + ROW_OFFSET;
} | 3.26 |
hbase_KeyValue_isValidType_rdh | /**
* True to indicate that the byte b is a valid type.
*
* @param b
* byte to check
* @return true or false
*/static boolean isValidType(byte b) {
return codeArray[b & 0xff] != null;
} | 3.26 |
hbase_KeyValue_getQualifierLength_rdh | /**
* Returns Qualifier length
*/
int getQualifierLength(int keyLength, int rlength, int flength) {
return keyLength - ((int) (getKeyDataStructureSize(rlength, flength, 0)));
} | 3.26 |
hbase_KeyValue_isLatestTimestamp_rdh | /**
* Returns True if this KeyValue has a LATEST_TIMESTAMP timestamp.
*/
public boolean isLatestTimestamp() {
return Bytes.equals(getBuffer(), getTimestampOffset(), Bytes.SIZEOF_LONG, HConstants.LATEST_TIMESTAMP_BYTES, 0, Bytes.SIZEOF_LONG);
} | 3.26 |
hbase_KeyValue_createByteArray_rdh | /**
*
* @param qualifier
* can be a ByteBuffer or a byte[], or null.
* @param value
* can be a ByteBuffer or a byte[], or null.
*/
private static byte[] createByteArray(final byte[] row, final int roffset, final int rlength, final byte[] family, final int foffset, int flength,... | 3.26 |
hbase_KeyValue_m4_rdh | /**
* Update the timestamp.
*
* @param now
* Time to set into <code>this</code> IFF timestamp ==
* {@link HConstants#LATEST_TIMESTAMP} (else, its a noop).
* @return True is we modified this.
*/
public boolean m4(final byte[] now) {if (this.isLatestTimestamp()) {
int tsOffset = getTimestampOffset();
System.ar... | 3.26 |
hbase_KeyValue_compareFlatKey_rdh | /**
* Compares left to right assuming that left,loffset,llength and right,roffset,rlength are full
* KVs laid out in a flat byte[]s.
*
* @param left
* the left kv serialized byte[] to be compared with
* @param loffset
* the offset in the left byte[]
* @param llength
* the length in the left byte[]
* @pa... | 3.26 |
hbase_KeyValue_matchingRowColumn_rdh | /**
* Compares the row and column of two keyvalues for equality
*
* @param left
* left cell to compare row and column
* @param right
* right cell to compare row and column
* @return True if same row and column.
*/
public boolean matchingRowColumn(final Cell left, final Cell right) {
short lrowlength = left.... | 3.26 |
hbase_KeyValue_getRowArray_rdh | /**
* Returns the backing array of the entire KeyValue (all KeyValue fields are in a single array)
*/
@Override
public byte[] getRowArray() {
return bytes;
} | 3.26 |
hbase_KeyValue_compareRows_rdh | /**
* Get the b[],o,l for left and right rowkey portions and compare.
*
* @param left
* the left kv serialized byte[] to be compared with
* @param loffset
* the offset in the left byte[]
* @param llength
* the length in the left byte[]
* @param right
* the right kv serialized byte[] to be compared wit... | 3.26 |
hbase_KeyValue_getValueArray_rdh | /**
* Returns the backing array of the entire KeyValue (all KeyValue fields are in a single array)
*/
@Override
public byte[] getValueArray() {
return bytes;
} | 3.26 |
hbase_KeyValue_getTimestampOffset_rdh | /**
* Return the timestamp offset
*/
private int getTimestampOffset(final int keylength) {
return (getKeyOffset() + keylength) - TIMESTAMP_TYPE_SIZE;
} | 3.26 |
hbase_KeyValue_getDelimiter_rdh | /**
* Find index of passed delimiter walking from start of buffer forwards.
*
* @param b
* the kv serialized byte[] to process
* @param delimiter
* input delimeter to fetch index from start
* @return Index of delimiter having started from start of <code>b</code> moving rightward.
*/
public static int getDel... | 3.26 |
hbase_KeyValue_getRowOffset_rdh | /**
* Returns Row offset
*/
@Override
public int getRowOffset() {
return this.offset + ROW_KEY_OFFSET;
} | 3.26 |
hbase_KeyValue_compareIgnoringPrefix_rdh | /**
* Overridden
*
* @param commonPrefix
* location of expected common prefix
* @param left
* the left kv serialized byte[] to be compared with
* @param loffset
* the offset in the left byte[]
* @param llength
* the length in the left byte[]
* @param right
* the right kv serialized byte[] to be co... | 3.26 |
hbase_KeyValue_getLength_rdh | // ---------------------------------------------------------------------------
//
// Length and Offset Calculators
//
// ---------------------------------------------------------------------------
/**
* Determines the total length of the KeyValue stored in the specified byte array and offset.
* Includes all headers... | 3.26 |
hbase_KeyValue_getValueOffset_rdh | /**
* Returns the value offset
*/
@Override
public int getValueOffset() {
int voffset = getKeyOffset() + getKeyLength();
return voffset;
} | 3.26 |
hbase_KeyValue_hashCode_rdh | /**
* In line with {@link #equals(Object)}, only uses the key portion, not the value.
*/@Override
public int hashCode() {
return calculateHashForKey(this);
} | 3.26 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.