name
stringlengths
12
178
code_snippet
stringlengths
8
36.5k
score
float64
3.26
3.68
hbase_CompareFilter_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 CompareFilter)) { return false; ...
3.26
hbase_CompareFilter_convert_rdh
/** * Returns A pb instance to represent this instance. */ CompareFilter convert() { FilterProtos.CompareFilter.Builder builder = FilterProtos.CompareFilter.newBuilder(); HBaseProtos.CompareType compareOp = CompareType.valueOf(this.f0.name()); builder.setCompareOp(compareOp); if (this.comparator != nu...
3.26
hbase_CompareFilter_extractArguments_rdh
/** * Returns an array of heterogeneous objects */ public static ArrayList<Object> extractArguments(ArrayList<byte[]> filterArguments) { Preconditions.checkArgument(filterArguments.size() == 2, "Expected 2 but got: %s", filterArguments.size()); CompareOperator op = ParseFilter.createCompareOperator(filterAr...
3.26
hbase_CompareFilter_getComparator_rdh
/** * Returns the comparator */ public ByteArrayComparable getComparator() { return comparator; }
3.26
hbase_ReplaySyncReplicationWALCallable_filter_rdh
// return whether we should include this entry. private boolean filter(Entry entry) { WALEdit edit = entry.getEdit(); WALUtil.filterCells(edit, c -> CellUtil.matchingFamily(c, WALEdit.METAFAMILY) ? null : c); return !edit.isEmpty();}
3.26
hbase_TableInfoModel_get_rdh
/** * * @param index * the index * @return the region model */ public TableRegionModel get(int index) { return regions.get(index); }
3.26
hbase_TableInfoModel_add_rdh
/** * Add a region model to the list * * @param region * the region */ public void add(TableRegionModel region) { regions.add(region); }
3.26
hbase_TableInfoModel_getRegions_rdh
/** * Returns the regions */@XmlElement(name = "Region") public List<TableRegionModel> getRegions() { return regions; }
3.26
hbase_TableInfoModel_setRegions_rdh
/** * * @param regions * the regions to set */ public void setRegions(List<TableRegionModel> regions) { this.regions = regions; }
3.26
hbase_TableInfoModel_toString_rdh
/* (non-Javadoc) @see java.lang.Object#toString() */ @Override public String toString() { StringBuilder sb = new StringBuilder(); for (TableRegionModel aRegion : regions) { sb.append(aRegion.toString()); sb.append('\n'); } return sb.toString(); }
3.26
hbase_TableInfoModel_setName_rdh
/** * * @param name * the table name */ public void setName(String name) { this.name = name; }
3.26
hbase_BloomFilterUtil_idealMaxKeys_rdh
/** * The maximum number of keys we can put into a Bloom filter of a certain size to maintain the * given error rate, assuming the number of hash functions is chosen optimally and does not even * have to be an integer (hence the "ideal" in the function name). * * @return maximum number of keys that can be inserted...
3.26
hbase_BloomFilterUtil_checkBit_rdh
/** * Check if bit at specified index is 1. * * @param pos * index of bit * @return true if bit at specified index is 1, false if 0. */ static boolean checkBit(int pos, ByteBuff bloomBuf, int bloomOffset) { int bytePos = pos >> 3;// pos / 8 int bitPos = pos & 0x7;// pos % 8 byte curByte = bloomBu...
3.26
hbase_BloomFilterUtil_computeFoldableByteSize_rdh
/** * Increases the given byte size of a Bloom filter until it can be folded by the given factor. * * @return Foldable byte size */ public static int computeFoldableByteSize(long bitSize, int foldFactor) { long byteSizeLong = (bitSize + 7) / 8; int mask = (1 << foldFactor) - 1; if ((mask & byteSizeLon...
3.26
hbase_BloomFilterUtil_setRandomGeneratorForTest_rdh
/** * Sets a random generator to be used for look-ups instead of computing hashes. Can be used to * simulate uniformity of accesses better in a test environment. Should not be set in a real * environment where correctness matters! * <p> * This gets used in {@link #contains(ByteBuff, int, int, Hash, int, HashKey)} ...
3.26
hbase_BloomFilterUtil_actualErrorRate_rdh
/** * Computes the actual error rate for the given number of elements, number of bits, and number of * hash functions. Taken directly from the * <a href= "http://en.wikipedia.org/wiki/Bloom_filter#Probability_of_false_positives" > Wikipedia * Bloom filter article</a>. * * @return the actual error rate */ public ...
3.26
hbase_MetaTableMetrics_getRegionIdFromOp_rdh
/** * Get regionId from Ops such as: get, put, delete. * * @param op * such as get, put or delete. */ private String getRegionIdFromOp(Row op) { final String v2 = Bytes.toString(op.getRow()); if (StringUtils.isEmpty(v2)) { return null; } final String[] splits = v2.split(","); return s...
3.26
hbase_MetaTableMetrics_getTableNameFromOp_rdh
/** * Get table name from Ops such as: get, put, delete. * * @param op * such as get, put or delete. */ private String getTableNameFromOp(Row op) {final String tableRowKey = Bytes.toString(op.getRow()); if (StringUtils.isEmpty(tableRowKey)) { return null; } final String[] splits = tableRowKey...
3.26
hbase_MetaTableMetrics_registerAndMarkMeter_rdh
// Helper function to register and mark meter if not present private void registerAndMarkMeter(String requestMeter) { if (requestMeter.isEmpty()) { return; } if (!registry.get(requestMeter).isPresent()) { f0.add(requestMeter); } registry.meter(requestMeter).mark(); }
3.26
hbase_CallRunner_cleanup_rdh
/** * Cleanup after ourselves... let go of references. */ private void cleanup() { this.call.cleanup(); this.call = null; this.rpcServer = null; }
3.26
hbase_CallRunner_drop_rdh
/** * When we want to drop this call because of server is overloaded. */ public void drop() { try (Scope ignored = span.makeCurrent()) { if (call.disconnectSince() >= 0) { RpcServer.LOG.debug("{}: skipped {}", Thread.currentThread().getName(), call); span.addEvent("Client disconnec...
3.26
hbase_BalanceRequest_newBuilder_rdh
/** * Create a builder to construct a custom {@link BalanceRequest}. */ public static Builder newBuilder() { return new Builder(); }
3.26
hbase_BalanceRequest_setDryRun_rdh
/** * Updates BalancerRequest to run the balancer in dryRun mode. In this mode, the balancer will * try to find a plan but WILL NOT execute any region moves or call any coprocessors. You can * run in dryRun mode regardless of whether the balancer switch is enabled or disabled, but * dryRun mode will not run over an...
3.26
hbase_BalanceRequest_defaultInstance_rdh
/** * Get a BalanceRequest for a default run of the balancer. The default mode executes any moves * calculated and will not run if regions are already in transition. */ public static BalanceRequest defaultInstance() { return DEFAULT; }
3.26
hbase_BalanceRequest_build_rdh
/** * Build the {@link BalanceRequest} */ public BalanceRequest build() { return new BalanceRequest(dryRun, f0); }
3.26
hbase_BalanceRequest_setIgnoreRegionsInTransition_rdh
/** * Updates BalancerRequest to run the balancer even if there are regions in transition. WARNING: * Advanced usage only, this could cause more issues than it fixes. */ public Builder setIgnoreRegionsInTransition(boolean ignoreRegionsInTransition) { this.f0 = ignoreRegionsInTransition; return this; }
3.26
hbase_BalanceRequest_isDryRun_rdh
/** * Returns true if the balancer should run in dry run mode, otherwise false. In dry run mode, * moves will be calculated but not executed. */ public boolean isDryRun() { return dryRun;}
3.26
hbase_BalanceRequest_isIgnoreRegionsInTransition_rdh
/** * Returns true if the balancer should execute even if regions are in transition, otherwise false. * This is an advanced usage feature, as it can cause more issues than it fixes. */ public boolean isIgnoreRegionsInTransition() { return ignoreRegionsInTransition; }
3.26
hbase_ZKUtil_setData_rdh
/** * Returns a setData ZKUtilOp */ public static ZKUtilOp setData(String path, byte[] data, int version) { return new SetData(path, data, version); }
3.26
hbase_ZKUtil_getParent_rdh
// // Helper methods // /** * Returns the full path of the immediate parent of the specified node. * * @param node * path to get parent of * @return parent of path, null if passed the root node or an invalid node */ public static String getParent(String node) { int idx = node.lastIndexOf(ZNodePaths.ZNODE_...
3.26
hbase_ZKUtil_setWatchIfNodeExists_rdh
/** * Watch the specified znode, but only if exists. Useful when watching for deletions. Uses * .getData() (and handles NoNodeException) instead of .exists() to accomplish this, as .getData() * will only set a watch if the znode exists. * * @param zkw * zk reference * @param znode * path of node to watch *...
3.26
hbase_ZKUtil_convert_rdh
/** * Convert a {@link DeserializationException} to a more palatable {@link KeeperException}. Used * when can't let a {@link DeserializationException} out w/o changing public API. * * @param e * Exception to convert * @return Converted exception */ public static KeeperException convert(final DeserializationExc...
3.26
hbase_ZKUtil_multiOrSequential_rdh
/** * Use ZooKeeper's multi-update functionality. If all of the following are true: - * runSequentialOnMultiFailure is true - on calling multi, we get a ZooKeeper exception that can * be handled by a seque...
3.26
hbase_ZKUtil_deleteNodeFailSilent_rdh
/** * Returns a deleteNodeFailSilent ZKUtilOP */ public static ZKUtilOp deleteNodeFailSilent(String path) { return new DeleteNodeFailSilent(path); }
3.26
hbase_ZKUtil_getPath_rdh
/** * Returns path to znode where the ZKOp will occur */ public String getPath() { return path; }
3.26
hbase_ZKUtil_createSetData_rdh
/** * Set data into node creating node if it doesn't yet exist. Does not set watch. * * @param zkw * zk reference * @param znode * path of node * @param data * data to set for node * @throws KeeperException * if a ZooKeeper operation fails */ public static void createSetData(final ZKWatcher zkw, fin...
3.26
hbase_ZKUtil_deleteNodeRecursivelyMultiOrSequential_rdh
/** * Delete the specified node and its children. This traverse the znode tree for listing the * children and then delete these znodes including the parent using multi-update api or sequential * based on the specified configurations. * <p> * Sets no watches. Throws all exceptions besides dealing with deletion of c...
3.26
hbase_ZKUtil_nodeHasChildren_rdh
/** * Checks if the specified znode has any children. Sets no watches. Returns true if the node * exists and has children. Returns false if the node does not exist or if the node does not have * any children. Used during master initialization to determine if the master is a failed-over-to * master or the first mast...
3.26
hbase_ZKUtil_watchAndCheckExists_rdh
// // Existence checks and watches // /** * Watch the specified znode for delete/create/change events. The watcher is set whether or not * the node exists. If the node already exists, the method returns true. If the node does not * exist, the method returns false. * * @param zkw * zk reference * @param znode...
3.26
hbase_ZKUtil_partitionOps_rdh
/** * Partition the list of {@code ops} by size (using {@link #estimateSize(ZKUtilOp)}). */ static List<List<ZKUtilOp>> partitionOps(List<ZKUtilOp> ops, int maxPartitionSize) { List<List<ZKUtilOp>> partitionedOps = new ArrayList<>(); List<ZKUtilOp> currentPartition = new ArrayList<>(); int currentPartiti...
3.26
hbase_ZKUtil_waitForBaseZNode_rdh
/** * Waits for HBase installation's base (parent) znode to become available. * * @throws IOException * on ZK errors */public static void waitForBaseZNode(Configuration conf) throws IOException { LOG.info("Waiting until the base znode is available"); String v63 = conf.get(HConstants.ZOOKEEPER_ZNO...
3.26
hbase_ZKUtil_getNumberOfChildren_rdh
/** * Get the number of children of the specified node. If the node does not exist or has no * children, returns 0. Sets no watches at all. * * @param zkw * zk reference * @param znode * path of node to count children of * @return number of children of specified node, 0 if none or parent does not exist * @...
3.26
hbase_ZKUtil_createNodeIfNotExistsNoWatch_rdh
/** * Creates the specified znode with the specified data but does not watch it. Returns the znode of * the newly created node If there is another problem, a KeeperException will be thrown. * * @param zkw * zk reference * @param znode * path of node * @param data * data of node * @param createMode * ...
3.26
hbase_ZKUtil_getDataNoWatch_rdh
/** * Get the data at the specified znode without setting a watch. Returns the data if the node * exists. Returns null if the node does not exist. Sets the stats of the node in the passed Stat * object. Pass a null stat if not interested...
3.26
hbase_ZKUtil_m1_rdh
/** * Helper method to print the current state of the ZK tree. * * @see #logZKTree(ZKWatcher, String) * @throws KeeperException * if an unexpected exception occurs */ private static void m1(ZKWatcher zkw, String root, String prefix) throws KeeperException { List<String> children = ZKUtil.listChildrenNoWatch...
3.26
hbase_ZKUtil_deleteNode_rdh
/** * Delete the specified node with the specified version. Sets no watches. Throws all exceptions. */ public static boolean deleteNode(ZKWatcher zkw, String node, int version) throws KeeperException { try { zkw.getRecoverableZooKeeper().delete(node, version); return true; } catch (KeeperExcep...
3.26
hbase_ZKUtil_deleteChildrenRecursively_rdh
/** * Delete all the children of the specified node but not the node itself. Sets no watches. Throws * all exceptions besides dealing with deletion of children. * * @throws KeeperException * if a ZooKeeper operation fails */ public static void deleteChildrenRecursively(ZKWatcher zkw, String node) throws KeeperE...
3.26
hbase_ZKUtil_createWithParents_rdh
/** * Creates the specified node and all parent nodes required for it to exist. The creation of * parent znodes is not atomic with the leafe znode creation but the data is written atomically * when the leaf node is created. No watches are set and no errors are thrown if the node already * exists. The nodes created ...
3.26
hbase_ZKUtil_deleteChildrenRecursivelyMultiOrSequential_rdh
/** * Delete all the children of the specified node but not the node itself. This will first traverse * the znode tree for listing the children and then delete these znodes using multi-update api or * sequential based on the specified configurations. * <p> * Sets no watches. Throws all exceptions besides dealing w...
3.26
hbase_ZKUtil_listChildrenAndWatchThem_rdh
/** * List all the children of the specified znode, setting a watch for children changes and also * setting a watch on every individual child in order to get the NodeCreated and NodeDeleted * events. * * @param zkw * zookeeper reference * @param znode * node to get children of and watch * @return list of z...
3.26
hbase_ZKUtil_logRetrievedMsg_rdh
// // ZooKeeper cluster information // private static void logRetrievedMsg(final ZKWatcher zkw, final String znode, final byte[] data, final boolean watcherSet) { if (!LOG.isTraceEnabled()) { return; } LOG.trace(zkw.prefix((((("Retrieved " + (data == null ? 0 : data.length)) + " byte(s) of data fr...
3.26
hbase_ZKUtil_checkExists_rdh
/** * Check if the specified node exists. Sets no watches. * * @param zkw * zk reference * @param znode * path of node to watch * @return version of the node if it exists, -1 if does not exist * @throws KeeperException * if u...
3.26
hbase_ZKUtil_listChildrenBFSNoWatch_rdh
/** * BFS Traversal of all the children under path, with the entries in the list, in the same order * as that of the traversal. Lists all the children without setting any watches. - zk reference - * path of node * * @return list of children znodes under the path if unexpected ZooKeeper exception */private static ...
3.26
hbase_ZKUtil_deleteNodeRecursively_rdh
/** * Delete the specified node and all of it's children. * <p> * If the node does not exist, just returns. * <p> * Sets no watches. Throws all exceptions besides dealing with deletion of children. */ public static void deleteNodeRecursively(ZKWatcher zkw, String node) throws KeeperException { deleteNodeR...
3.26
hbase_ZKUtil_submitBatchedMultiOrSequential_rdh
/** * Chunks the provided {@code ops} when their approximate size exceeds the the configured limit. * Take caution that this can ONLY be used for operations where atomicity is not important, e.g. * deletions. It must not be used when atomicity of the operations is critical. * * @param zkw * reference to the {@l...
3.26
hbase_ZKUtil_logZKTree_rdh
/** * Recursively print the current state of ZK (non-transactional) * * @param root * name of the root directory in zk to print */ public static void logZKTree(ZKWatcher zkw, String root) { if (!LOG.isDebugEnabled()) { return; } LOG.debug("Current zk system:"); String prefix = "|-"; L...
3.26
hbase_ZKUtil_toZooKeeperOp_rdh
/** * Convert from ZKUtilOp to ZKOp */ private static Op toZooKeeperOp(ZKWatcher zkw, ZKUtilOp op) throws UnsupportedOperationException { if (op == null) { return null; } if (op instanceof CreateAndFailSilent) { CreateAndFailSilent cafs = ((CreateAndFailSilent) (op)); return Op.cre...
3.26
hbase_ZKUtil_parseWALPositionFrom_rdh
/** * * @param bytes * - Content of a WAL position znode. * @return long - The current WAL position. * @throws DeserializationException * if the WAL position cannot be parsed */ public static long parseWALPositionFrom(final byte[] bytes) throws DeserializationException { if (bytes == null) { thro...
3.26
hbase_ZKUtil_listChildrenBFSAndWatchThem_rdh
/** * BFS Traversal of all the children under path, with the entries in the list, in the same order * as that of the traversal. Lists all the children and set watches on to them. - zk reference - * path of node * * @return list of children znodes under the path if unexpected ZooKeeper exception */ private static ...
3.26
hbase_ZKUtil_getNodeName_rdh
/** * Get the name of the current node from the specified fully-qualified path. * * @param path * fully-qualified path * @return name of the current node */ public static String getNodeName(String path) {return path.substring(path.lastIndexOf("/") + 1); }
3.26
hbase_ZKUtil_getDataAndWatch_rdh
/** * Get the data at the specified znode and set a watch. Returns the data and sets a watch if the * node exists. Returns null and no watch is set if the node does not exist or there is an * exception. * * @param zkw * zk reference * @param znode * path of node * @param stat * object to populate the ve...
3.26
hbase_ZKUtil_createAndFailSilent_rdh
/** * Returns a createAndFailSilent ZKUtilOp */ public static ZKUtilOp createAndFailSilent(String path, byte[] data) { return new CreateAndFailSilent(path, data); }
3.26
hbase_ZKUtil_createEphemeralNodeAndWatch_rdh
// // Node creation // /** * Set the specified znode to be an ephemeral node carrying the specified data. If the node is * created successfully, a watcher is also set on the node. If the node is not created * successfully because it already exists, this method will also set a watcher on the node. If * there is an...
3.26
hbase_NettyRpcServer_createNettyServerRpcConnection_rdh
// will be overridden in tests @InterfaceAudience.Private protected NettyServerRpcConnection createNettyServerRpcConnection(Channel channel) { return new NettyServerRpcConnection(this, channel); }
3.26
hbase_SyncFutureCache_offer_rdh
/** * Offers the sync future back to the cache for reuse. */ public void offer(SyncFuture syncFuture) { // It is ok to overwrite an existing mapping. syncFutureCache.asMap().put(syncFuture.getThread(), syncFuture); }
3.26
hbase_DefaultOperationQuota_updateEstimateConsumeQuota_rdh
/** * Update estimate quota(read/write size/capacityUnits) which will be consumed * * @param numWrites * the number of write requests * @param numReads * the number of read requests * @param numScans * the number of scan requests */ protected void updateEstimateConsumeQuota(int numWrites, int numReads, i...
3.26
hbase_HBaseServerException_isServerOverloaded_rdh
/** * Returns True if server was considered overloaded when exception was thrown */public boolean isServerOverloaded() { return serverOverloaded; }
3.26
hbase_HBaseServerException_m0_rdh
/** * Necessary for parsing RemoteException on client side * * @param serverOverloaded * True if server was overloaded when exception was thrown */ public void m0(boolean serverOverloaded) { this.serverOverloaded = serverOverloaded;}
3.26
hbase_MasterFeature_bindFactory_rdh
/** * Helper method for smoothing over use of {@link SupplierFactoryAdapter}. Inspired by internal * implementation details of jersey itself. */ private <T> ServiceBindingBuilder<T> bindFactory(Supplier<T> supplier) { return bindFactory(new SupplierFactoryAdapter<>(supplier)); }
3.26
hbase_QualifierFilter_parseFrom_rdh
/** * Parse a serialized representation of {@link QualifierFilter} * * @param pbBytes * A pb serialized {@link QualifierFilter} instance * @return An instance of {@link QualifierFilter} made from <code>bytes</code> * @throws DeserializationException * if an error occurred * @see #toByteArray */ public stat...
3.26
hbase_QualifierFilter_toByteArray_rdh
/** * Returns The filter serialized using pb */ @Override public byte[] toByteArray() { FilterProtos.QualifierFilter.Builder builder = FilterProtos.QualifierFilter.newBuilder(); builder.setCompareFilter(super.convert()); return builder.build().toByteArray();}
3.26
hbase_QualifierFilter_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 QualifierFilter)) { return false;...
3.26
hbase_HFileReaderImpl_checkLen_rdh
/** * Returns True if v &lt; 0 or v &gt; current block buffer limit. */ protected final boolean checkLen(final int v) { return (v < 0) || (v > this.blockBuffer.limit()); }
3.26
hbase_HFileReaderImpl_readMvccVersion_rdh
/** * Read mvcc. Does checks to see if we even need to read the mvcc at all. */ protected void readMvccVersion(final int offsetFromPos) { // See if we even need to decode mvcc. if (!this.reader.getHFileInfo().shouldIncludeMemStoreTS()) { return; } if (!this.reader.getHFileInfo().isDecodeMe...
3.26
hbase_HFileReaderImpl_next_rdh
/** * Go to the next key/value in the block section. Loads the next block if necessary. If * successful, {@link #getKey()} and {@link #getValue()} can be called. * * @return true if successfully navigated to the next key/value */ @Override public boolean next() throws IOException { // This is a hot method so ...
3.26
hbase_HFileReaderImpl_readNextDataBlock_rdh
/** * Scans blocks in the "scanned" section of the {@link HFile} until the next data block is * found. * * @return the next block, or null if there are no more data blocks */ @SuppressWarnings(value = "NP_NULL_ON_SOME_PATH", justification = "Yeah, unnecessary...
3.26
hbase_HFileReaderImpl_getMetaBlock_rdh
/** * * @param cacheBlock * Add block to cache, if found * @return block wrapped in a ByteBuffer, with header skipped */ @Override public HFileBlock getMetaBlock(String metaBlockName, boolean cacheBlock) throws IOException { if (trailer.getMetaIndexCount() == 0) { return null;// there are no meta blo...
3.26
hbase_HFileReaderImpl__readMvccVersion_rdh
/** * Actually do the mvcc read. Does no checks. */ private void _readMvccVersion(int offsetFromPos) { // This is Bytes#bytesToVint inlined so can save a few instructions in this hot method; i.e. // previous if one-byte vint, we'd redo the vint call to find int size. // Also the method is kept small so ca...
3.26
hbase_HFileReaderImpl_getLastRowKey_rdh
/** * TODO left from {@link HFile} version 1: move this to StoreFile after Ryan's patch goes in to * eliminate {@link KeyValue} here. * * @return the last row key, or null if the file is empty. */ @Override public Optional<byte[]> getLastRowKey() { // We have to copy the row part to form the row key alone ...
3.26
hbase_HFileReaderImpl_getGeneralBloomFilterMetadata_rdh
/** * Returns a buffer with the Bloom filter metadata. The caller takes ownership of the buffer. */ @Override public DataInput getGeneralBloomFilterMetadata() throws IOException { return this.getBloomFilterMetadata(BlockType.GENERAL_BLOOM_META); }
3.26
hbase_HFileReaderImpl_positionThisBlockBuffer_rdh
/** * Set the position on current backing blockBuffer. */private void positionThisBlockBuffer() { try { blockBuffer.skip(getCurCellSerializedSize()); } catch (IllegalArgumentException e) { LOG.error((((((((((("Current pos = " + blockBuffer.position()) + "; currKeyLen = ") + currKeyLen) + "; ...
3.26
hbase_HFileReaderImpl_getEntries_rdh
/** * Returns number of KV entries in this HFile */ @Override public long getEntries() { return trailer.getEntryCount(); }
3.26
hbase_HFileReaderImpl_getComparator_rdh
/** * Returns comparator */ @Override public CellComparator getComparator() { return this.hfileContext.getCellComparator(); }
3.26
hbase_HFileReaderImpl_getKVBufSize_rdh
// From non encoded HFiles, we always read back KeyValue or its descendant.(Note: When HFile // block is in DBB, it will be OffheapKV). So all parts of the Cell is in a contiguous // array/buffer. How many bytes we should wrap to make the KV is what this method returns. private int getKVBufSize() { int kvBufSize = ...
3.26
hbase_HFileReaderImpl_getUncachedBlockReader_rdh
/** * For testing */ @Override public FSReader getUncachedBlockReader() { return fsBlockReader; }
3.26
hbase_HFileReaderImpl_getCurCellSerializedSize_rdh
// Returns the #bytes in HFile for the current cell. Used to skip these many bytes in current // HFile block's buffer so as to position to the next cell. private int getCurCellSerializedSize() { int v1 = ((KEY_VALUE_LEN_SIZE + currKeyLen) + currValueLen) + currMemstoreTSLen; if (this.reader.getFileContext().isI...
3.26
hbase_HFileReaderImpl_prefetchComplete_rdh
/** * Returns false if block prefetching was requested for this file and has not completed, true * otherwise */ @Override public boolean prefetchComplete() { return PrefetchExecutor.isCompleted(path); }
3.26
hbase_HFileReaderImpl_positionForNextBlock_rdh
/** * Set our selves up for the next 'next' invocation, set up next block. * * @return True is more to read else false if at the end. */ private boolean positionForNextBlock() throws IOException { // Methods are small so they get inlined because they are 'hot'. long lastDataBlockOffset = reader.getTrailer()...
3.26
hbase_HFileReaderImpl_updateCurrentBlock_rdh
/** * Updates the current block to be the given {@link HFileBlock}. Seeks to the the first * key/value pair. * * @param newBlock * the block to make current, and read by {@link HFileReaderImpl#readBlock}, * it's a totally new block with new allocated {@link ByteBuff}, so if no * further reference to this b...
3.26
hbase_HFileReaderImpl_getCachedBlock_rdh
/** * Retrieve block from cache. Validates the retrieved block's type vs {@code expectedBlockType} * and its encoding vs. {@code expectedDataBlockEncoding}. Unpacks the block as necessary. */ private HFileBlock getCachedBlock(BlockCache...
3.26
hbase_HFileReaderImpl_m6_rdh
/** * Create a Scanner on this file. No seeks or reads are done on creation. Call * {@link HFileScanner#seekTo(Cell)} to position an start the read. There is nothing to clean up * in a Scanner. Letting go of your references to the scanner is sufficient. * * @param conf * Store configuration. * @param cacheBloc...
3.26
hbase_HFileReaderImpl_releaseIfNotCurBlock_rdh
/** * The curBlock will be released by shipping or close method, so only need to consider releasing * the block, which was read from HFile before and not referenced by curBlock. */ protected void releaseIfNotCurBlock(HFileBlock block) { if (curBlock != block) { block.release(); } }
3.26
hbase_HFileReaderImpl_getScanner_rdh
/** * Create a Scanner on this file. No seeks or reads are done on creation. Call * {@link HFileScanner#seekTo(Cell)} to position an start the read. There is nothing to clean up * in a Scanner. Letting go of your references to the scanner is sufficient. NOTE: Do not use this * overload of getScanner for compactions...
3.26
hbase_HFileReaderImpl_checkKeyValueLen_rdh
/** * Check key and value lengths are wholesome. */ protected final void checkKeyValueLen() {if (checkKeyLen(this.currKeyLen) || checkLen(this.currValueLen)) { throw new IllegalStateException(((((((((((("Invalid currKeyLen " + this.currKeyLen) + " or currValueLen ") + this.currValueLen) + ". Block offset: ") ...
3.26
hbase_HFileReaderImpl_validateBlockType_rdh
/** * Compares the actual type of a block retrieved from cache or disk with its expected type and * throws an exception in case of a mismatch. Expected block type of {@link BlockType#DATA} is * considered to match the actual block type [@link {@link BlockType#ENCODED_DATA} as well. * * @param block * a block re...
3.26
hbase_FamilyFilter_m0_rdh
/** * Parse the serialized representation of {@link FamilyFilter} * * @param pbBytes * A pb serialized {@link FamilyFilter} instance * @return An instance of {@link FamilyFilter} made from <code>bytes</code> * @throws DeserializationException * if an error occurred * @see #toByteArray */ public static Fami...
3.26
hbase_FamilyFilter_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 FamilyFilter)) { return fals...
3.26
hbase_FamilyFilter_toByteArray_rdh
/** * Returns The filter serialized using pb */ @Override public byte[] toByteArray() { FilterProtos.FamilyFilter.Builder builder = FilterProtos.FamilyFilter.newBuilder(); builder.setCompareFilter(super.convert()); return builder.build().toByteArray(); }
3.26
hbase_ByteBuffAllocator_getFreeBufferCount_rdh
/** * The {@link ConcurrentLinkedQueue#size()} is O(N) complexity and time-consuming, so DO NOT use * the method except in UT. */ public int getFreeBufferCount() { return this.buffers.size(); }
3.26
hbase_ByteBuffAllocator_m0_rdh
/** * Initialize an {@link ByteBuffAllocator} which will try to allocate ByteBuffers from off-heap if * reservoir is enabled and the reservoir has enough buffers, otherwise the allocator will just * allocate the insufficient buffers from on-heap to meet the requirement. * * @param conf * which get the arguments...
3.26