name
stringlengths
12
178
code_snippet
stringlengths
8
36.5k
score
float64
3.26
3.68
hbase_MetricsSource_incrSourceInitializing_rdh
/** * Increment the count for initializing sources */ public void incrSourceInitializing() { singleSourceSource.incrSourceInitializing(); globalSourceSource.incrSourceInitializing(); }
3.26
hbase_MetricsSource_getPeerID_rdh
/** * Get the slave peer ID */ public String getPeerID() { return id; }
3.26
hbase_MetricsSource_getOpsShipped_rdh
/** * Gets the number of OPs shipped by this source queue to target cluster. * * @return oPsShipped total number of OPs shipped by this source. */ public long getOpsShipped() { return this.singleSourceSource.getShippedOps(); }
3.26
hbase_MetricsSource_incrLogEditsRead_rdh
/** * Increment the number of log edits read by one. */ public void incrLogEditsRead() { incrLogEditsRead(1); }
3.26
hbase_MetricsSource_getTimestampOfLastShippedOp_rdh
/** * Get the timestampsOfLastShippedOp, if there are multiple groups, return the latest one */ public long getTimestampOfLastShippedOp() { long lastTimestamp = 0L; for (long ts : lastShippedTimeStamps.values()) { if (ts > lastTimestamp) { lastTimestamp = ts; } } return l...
3.26
hbase_MetricsSource_getSourceInitializing_rdh
/** * Get the source initializing counts * * @return number of replication sources getting initialized */ public int getSourceInitializing() { return singleSourceSource.getSourceInitializing(); }
3.26
hbase_MetricsSource_incrLogEditsFiltered_rdh
/** * The number of log edits filtered out. */ public void incrLogEditsFiltered() { incrLogEditsFiltered(1); }
3.26
hbase_MetricsSource_getSizeOfLogQueue_rdh
/** * Get the sizeOfLogQueue */ public int getSizeOfLogQueue() { return singleSourceSource.getSizeOfLogQueue(); }
3.26
hbase_MetricsSource_setAgeOfLastShippedOp_rdh
/** * Set the age of the last edit that was shipped * * @param timestamp * target write time of the edit * @param walGroup * which group we are setting */ public void setAgeOfLastShippedOp(long timestamp, String walGroup) { long v0 = EnvironmentEdgeManager.currentTime() - timestamp; singleSourceSource.s...
3.26
hbase_MetricsSource_getEditsFiltered_rdh
/** * Gets the number of edits not eligible for replication this source queue logs so far. * * @return logEditsFiltered non-replicable edits filtered from this queue logs. */ public long getEditsFiltered() { return this.singleSourceSource.getEditsFiltered(); }
3.26
hbase_MetricsSource_setTimeStampNextToReplicate_rdh
/** * TimeStamp of next edit targeted for replication. Used for calculating lag, as if this timestamp * is greater than timestamp of last shipped, it means there's at least one edit pending * replication. * * @param timeStampNextToReplicate * timestamp of next edit in the queue that should be replicated. */ pu...
3.26
hbase_MetricsSource_clear_rdh
/** * Removes all metrics about this Source. */ public void clear() {m0(); singleSourceSource.clear(); }
3.26
hbase_MetricsSource_decrSourceInitializing_rdh
/** * Decrement the count for initializing sources */ public void decrSourceInitializing() { singleSourceSource.decrSourceInitializing(); globalSourceSource.decrSourceInitializing(); }
3.26
hbase_MetricsSource_incrLogReadInBytes_rdh
/** * increase the byte number read by source from log file */ public void incrLogReadInBytes(long readInBytes) { singleSourceSource.incrLogReadInBytes(readInBytes); globalSourceSource.incrLogReadInBytes(readInBytes); }
3.26
hbase_MetricsSource_getReplicableEdits_rdh
/** * Gets the number of edits eligible for replication read from this source queue logs so far. * * @return replicableEdits total number of replicable edits read from this queue logs. */ public long getReplicableEdits() { return this.singleSourceSource.getWALEditsRead() - this.singleSourceSource.getEditsFilter...
3.26
hbase_MetricsSource_getTimeStampNextToReplicate_rdh
/** * TimeStamp of next edit to be replicated. * * @return timeStampNextToReplicate - TimeStamp of next edit to be replicated. */ public long getTimeStampNextToReplicate() { return timeStampNextToReplicate; }
3.26
hbase_ServerRpcConnection_sendConnectionHeaderResponseIfNeeded_rdh
/** * Send the response for connection header */ private void sendConnectionHeaderResponseIfNeeded() throws FatalConnectionException { Pair<RPCProtos.ConnectionHeaderResponse, CryptoAES> pair = setupCryptoCipher();// Response the connection header if Crypto AES is enabled if (pair == null) { return; } try { i...
3.26
hbase_ServerRpcConnection_setupCryptoCipher_rdh
/** * Set up cipher for rpc encryption with Apache Commons Crypto. */ private Pair<RPCProtos.ConnectionHeaderResponse, CryptoAES> setupCryptoCipher() throws FatalConnectionException { // If simple auth, return if (saslServer == null) { return null; } // check if rpc encryption with Crypto ...
3.26
hbase_ServerRpcConnection_doRawSaslReply_rdh
/** * No protobuf encoding of raw sasl messages */ protected final void doRawSaslReply(SaslStatus status, Writable rv, String errorClass, String error) throws IOException { BufferChain bc; // In my testing, have noticed that sasl messages are usually // in the ballpark of 100-200. That's why the initial...
3.26
hbase_ServerRpcConnection_processRequest_rdh
/** * Has the request header and the request param and optionally encoded data buffer all in this one * array. * <p/> * Will be overridden in tests. */ protected void processRequest(ByteBuff buf) throws IOException, InterruptedException { long totalRequestSize = buf.limit(); int offset = 0; // Here we read in the...
3.26
hbase_ServerRpcConnection_setupCellBlockCodecs_rdh
/** * Set up cell block codecs */ private void setupCellBlockCodecs() throws FatalConnectionException { // TODO: Plug in other supported decoders. if (!connectionHeader.hasCellBlockCodecClass()) { return; } String className = connectionHeader.getCellBlockCodecClass(); if ((className == nul...
3.26
hbase_TableStateManager_setTableState_rdh
/** * Set table state to provided. Caller should lock table on write. * * @param tableName * table to change state for * @param newState * new state */ public void setTableState(TableName tableName, TableState.State newState) throws IOException { ReadWriteLock lock = tnLock.getLock(tableName); lock....
3.26
hbase_EventHandler_getPriority_rdh
/** * Get the priority level for this handler instance. This uses natural ordering so lower numbers * are higher priority. * <p> * Lowest priority is Integer.MAX_VALUE. Highest priority is 0. * <p> * Subclasses should override this method to allow prioritizing handlers. * <p> * Handlers with the same priority a...
3.26
hbase_EventHandler_handleException_rdh
/** * Event exception handler, may be overridden * * @param t * Throwable object */ protected void handleException(Throwable t) { String msg = "Caught throwable while processing event " + eventType; LOG.error(msg, t); if ((server != null) && ((t instanceof Error) || (t instanceof RuntimeException)))...
3.26
hbase_EventHandler_getSeqid_rdh
/** * Returns This events' sequence id. */ public long getSeqid() { return this.seqid; }
3.26
hbase_EventHandler_compareTo_rdh
/** * Default prioritized runnable comparator which implements a FIFO ordering. * <p> * Subclasses should not override this. Instead, if they want to implement priority beyond FIFO, * they should override {@link #getPriority()}. */ @Override public int compareTo(EventHandler o) { if (o == null) { retur...
3.26
hbase_EventHandler_prepare_rdh
/** * Event handlers should do all the necessary checks in this method (rather than in the * constructor, or in process()) so that the caller, which is mostly executed in the ipc context * can fail fast. Process is executed async from the client ipc, so this method gives a quick * chance to do some basic checks. Sh...
3.26
hbase_EventHandler_getInformativeName_rdh
/** * Event implementations should override thie class to provide an informative name about what * event they are handling. For example, event-specific information such as which region or server * is being processed should be included if possible. */ public String getInformativeName() { return this.getClass()....
3.26
hbase_TableNamespaceManager_doesNamespaceExist_rdh
/** * check whether a namespace has already existed. */ public boolean doesNamespaceExist(String namespaceName) throws IOException { return cache.containsKey(namespaceName); }
3.26
hbase_CellCodecWithTags_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.readF...
3.26
hbase_CellCodecWithTags_write_rdh
/** * 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)); this.out.write(bytes, offset, length); }
3.26
hbase_MetricsSink_refreshAgeOfLastAppliedOp_rdh
/** * Refreshing the age makes sure the value returned is the actual one and not the one set a * replication time * * @return refreshed age */ public long refreshAgeOfLastAppliedOp() { return setAgeOfLastAppliedOp(lastTimestampForAge); }
3.26
hbase_MetricsSink_incrementFailedBatches_rdh
/** * Convenience method to update metrics when batch of operations has failed. */ public void incrementFailedBatches() { mss.incrFailedBatches(); }
3.26
hbase_MetricsSink_getAppliedOps_rdh
/** * Gets the total number of OPs delivered to this sink. */ public long getAppliedOps() { return this.mss.getSinkAppliedOps(); }
3.26
hbase_MetricsSink_m0_rdh
/** * Get the count of the failed bathes */ protected long m0() { return mss.getFailedBatches(); }
3.26
hbase_MetricsSink_m1_rdh
/** * Get the TimestampOfLastAppliedOp. If no replication Op applied yet, the value is the timestamp * at which hbase instance starts * * @return timeStampsOfLastAppliedOp; */ public long m1() { return this.lastTimestampForAge; }
3.26
hbase_MetricsSink_getAgeOfLastAppliedOp_rdh
/** * Get the Age of Last Applied Op */ public long getAgeOfLastAppliedOp() { return mss.getLastAppliedOpAge(); }
3.26
hbase_MetricsSink_setAgeOfLastAppliedOp_rdh
/** * Set the age of the last applied operation * * @param timestamp * The timestamp of the last operation applied. * @return the age that was set */ public long setAgeOfLastAppliedOp(long timestamp) { long age = 0; if (lastTimestampForAge != timestamp) { ...
3.26
hbase_MetricsSink_getStartTimestamp_rdh
/** * Gets the time stamp from when the Sink was initialized. */ public long getStartTimestamp() { return this.startTimestamp; }
3.26
hbase_MetricsSink_applyBatch_rdh
/** * Convience method to change metrics when a batch of operations are applied. * * @param batchSize * total number of mutations that are applied/replicated * @param hfileSize * total number of hfiles that are applied/replicated */ public void applyBatch(long batchSize, long hfileSize) {applyBatch(batchSize...
3.26
hbase_FileCleanerDelegate_postClean_rdh
/** * Will be called after cleaner run. */ default void postClean() { }
3.26
hbase_FileCleanerDelegate_isEmptyDirDeletable_rdh
/** * Check if a empty directory with no subdirs or subfiles can be deleted * * @param dir * Path of the directory * @return True if the directory can be deleted, otherwise false */ default boolean isEmptyDirDeletable(Path dir) { return true; }
3.26
hbase_KeyValueCodec_getDecoder_rdh
/** * Implementation depends on {@link InputStream#available()} */ @Override public Decoder getDecoder(final InputStream is) { return new KeyValueDecoder(is); }
3.26
hbase_RemoteProcedureDispatcher_removeNode_rdh
/** * Remove a remote node * * @param key * the node identifier */ public boolean removeNode(final TRemote key) { final BufferNode node = nodeMap.remove(key); if (node == null) { return false; } node.abortOperationsInQueue(); return true; }
3.26
hbase_RemoteProcedureDispatcher_submitTask_rdh
// ============================================================================================ // Task Helpers // ============================================================================================ protected final void submitTask(Runnable task) { threadPool.execute(task); }
3.26
hbase_RemoteProcedureDispatcher_addOperationToNode_rdh
/** * Add a remote rpc. * * @param key * the node identifier */ public void addOperationToNode(final TRemote key, RemoteProcedure rp) throws NullTargetServerDispatchException, NoServerDispatchException, NoNodeDispatchException { if (key == null) { throw new NullTargetServerDispatchException(rp.toStri...
3.26
hbase_RemoteProcedureDispatcher_storeInDispatchedQueue_rdh
/** * Whether store this remote procedure in dispatched queue only OpenRegionProcedure and * CloseRegionProcedure return false since they are not fully controlled by dispatcher */ default boolean storeInDispatchedQueue() { return true; }
3.26
hbase_RemoteProcedureDispatcher_addNode_rdh
// ============================================================================================ // Node Helpers // ============================================================================================ /** * Add a node that will be able to execute remote procedures * * @param key * the node identifier */ p...
3.26
hbase_FileKeyStoreLoaderBuilderProvider_getBuilderForKeyStoreFileType_rdh
/** * Returns a {@link FileKeyStoreLoader.Builder} that can build a loader which loads keys and certs * from files of the given {@link KeyStoreFileType}. * * @param type * the file type to load keys/certs from. * @return a new Builder. */ static Builder<? extends FileKeyStor...
3.26
hbase_UnassignProcedure_remoteCallFailed_rdh
/** * Returns If true, we will re-wake up this procedure; if false, the procedure stays suspended. */ @Override protected boolean remoteCallFailed(final MasterProcedureEnv env, final RegionStateNode regionNode, final IOException exception) { return true; }
3.26
hbase_Table_checkAndMutate_rdh
/** * checkAndMutate that atomically checks if a row matches the specified condition. If it does, it * performs the specified action. * * @param checkAndMutate * The CheckAndMutate object. * @return A CheckAndMutateResult object that represents the result for the CheckAndMutate. * @throws IOException * if a...
3.26
hbase_Table_getOperationTimeout_rdh
/** * Get timeout of each operation in Table instance. * * @param unit * the unit of time the timeout to be represented in * @return operation rpc timeout in the specified time unit */ default long getOperationTimeout(TimeUnit unit) { throw new NotImplementedException("Add an implementation!"); }
3.26
hbase_Table_batch_rdh
/** * Method that does a batch call on Deletes, Gets, Puts, Increments, Appends, RowMutations. The * ordering of execution of the actions is not defined. Meaning if you do a Put and a Get in the * same {@link #batch} call, you will not necessarily be guaranteed that the Get returns what the * Put had put. * * @pa...
3.26
hbase_Table_close_rdh
/** * Releases any resources held or pending changes in internal buffers. * * @throws IOException * if a remote or network exception occurs. */ @Override default void close() throws IOException { throw new NotImplementedException("Add an implementation!"); } /** * Creates and returns a {@link org.apache.hb...
3.26
hbase_Table_mutateRow_rdh
/** * Performs multiple mutations atomically on a single row. Currently {@link Put} and * {@link Delete} are supported. * * @param rm * object that specifies the set of mutations to perform atomically * @return results of Increment/Append operations * @throws IOException * if a remote or network exception o...
3.26
hbase_Table_exists_rdh
/** * Test for the existence of columns in the table, as specified by the Get. * <p> * This will return true if the Get matches one or more keys, false if not. * <p> * This is a server-side call so it prevents any data from being transfered to the client. * * @param get * t...
3.26
hbase_Table_ifEquals_rdh
/** * Check for equality. * * @param value * the expected value */ default CheckAndMutateBuilder ifEquals(byte[] value) { return ifMatches(CompareOperator.EQUAL, value); }
3.26
hbase_Table_append_rdh
/** * Appends values to one or more columns within a single row. * <p> * This operation guaranteed atomicity to readers. Appends are done under a single row lock, so * write operations to a row are synchronized, and readers are guaranteed to see this operation * fully completed. * * @param append * object tha...
3.26
hbase_Table_put_rdh
/** * Batch puts the specified data into the table. * <p> * This can be used for group commit, or for submitting user defined batches. Before sending a * batch of mutations to the server, the client runs a few validations on the input list. If an * error is found, for example, a mutation was supplied but was missi...
3.26
hbase_Table_getRequestAttributes_rdh
/** * Get the attributes to be submitted with requests * * @return map of request attributes */ default Map<String, byte[]> getRequestAttributes() { throw new NotImplementedException("Add an implementation!"); }
3.26
hbase_Table_getRpcTimeout_rdh
/** * Get timeout of each rpc request in this Table instance. It will be overridden by a more * specific rpc timeout config such as readRpcTimeout or writeRpcTimeout. * * @see #getReadRpcTimeout(TimeUnit) * @see #getWriteRpcTimeout(TimeUnit) * @param unit * the unit of time the timeout to be represented in * ...
3.26
hbase_Table_getWriteRpcTimeout_rdh
/** * Get timeout of each rpc write request in this Table instance. * * @param unit * the unit of time the timeout to be represented in * @return write rpc timeout in the specified time unit */ default long getWriteRpcTimeout(TimeUnit unit) { throw new NotImplementedException("Add an implementation!"); }
3.26
hbase_Table_increment_rdh
/** * Increments one or more columns within a single row. * <p> * This operation ensures atomicity to readers. Increments are done under a single row lock, so * write operations to a row are synchronized, and readers are guaranteed to see this operation * fully completed. * * @param increment * object that sp...
3.26
hbase_Table_delete_rdh
/** * Deletes the specified cells/row. * * @param delete * The object that specifies what to delete. * @throws IOException * if a remote or network exception occurs. * @since 0.20.0 */ default void delete(Delete delete) throws IOException { throw new NotImplementedException("Add an implementation!"); } /**...
3.26
hbase_Table_incrementColumnValue_rdh
/** * Atomically increments a column value. If the column value already exists and is not a * big-endian long, this could throw an exception. If the column value does not yet exist it is * initialized to <code>amount</code> and written to the specified column. * <p> * Setting durability to {@link Durability#SKIP_W...
3.26
hbase_Table_getScanner_rdh
/** * Gets a scanner on the current table for the given family and qualifier. * * @param family * The column family to scan. * @param qualifier * The column qualifier to scan. * @return A scanner. * @throws IOException * if a remote or network exception occurs. * @since 0.20.0 */ default ResultScanner ...
3.26
hbase_Table_getReadRpcTimeout_rdh
/** * Get timeout of each rpc read request in this Table instance. * * @param unit * the unit of time the timeout to be represented in * @return read rpc timeout in the specified time unit */ default long getReadRpcTimeout(TimeUnit unit) { throw new NotImplementedException("Add an implementation!"); }
3.26
hbase_ReflectedFunctionCache_notFound_rdh
/** * In order to use computeIfAbsent, we can't store nulls in our cache. So we store a lambda which * resolves to null. The contract is that getAndCallByName returns null in this case. */ private R notFound(I argument) { return null; }
3.26
hbase_ReflectedFunctionCache_getAndCallByName_rdh
/** * Get and execute the Function for the given className, passing the argument to the function and * returning the result. * * @param className * the full name of the class to lookup * @param argument * the argument to pass to the function, if found. * @return null if a function is not found for classname...
3.26
hbase_OrderedBlob_encode_rdh
/** * Write a subset of {@code val} to {@code dst}. * * @param dst * the {@link PositionedByteRange} to write to * @param val * the value to write to {@code dst} * @param voff * the offset in {@code dst} where to write {@code val} to * @param vlen * the lenght of {@code val} * @return the number of b...
3.26
hbase_PrivateCellUtil_writeRowKeyExcludingCommon_rdh
/** * Write rowkey excluding the common part. */ public static void writeRowKeyExcludingCommon(Cell cell, short rLen, int commonPrefix, DataOutputStream out) throws IOException { if (commonPrefix == 0) { out.writeShort(rLen); } else if (commonPrefix == 1) { out.writeByte(((byte) (rLen))); commonPrefix--;}...
3.26
hbase_PrivateCellUtil_createNextOnRowCol_rdh
/** * Return a new cell is located following input cell. If both of type and timestamp are minimum, * the input cell will be returned directly. */ public static Cell createNextOnRowCol(Cell cell) { long ts = cell.getTimestamp(); byte type = cell.getTypeByte(); if (type != Type.Minimum.getCode()) { type = KeyValue.Ty...
3.26
hbase_PrivateCellUtil_tagsIterator_rdh
/** * Utility method to iterate through the tags in the given cell. * * @param cell * The Cell over which tags iterator is needed. * @return iterator for the tags */ public static Iterator<Tag> tagsIterator(final Cell cell) { final int tagsLength = cell.getTagsLength(); // Save an object allocation where we ca...
3.26
hbase_PrivateCellUtil_createFirstOnRowColTS_rdh
/** * 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 */ ...
3.26
hbase_PrivateCellUtil_createLastOnRow_rdh
/** * 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) {return new LastOnRowByteBufferExtendedCell(((ByteBufferExtendedCell)...
3.26
hbase_PrivateCellUtil_getRowByte_rdh
/** * ******************* misc ************************************ */ public static byte getRowByte(Cell cell, int index) { if (cell instanceof ByteBufferExtendedCell) { return ((ByteBufferExtendedCell) (cell)).getRowByteBuffer().get(((ByteBufferExtendedCell) (cell)).getRowPosition() + index); } ...
3.26
hbase_PrivateCellUtil_deepClone_rdh
/** * Deep clones the given cell if the cell supports deep cloning * * @param cell * the cell to be cloned * @return the cloned cell */ public static Cell deepClone(Cell cell) throws CloneNotSupportedException { if (cell instanceof ExtendedCell) { return ((ExtendedCell) (cell)).deepClone(); } ...
3.26
hbase_PrivateCellUtil_compareValue_rdh
/** * Compare cell's value against given comparator * * @param cell * the cell to use for comparison * @param comparator * the {@link CellComparator} to use for comparison * @return result comparing cell's value */ public static int compareValue(Cell cell, ByteArrayComparable comparator) { if (cell instanc...
3.26
hbase_PrivateCellUtil_createLastOnRowCol_rdh
/** * 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. * * @return Last possible Cell on passed Cell's rk:cf:q. */ public static Cell c...
3.26
hbase_PrivateCellUtil_writeValue_rdh
/** * 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 */ public static void writeValue(OutputStream out, Cell cell, int vlength) th...
3.26
hbase_PrivateCellUtil_compareRow_rdh
/** * Compare cell's row against given comparator * * @param cell * the cell to use for comparison * @param comparator * the {@link CellComparator} to use for comparison * @return result comparing cell's row */public static int compareRow(Cell cell, ByteArrayComparable comparator) { if (cell instanceof Byte...
3.26
hbase_PrivateCellUtil_getTag_rdh
/** * Retrieve Cell's first tag, matching the passed in type * * @param cell * The Cell * @param type * Type of the Tag to retrieve * @return Optional, empty if there is no tag of the passed in tag type */ public static Optional<Tag> getTag(Cell cell, byte type) { boolean v28 = cell instanceof ByteBufferEx...
3.26
hbase_PrivateCellUtil_writeQualifier_rdh
/** * 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 */ public static void writeQualifier(OutputStream out, Cell cell, i...
3.26
hbase_PrivateCellUtil_setTimestamp_rdh
/** * 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, byte[] ts) throws IOException { if (cell instanceof ExtendedCell) { ((ExtendedCell) (cell)).setTimestamp(ts); } else { ...
3.26
hbase_PrivateCellUtil_compressTags_rdh
/** * Compresses the tags to the given outputstream using the TagcompressionContext * * @param out * the outputstream to which the compression should happen * @param cell * the cell which has tags * @param tagCompressionContext * the TagCompressionContext * @throws IOException * can throw IOException ...
3.26
hbase_PrivateCellUtil_estimatedSerializedSizeOfKey_rdh
/** * Calculates the serialized key size. We always serialize in the KeyValue's serialization format. * * @param cell * the cell for which the key size has to be calculated. * @return the key size */ public static int estimatedSerializedSizeOfKey(final Cell cell) { if (cell instanceof KeyValue) retu...
3.26
hbase_PrivateCellUtil_createFirstOnRowCol_rdh
/** * Create a Cell that is smaller than all other possible Cells for the given Cell's rk:cf and * 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 ...
3.26
hbase_PrivateCellUtil_copyTagsTo_rdh
/** * Copies the tags info into the tag portion of the cell */ public static int copyTagsTo(Cell cell, ByteBuffer destination, int destinationOffset) { int v25 = cell.getTagsLength(); if (cell instanceof ByteBufferExtendedCell) { ByteBufferUtils.copyFromBufferToBuffer(((ByteBufferExtendedCell) (cell)).getTagsByteBuf...
3.26
hbase_PrivateCellUtil_write_rdh
/** * Made into a static method so as to reuse the logic within * ValueAndTagRewriteByteBufferExtendedCell */ static void write(ByteBuffer buf, int offset, Cell cell, byte[] value, byte[] tags) { offset = ByteBufferUtils.putInt(buf, offset, KeyValueUtil.keyLength(cell));// Key length offset = ByteBufferUtils.putIn...
3.26
hbase_PrivateCellUtil_createFirstOnRow_rdh
/** * 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) { return new FirstOnRowByteBufferExtendedCell(((ByteBuff...
3.26
hbase_PrivateCellUtil_writeFamily_rdh
/** * 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 */ public static void writeFamily(OutputStream out, Cell cell, byte flength...
3.26
hbase_PrivateCellUtil_getValueAsLong_rdh
/** * 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) { return ByteBufferUtils.toLong(((ByteBufferExtendedCell) (cell)).getValueByteBuffer(), ((ByteBufferExtendedCell) (cell)).getVal...
3.26
hbase_PrivateCellUtil_createCell_rdh
/** * Returns A new cell which is having the extra tags also added to it. */ public static Cell createCell(Cell cell, byte[] tags) { if (cell instanceof ByteBufferExtendedCell) { return new TagRewriteByteBufferExtendedCell(((ByteBufferExtendedCell) (cell)), tags); } return new TagRewriteCell(cell...
3.26
hbase_PrivateCellUtil_equalsIgnoreMvccVersion_rdh
/** * special case for Cell.equals */ public static boolean equalsIgnoreMvccVersion(Cell a, Cell b) { // row boolean res = CellUtil.matchingRows(a, b); if (!res)return res; // family res = CellUtil.matchingColumn(a, b); if (!res) return res; // timestamp: later sorts first if (!CellUtil.matchingTimestamp(a, b)) ...
3.26
hbase_PrivateCellUtil_writeCell_rdh
/** * Writes the cell to the given OutputStream * * @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 */ public static int writeCell(Cell cell, OutputStream out, boolean withTags) throws IOExcepti...
3.26
hbase_PrivateCellUtil_updateLatestStamp_rdh
/** * Sets the given timestamp to the cell iff current timestamp is * {@link HConstants#LATEST_TIMESTAMP}. * * @return True if cell timestamp is modified. * @throws IOException * when the passed cell is not of type {@link ExtendedCell} */ public static boolean updateLatestStamp(Cell cell, byte[] ts) throws IOE...
3.26
hbase_PrivateCellUtil_getValueAsDouble_rdh
/** * 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) { return ByteBufferUtils.toDouble(((ByteBufferExtendedCell) (cell)).getValueByteBuffer(), ((ByteBufferExtendedCell) (ce...
3.26
hbase_PrivateCellUtil_getTags_rdh
/** * Return tags in the given Cell as a List * * @param cell * The Cell * @return Tags in the given Cell as a List */ public static List<Tag> getTags(Cell cell) {List<Tag> tags = new ArrayList<>(); Iterator<Tag> tagsItr = tagsIterator(cell); while (tagsItr.hasNext()) { tags.add(tagsItr.next()); } return tags;...
3.26
hbase_PrivateCellUtil_fillRowRange_rdh
/** * ***************** ByteRange ****************************** */ public static ByteRange fillRowRange(Cell cell, ByteRange range) { return range.set(cell.getRowArray(), cell.getRowOffset(), cell.getRowLength()); }
3.26
hbase_PrivateCellUtil_createFirstDeleteFamilyCellOnRow_rdh
/** * Create a Delete Family Cell for the specified row and family that would be smaller than all * other possible Delete Family KeyValues that have the same row and family. Used for seeking. * * @param row * - row key (arbitrary byte array) * @param fam * - family name * @return First Delete Family possibl...
3.26