name
stringlengths
12
178
code_snippet
stringlengths
8
36.5k
score
float64
3.26
3.68
hbase_RestoreSnapshotProcedure_getMonitorStatus_rdh
/** * Set up monitor status if it is not created. */ private MonitoredTask getMonitorStatus() { if (monitorStatus == null) { monitorStatus = TaskMonitor.get().createStatus((("Restoring snapshot '" + snapshot.getName()) + "' to table ") + getTableName()); } return monitorStatus; }
3.26
hbase_RestoreSnapshotProcedure_prepareRestore_rdh
/** * Action before any real action of restoring from snapshot. * * @param env * MasterProcedureEnv */ private void prepareRestore(final MasterProcedureEnv env) throws IOException { final TableName tableName = getTableName(); // Checks whether the table exists if (!env.getMasterServices().getTableDes...
3.26
hbase_ModeStrategyUtils_aggregateRecords_rdh
/** * Group by records on the basis of supplied groupBy field and Aggregate records using * {@link Record#combine(Record)} * * @param records * records needs to be processed * @param groupBy * Field to be used for group by * @return aggregated records */public static List<Record> aggregateRecords(List<Reco...
3.26
hbase_RESTServletContainer_service_rdh
/** * This container is used only if authentication and impersonation is enabled. The remote request * user is used as a proxy user for impersonation in invoking any REST service. */ @Override public void service(final HttpServletRequest request, final HttpServletResponse response) throws ServletException, IOExcepti...
3.26
hbase_RSMobFileCleanerChore_archiveMobFiles_rdh
/** * Archives the mob files. * * @param conf * The current configuration. * @param tableName * The table name. * @param family * The name of the column family. * @param storeFiles * The files to be archived. * @throws IOException * exception */public void archiveMobFiles(Configuration conf, Tabl...
3.26
hbase_NoRegionSplitRestriction_initialize_rdh
/** * A {@link RegionSplitRestriction} implementation that does nothing. */ @InterfaceAudience.Privatepublic class NoRegionSplitRestriction extends RegionSplitRestriction { @Override public void initialize(TableDescriptor tableDescriptor, Configuration conf) throws IOException { }
3.26
hbase_BloomContext_m0_rdh
/** * Bloom information from the cell is retrieved */ public void m0(Cell cell) throws IOException { // only add to the bloom filter on a new, unique key if (isNewKey(cell)) { sanityCheck(cell); f0.append(cell); } }
3.26
hbase_Threads_setDaemonThreadRunning_rdh
/** * Utility method that sets name, daemon status and starts passed thread. * * @param t * thread to frob * @param name * new name * @param handler * A handler to set on the thread. Pass null if want to use default handler. * @return Returns the passed Thread <code>t</code>. */ public static <T extend...
3.26
hbase_Threads_sleepWithoutInterrupt_rdh
/** * Sleeps for the given amount of time even if interrupted. Preserves the interrupt status. * * @param msToWait * the amount of time to sleep in milliseconds */ public static void sleepWithoutInterrupt(final long msToWait) { long timeMillis = EnvironmentEdgeManager.currentTime(); long endTime = timeM...
3.26
hbase_Threads_printThreadInfo_rdh
/** * Print all of the thread's information and stack traces. Wrapper around Hadoop's method. * * @param stream * the stream to * @param title * a string title for the stack trace */ public static void printThreadInfo(PrintStream stream, String title) { ReflectionUtils.printThreadInfo(stream, title); }
3.26
hbase_Threads_isNonDaemonThreadRunning_rdh
/** * Checks whether any non-daemon thread is running. * * @return true if there are non daemon threads running, otherwise false */ public static boolean isNonDaemonThreadRunning() { AtomicInteger nonDaemonThreadCount = new AtomicInteger(); Set<Thread> threads = Thread.getAllStackTraces().keySet(); t...
3.26
hbase_Threads_sleep_rdh
/** * If interrupted, just prints out the interrupt on STDOUT, resets interrupt and returns * * @param millis * How long to sleep for in milliseconds. */ public static void sleep(long millis) { try { Thread.sleep(millis); } catch (InterruptedException e) {LOG.warn("sleep interrupted", e); ...
3.26
hbase_Threads_shutdown_rdh
/** * Shutdown passed thread using isAlive and join. * * @param joinwait * Pass 0 if we're to wait forever. * @param t * Thread to shutdown */ public static void shutdown(final Thread t, final long joinwait) { if (t == null) return; while (t.isAlive()) { try { t.join(joi...
3.26
hbase_Threads_threadDumpingIsAlive_rdh
/** * Waits on the passed thread to die dumping a threaddump every minute while its up. */ public static void threadDumpingIsAlive(final Thread t) throws InterruptedException { if (t == null) { return; } while (t.isAlive()) { t.join(60 * 1000); if (t.isAlive()) { print...
3.26
hbase_Threads_setLoggingUncaughtExceptionHandler_rdh
/** * Sets an UncaughtExceptionHandler for the thread which logs the Exception stack if the thread * dies. */ public static void setLoggingUncaughtExceptionHandler(Thread t) { t.setUncaughtExceptionHandler(LOGGING_EXCEPTION_HANDLER); }
3.26
hbase_RegionModeStrategy_selectModeFieldsAndAddCountField_rdh
/** * Form new record list with records formed by only fields provided through fieldInfo and add a * count field for each record with value 1 We are doing two operation of selecting and adding new * field because of saving some CPU cycles on rebuilding the record again * * @param fieldInfos * List of FieldInfos...
3.26
hbase_TableDescriptorUtils_computeDelta_rdh
/** * Compares two {@link TableDescriptor} and indicate which columns were added, deleted, or * modified from oldTD to newTD * * @return a TableDescriptorDelta that contains the added/deleted/modified column names */ public static TableDescriptorDelta computeDelta(TableDescriptor oldTD, TableDescriptor newTD) { ...
3.26
hbase_MultiVersionConcurrencyControl_advanceTo_rdh
/** * Step the MVCC forward on to a new read/write basis. */ public void advanceTo(long newStartPoint) { while (true) { long seqId = this.getWritePoint(); if (seqId >= newStartPoint) { break; } if (this.tryAdvanceTo(newStartPoint, seqId)) { break; } ...
3.26
hbase_MultiVersionConcurrencyControl_begin_rdh
/** * Start a write transaction. Create a new {@link WriteEntry} with a new write number and add it * to our queue of ongoing writes. Return this WriteEntry instance. To complete the write * transaction and wait for it to be visible, call {@link #completeAndWait(WriteEntry)}. If the * write failed, call {@link #com...
3.26
hbase_MultiVersionConcurrencyControl_completeAndWait_rdh
/** * Complete a {@link WriteEntry} that was created by {@link #begin()} then wait until the read * point catches up to our write. At the end of this call, the global read point is at least as * large as the write point of the passed in WriteEntry. Thus, the write is visible to MVCC * readers. */ public void compl...
3.26
hbase_MultiVersionConcurrencyControl_complete_rdh
/** * Mark the {@link WriteEntry} as complete and advance the read point as much as possible. Call * this even if the write has FAILED (AFTER backing out the write transaction changes completely) * so we can clean up the outstanding transaction. How much is the read point advanced? Let S be * the set of all write n...
3.26
hbase_MultiVersionConcurrencyControl_waitForRead_rdh
/** * Wait for the global readPoint to advance up to the passed in write entry number. */ void waitForRead(WriteEntry e) { boolean interrupted = false; int count = 0; synchronized(readWaiters) { while (readPoint.get() < e.getWriteNumber()) { if (((count % 100) == 0) && (count > 0)) { long totalWaitTillNow = READP...
3.26
hbase_MultiVersionConcurrencyControl_await_rdh
/** * Wait until the read point catches up to the write point; i.e. wait on all outstanding mvccs to * complete. */ public void await() { // Add a write and then wait on reads to catch up to it. completeAndWait(begin()); }
3.26
hbase_QuotaRetriever_open_rdh
/** * Open a QuotaRetriever with the specified filter. * * @param conf * Configuration object to use. * @param filter * the QuotaFilter * @return the QuotaRetriever * @throws IOException * if a remote or network exception occurs */ public static QuotaRetriever open(final Configuration conf, final QuotaF...
3.26
hbase_CellComparator_getInstance_rdh
/** * A comparator for ordering cells in user-space tables. Useful when writing cells in sorted order * as necessary for bulk import (i.e. via MapReduce). * <p> * CAUTION: This comparator may provide inaccurate ordering for cells from system tables, and * should not be relied upon in that case. */ // For internal...
3.26
hbase_HFileSystem_maybeWrapFileSystem_rdh
/** * Returns an instance of Filesystem wrapped into the class specified in hbase.fs.wrapper * property, if one is set in the configuration, returns unmodified FS instance passed in as an * argument otherwise. * * @param base * Filesystem instance to wrap * @param conf * Configuration * @return wrapped ins...
3.26
hbase_HFileSystem_close_rdh
/** * Close this filesystem object */ @Override public void close() throws IOException { super.close(); if (this.noChecksumFs != fs) { this.noChecksumFs.close();} }
3.26
hbase_HFileSystem_useHBaseChecksum_rdh
/** * Are we verifying checksums in HBase? * * @return True, if hbase is configured to verify checksums, otherwise false. */ public boolean useHBaseChecksum() { return useHBaseChecksum; }
3.26
hbase_HFileSystem_getStoragePolicyForOldHDFSVersion_rdh
/** * Before Hadoop 2.8.0, there's no getStoragePolicy method for FileSystem interface, and we need * to keep compatible with it. See HADOOP-12161 for more details. * * @param path * Path to get storage policy against * @return the storage policy name */ private String getStoragePolicyForOldHDFSVersion(Path pa...
3.26
hbase_HFileSystem_setStoragePolicy_rdh
/** * Set the source path (directory/file) to the specified storage policy. * * @param path * The source path (directory/file). * @param policyName * The name of the storage policy: 'HOT', 'COLD', etc. See see hadoop 2.6+ * org.apache.hadoop.hdfs.protocol.HdfsConstants for possible list e.g 'COLD', * 'W...
3.26
hbase_HFileSystem_getNoChecksumFs_rdh
/** * Returns the filesystem that is specially setup for doing reads from storage. This object avoids * doing checksum verifications for reads. * * @return The FileSystem object that can be used to read data from files. */ public FileSystem getNoChecksumFs() { return noChecksumFs; }
3.26
hbase_HFileSystem_createNonRecursive_rdh
/** * The org.apache.hadoop.fs.FilterFileSystem does not yet support createNonRecursive. This is a * hadoop bug and when it is fixed in Hadoop, this definition will go away. */ @Override @SuppressWarnings("deprecation") public FSDataOutputStream createNonRecursive(Path f, boolean overwrite, int bufferSize, short re...
3.26
hbase_HFileSystem_newInstanceFileSystem_rdh
/** * Returns a brand new instance of the FileSystem. It does not use the FileSystem.Cache. In newer * versions of HDFS, we can directly invoke FileSystem.newInstance(Configuration). * * @param conf * Configuration * @return A new instance of the filesystem */ private static FileSystem newInstanceFileSystem(Co...
3.26
hbase_HFileSystem_addLocationsOrderInterceptor_rdh
/** * Add an interceptor on the calls to the namenode#getBlockLocations from the DFSClient linked to * this FileSystem. See HBASE-6435 for the background. * <p/> * There should be no reason, except testing, to create a specific ReorderBlocks. * * @return true if the interceptor was added, false otherwise. */ sta...
3.26
hbase_HFileSystem_getBackingFs_rdh
/** * Returns the underlying filesystem * * @return The underlying FileSystem for this FilterFileSystem object. */ public FileSystem getBackingFs() throws IOException { return fs; }
3.26
hbase_ShutdownHookManager_addShutdownHook_rdh
// priority is ignored in hadoop versions earlier than 2.0 @Override public void addShutdownHook(Thread shutdownHookThread, int priority) { Runtime.getRuntime().addShutdownHook(shutdownHookThread); }
3.26
hbase_ActiveMasterManager_getBackupMasters_rdh
/** * Returns list of registered backup masters. */ public List<ServerName> getBackupMasters() { return backupMasters; }
3.26
hbase_ActiveMasterManager_hasActiveMaster_rdh
/** * Returns True if cluster has an active master. */ boolean hasActiveMaster() { try { if (ZKUtil.checkExists(watcher, watcher.getZNodePaths().masterAddressZNode) >= 0) { return true; } } catch (KeeperException ke) { LOG.info(("Received an unexpected KeeperException w...
3.26
hbase_ActiveMasterManager_handleMasterNodeChange_rdh
/** * Handle a change in the master node. Doesn't matter whether this was called from a nodeCreated * or nodeDeleted event because there are no guarantees that the current state of the master node * matches the event at the time of our next ZK request. * <p> * Uses the watchAndCheckExists method which watches the ...
3.26
hbase_ActiveMasterManager_setInfoPort_rdh
// will be set after jetty server is started public void setInfoPort(int infoPort) { this.infoPort = infoPort; }
3.26
hbase_ActiveMasterManager_fetchAndSetActiveMasterServerName_rdh
/** * Fetches the active master's ServerName from zookeeper. */ private void fetchAndSetActiveMasterServerName() {LOG.debug("Attempting to fetch active master sn from zk"); try { activeMasterServerName = MasterAddressTracker.getMasterAddress(watcher); } catch (IOException | KeeperException e) { ...
3.26
hbase_AggregationHelper_validateParameters_rdh
/** * * @param scan * the HBase scan object to use to read data from HBase * @param canFamilyBeAbsent * whether column family can be absent in familyMap of scan */ private static void validateParameters(Scan scan, boolean canFamilyBeAbsent) throws IOException { if (((scan == null) || (Bytes.equals(scan.g...
3.26
hbase_AggregationHelper_getParsedGenericInstance_rdh
/** * Get an instance of the argument type declared in a class's signature. The argument type is * assumed to be a PB Message subclass, and the instance is created using parseFrom method on the * passed ByteString. * * @param runtimeClass * the runtime type of the class * @param position * the position of t...
3.26
hbase_HBaseCluster_getServerHoldingMeta_rdh
/** * Get the ServerName of region server serving the first hbase:meta region */public ServerName getServerHoldingMeta() throws IOException { return getServerHoldingRegion(TableName.META_TABLE_NAME, RegionInfoBuilder.FIRST_META_REGIONINFO.getRegionName()); }
3.26
hbase_HBaseCluster_getInitialClusterMetrics_rdh
/** * Returns a ClusterStatus for this HBase cluster as observed at the starting of the HBaseCluster */ public ClusterMetrics getInitialClusterMetrics() throws IOException { return initialClusterStatus; }
3.26
hbase_HBaseCluster_waitForRegionServerToStart_rdh
/** * Wait for the specified region server to join the cluster * * @throws IOException * if something goes wrong or timeout occurs */ public void waitForRegionServerToStart(String hostname, int port, long timeout) throws IOException { long start = EnvironmentEdgeManager.currentTime(); while ((Environmen...
3.26
hbase_HBaseCluster_waitForNamenodeAvailable_rdh
/** * Wait for the namenode. */ public void waitForNamenodeAvailable() throws InterruptedException { }
3.26
hbase_HBaseCluster_waitForActiveAndReadyMaster_rdh
/** * Blocks until there is an active master and that master has completed initialization. * * @return true if an active master becomes available. false if there are no masters left. * @throws IOException * if something goes wrong or timeout occurs */ public boolean waitForActiveAndReadyMaster() throws IOExcept...
3.26
hbase_HBaseCluster_m2_rdh
/** * Restores the cluster to given state if this is a real cluster, otherwise does nothing. This is * a best effort restore. If the servers are not reachable, or insufficient permissions, etc. * restoration might be partial. * * @return whether restoration is complete */ public boolean m2(ClusterMetrics desire...
3.26
hbase_HBaseCluster_restoreInitialStatus_rdh
/** * Restores the cluster to it's initial state if this is a real cluster, otherwise does nothing. * This is a best effort restore. If the servers are not reachable, or insufficient permissions, * etc. restoration might be partial. * * @return whether restoration is complete */ public boolean restoreInitialStatu...
3.26
hbase_MetaBrowser_addParam_rdh
/** * Adds {@code value} to {@code encoder} under {@code paramName} when {@code value} is non-null. */ private void addParam(final QueryStringEncoder encoder, final String paramName, final Object value) { if (value != null) { encoder.addParam(paramName, value.toString()); } }
3.26
hbase_RackManager_getRack_rdh
/** * Same as {@link #getRack(ServerName)} except that a list is passed * * @param servers * list of servers we're requesting racks information for * @return list of racks for the given list of servers */ public List<String> getRack(List<ServerName> servers) { // just a note - switchMapping caches results (...
3.26
hbase_OrderedNumeric_encodeDouble_rdh
/** * Write instance {@code val} into buffer {@code dst}. * * @param dst * the {@link PositionedByteRange} to write to * @param val * the value to write to {@code dst} * @return the number of bytes written */ public int encodeDouble(PositionedByteRange dst, double val) { return OrderedBytes.encodeNumer...
3.26
hbase_OrderedNumeric_decodeDouble_rdh
/** * Read a {@code double} value from the buffer {@code src}. * * @param src * the {@link PositionedByteRange} to read the {@code double} from * @return the {@code double} read from the buffer */ public double decodeDouble(PositionedByteRange src) { return OrderedBytes.decodeNumericAsLong(src);}
3.26
hbase_OrderedNumeric_decodeLong_rdh
/** * Read a {@code long} value from the buffer {@code src}. * * @param src * the {@link PositionedByteRange} to read the {@code long} from * @return the {@code long} read from the buffer */ public long decodeLong(PositionedByteRange src) { return OrderedBytes.decodeNumericAsLong(src); }
3.26
hbase_OrderedNumeric_encodeLong_rdh
/** * Write instance {@code val} into buffer {@code dst}. * * @param dst * the {@link PositionedByteRange} to write to * @param val * the value to write to {@code dst} * @return the number of bytes written */ public int encodeLong(PositionedByteRange dst, long val) { return OrderedBytes.encodeNumeric(ds...
3.26
hbase_SnapshotScannerHDFSAclHelper_getGlobalRootPaths_rdh
/** * return paths that user will global permission will visit * * @return the path list */ List<Path> getGlobalRootPaths() { return Lists.newArrayList(pathHelper.getTmpDataDir(), pathHelper.getDataDir(), pathHelper.getMobDataDir(), pathHelper.getArchiveDataDir(), pathHelper.getSnapshotRootDir()); }
3.26
hbase_SnapshotScannerHDFSAclHelper_removeTableAcl_rdh
/** * Remove table acls when modify table * * @param tableName * the table * @param users * the table users with READ permission * @return false if an error occurred, otherwise true */ public boolean removeTableAcl(TableName tableName, Set<String> users) { try { long start = EnvironmentE...
3.26
hbase_SnapshotScannerHDFSAclHelper_addTableAcl_rdh
/** * Add table user acls * * @param tableName * the table * @param users * the table users with READ permission * @return false if an error occurred, otherwise true */ public boolean addTableAcl(TableName tableName, Set<String> users, String operation) { try { long start = EnvironmentEdgeManage...
3.26
hbase_SnapshotScannerHDFSAclHelper_grantAcl_rdh
/** * Set acl when grant user permission * * @param userPermission * the user and permission * @param skipNamespaces * the namespace set to skip set acl because already set * @param skipTables * the table set to skip set acl because already set * @return false if an error occurred, otherwise true */ pub...
3.26
hbase_SnapshotScannerHDFSAclHelper_getTableRootPaths_rdh
/** * return paths that user will table permission will visit * * @param tableName * the table * @param includeSnapshotPath * true if return table snapshots paths, otherwise false * @return the path list * @throws IOException * if an error occurred */ List<Path> getTableRootPaths(TableName tableName, bo...
3.26
hbase_SnapshotScannerHDFSAclHelper_getUsersWithGlobalReadAction_rdh
/** * Return users with global read permission * * @return users with global read permission * @throws IOException * if an error occurred */ private Set<String> getUsersWithGlobalReadAction() throws IOException { return getUsersWithReadAction(PermissionStorage.getGlobalPermissions(conf)); }
3.26
hbase_SnapshotScannerHDFSAclHelper_revokeAcl_rdh
/** * Remove acl when grant or revoke user permission * * @param userPermission * the user and permission * @param skipNamespaces * the namespace set to skip remove acl * @param skipTables * the table set to skip remove acl * @return false if an error occurred, otherwise true */ public boolean revokeAc...
3.26
hbase_SnapshotScannerHDFSAclHelper_getNamespaceRootPaths_rdh
/** * return paths that user will namespace permission will visit * * @param namespace * the namespace * @return the path list */ List<Path> getNamespaceRootPaths(String namespace) { return Lists.newArrayList(pathHelper.getTmpNsDir(namespace), pathHelper.getDataNsDir(namespace), pathHelper.getMobDataNsDir(names...
3.26
hbase_SnapshotScannerHDFSAclHelper_removeNamespaceDefaultAcl_rdh
/** * Remove default acl from namespace archive dir when delete namespace * * @param namespace * the namespace * @param removeUsers * the users whose default acl will be removed * @return false if an error occurred, otherwise true */ public boolean removeNamespaceDefaultAcl(String namespace, Set<String> rem...
3.26
hbase_SnapshotScannerHDFSAclHelper_getUsersWithTableReadAction_rdh
/** * Return users with table read permission * * @param tableName * the table * @param includeNamespace * true if include users with namespace read action * @param includeGlobal * true if include users with global read action * @return users with table read permission * @throws IOException * if an e...
3.26
hbase_SnapshotScannerHDFSAclHelper_getUsersWithNamespaceReadAction_rdh
/** * Return users with namespace read permission * * @param namespace * the namespace * @param includeGlobal * true if include users with global read action * @return users with namespace read permission * @throws IOException * if an error occurred */ Set<String> getUsersWithNamespaceReadAction(String ...
3.26
hbase_SnapshotScannerHDFSAclHelper_removeNamespaceAccessAcl_rdh
/** * Remove table access acl from namespace dir when delete table * * @param tableName * the table * @param removeUsers * the users whose access acl will be removed * @return false if an error occurred, otherwise true */ public boolean removeNamespaceAccessAcl(TableName tableName, Set<String> removeUsers, ...
3.26
hbase_SnapshotScannerHDFSAclHelper_removeTableDefaultAcl_rdh
/** * Remove default acl from table archive dir when delete table * * @param tableName * the table name * @param removeUsers * the users whose default acl will be removed * @return false if an error occurred, otherwise true */ public boolean removeTableDefaultAcl(TableName tableName, Set<String> removeUsers...
3.26
hbase_Put_addColumn_rdh
/** * Add the specified column and value, with the specified timestamp as its version to this Put * operation. * * @param family * family name * @param qualifier * column qualifier * @param ts * version timestamp * @param value * column value */ public Put addColumn(byte[] family, ByteBuffer qualifi...
3.26
hbase_Put_add_rdh
/** * Add the specified KeyValue to this Put operation. Operation assumes that the passed KeyValue is * immutable and its backing array will not be modified for the duration of this Put. * * @param cell * individual cell * @throws java.io.IOException * e */ @Override public Put add(Cell cell) throws IOExcep...
3.26
hbase_MajorCompactionTTLRequest_getColFamilyCutoffTime_rdh
// If the CF has no TTL, return -1, else return the current time - TTL. private long getColFamilyCutoffTime(ColumnFamilyDescriptor colDesc) { if (colDesc.getTimeToLive() == HConstants.FOREVER) { return -1; } return EnvironmentEdgeManager.currentTime() - (colDesc.getTimeToLive() * 1000L); }
3.26
hbase_MasterSnapshotVerifier_verifyTableInfo_rdh
/** * Check that the table descriptor for the snapshot is a valid table descriptor * * @param manifest * snapshot manifest to inspect */ private void verifyTableInfo(final SnapshotManifest manifest) throws IOException { TableDescriptor htd = manifest.getTableDescriptor(); if (htd == null) { throw new Corrupt...
3.26
hbase_MasterSnapshotVerifier_verifySnapshotDescription_rdh
/** * Check that the snapshot description written in the filesystem matches the current snapshot * * @param snapshotDir * snapshot directory to check */ private void verifySnapshotDescription(Path snapshotDir) throws CorruptedSnapshotException { SnapshotDescription found = Sna...
3.26
hbase_MasterSnapshotVerifier_verifyRegionInfo_rdh
/** * Verify that the regionInfo is valid * * @param region * the region to check * @param manifest * snapshot manifest to inspect */ private void verifyRegionInfo(final RegionInfo region, final SnapshotRegionManifest manifest) throws IOException { RegionInfo manifestRegionInfo = ProtobufUtil.toRegionInfo(m...
3.26
hbase_MasterSnapshotVerifier_verifySnapshot_rdh
/** * Verify that the snapshot in the directory is a valid snapshot * * @param snapshotDir * snapshot directory to check * @throws CorruptedSnapshotException * if the snapshot is invalid * @throws IOException * if there is an unexpected connection issue to the filesystem */ public void verifySnapshot(Pat...
3.26
hbase_MasterSnapshotVerifier_verifyRegions_rdh
/** * Check that all the regions in the snapshot are valid, and accounted for. * * @param manifest * snapshot manifest to inspect * @throws IOException * if we can't reach hbase:meta or read the files from the FS */ private void verifyRegions(SnapshotManifest manifest, boolean verifyRegions) throws IOExcepti...
3.26
hbase_RemoteProcedureException_serialize_rdh
/** * Converts a RemoteProcedureException to an array of bytes. * * @param source * the name of the external exception source * @param t * the "local" external exception (local) * @return protobuf serialized version of RemoteProcedureException */public static byte[] serialize(String source, Throwable t) {re...
3.26
hbase_RemoteProcedureException_deserialize_rdh
/** * Takes a series of bytes and tries to generate an RemoteProcedureException instance for it. * * @param bytes * the bytes to generate the {@link RemoteProcedureException} from * @return the ForeignExcpetion instance * @throws IOException * if there was deserialization problem this is thrown. */ public s...
3.26
hbase_RemoteProcedureException_unwrapRemoteIOException_rdh
// NOTE: Does not throw DoNotRetryIOE because it does not // have access (DNRIOE is in the client module). Use // MasterProcedureUtil.unwrapRemoteIOException if need to // throw DNRIOE. public IOException unwrapRemoteIOException() { final Exception cause = unwrapRemoteException(); if (cause instanceof IOExcepti...
3.26
hbase_ServerNonceManager_createCleanupScheduledChore_rdh
/** * Creates a scheduled chore that is used to clean up old nonces. * * @param stoppable * Stoppable for the chore. * @return ScheduledChore; the scheduled chore is not started. */ public ScheduledChore createCleanupScheduledChore(Stoppable stoppa...
3.26
hbase_ServerNonceManager_reportOperationFromWal_rdh
/** * Reports the operation from WAL during replay. * * @param group * Nonce group. * @param nonce * Nonce. * @param writeTime * Entry write time, used to ignore entries that are too old. */ public void reportOperationFromWal(long group, long nonce, long writeTime) { if (nonce == HConstants.NO_NONC...
3.26
hbase_ServerNonceManager_endOperation_rdh
/** * Ends the operation started by startOperation. * * @param group * Nonce group. * @param nonce * Nonce. * @param success * Whether the operation has succeeded. */ public void endOperation(long group, long nonce, boolean success) { if (nonce == HConstants.NO_NONCE) return; NonceKey nk...
3.26
hbase_ServerNonceManager_addMvccToOperationContext_rdh
/** * Store the write point in OperationContext when the operation succeed. * * @param group * Nonce group. * @param nonce * Nonce. * @param mvcc * Write point of the succeed operation. */ public void addMvccToOperationContext(long group, long nonce, long mvcc) { if (nonce == HConstants.NO_NONCE) {...
3.26
hbase_ServerNonceManager_startOperation_rdh
/** * Starts the operation if operation with such nonce has not already succeeded. If the operation * is in progress, waits for it to end and checks whether it has succeeded. * * @param group * Nonce group. * @param nonce * Nonce. * @param stoppable * Stoppable that terminates waiting (if any) when the s...
3.26
hbase_ServerNonceManager_getMvccFromOperationContext_rdh
/** * Return the write point of the previous succeed operation. * * @param group * Nonce group. * @param nonce * Nonce. * @return write point of the previous succeed operation. */ public long getMvccFromOperationContext(long group, long nonce) { if (nonce == HConstants.NO_NONCE) { return Long.MA...
3.26
hbase_FSHLogProvider_createWriter_rdh
/** * Public because of FSHLog. Should be package-private */ public static Writer createWriter(final Configuration conf, final FileSystem fs, final Path path, final boolean overwritable, long blocksize) throws IOException { // Configuration already does caching for the Class lookup. Class<? extends Writer>...
3.26
hbase_ZKReplicationQueueStorageForMigration_listAllHFileRefs_rdh
/** * Pair&lt;PeerId, List&lt;HFileRefs&gt;&gt; */@SuppressWarnings("unchecked") public MigrationIterator<Pair<String, List<String>>> listAllHFileRefs() throws KeeperException { List<String> peerIds = ZKUtil.listChildrenNoWatch(zookeeper, hfileRefsZNode); if ((peerIds == null) || peerIds.isEmpty()) { ...
3.26
hbase_PBType_inputStreamFromByteRange_rdh
/** * Create a {@link CodedInputStream} from a {@link PositionedByteRange}. Be sure to update * {@code src}'s position after consuming from the stream. * <p/> * For example: * * <pre> * Foo.Builder builder = ... * CodedInputStream is = inputStreamFromByteRange(src); * Foo ret = builder.mergeFrom(is).build(); ...
3.26
hbase_PBType_outputStreamFromByteRange_rdh
/** * Create a {@link CodedOutputStream} from a {@link PositionedByteRange}. Be sure to update * {@code dst}'s position after writing to the stream. * <p/> * For example: * * <pre> * CodedOutputStream os = outputStreamFromByteRange(dst); * int before = os.spaceLeft(), after, written; * val.writeTo(os); * afte...
3.26
hbase_IpcClientSpanBuilder_getRpcPackageAndService_rdh
/** * Retrieve the combined {@code $package.$service} value from {@code sd}. */ public static String getRpcPackageAndService(final Descriptors.ServiceDescriptor sd) { // it happens that `getFullName` returns a string in the $package.$service format required by // the otel RPC specification. Use it for now; mi...
3.26
hbase_IpcClientSpanBuilder_populateMethodDescriptorAttributes_rdh
/** * Static utility method that performs the primary logic of this builder. It is visible to other * classes in this package so that other builders can use this functionality as a mix-in. * * @param attributes * the attributes map to be populated. * @param md * the source of the RPC attribute values. */ st...
3.26
hbase_IpcClientSpanBuilder_getRpcName_rdh
/** * Retrieve the {@code $method} value from {@code md}. */ public static String getRpcName(final Descriptors.MethodDescriptor md) {return md.getName(); }
3.26
hbase_ReplicationStorageFactory_getReplicationPeerStorage_rdh
/** * Create a new {@link ReplicationPeerStorage}. */ public static ReplicationPeerStorage getReplicationPeerStorage(FileSystem fs, ZKWatcher zk, Configuration conf) { Class<? extends ReplicationPeerStorage> clazz = getReplicationPeerStorageClass(conf); for (Constructor<?> c : clazz.getConstructors()) { ...
3.26
hbase_ReplicationStorageFactory_getReplicationQueueStorage_rdh
/** * Create a new {@link ReplicationQueueStorage}. */ public static ReplicationQueueStorage getReplicationQueueStorage(Connection conn, Configuration conf, TableName tableName) { Class<? extends ReplicationQueueStorage> clazz = conf.getClass(REPLICATION_QUEUE_IMPL, TableReplicationQueueStorage.class, Replicat...
3.26
hbase_TableDescriptors_update_rdh
/** * Add or update descriptor. Just call {@link #update(TableDescriptor, boolean)} with * {@code cacheOnly} as {@code false}. */ default void update(TableDescriptor htd) throws IOException { m0(htd, false); }
3.26
hbase_TableDescriptors_exists_rdh
/** * Get, remove and modify table descriptors. */ @InterfaceAudience.Privatepublic interface TableDescriptors extends Closeable { /** * Test whether a given table exists, i.e, has a table descriptor. */ default boolean exists(TableName tableName) throws IOException { return get(tableName...
3.26
hbase_AsyncConnectionImpl_getNonceGenerator_rdh
// ditto NonceGenerator getNonceGenerator() { return nonceGenerator; }
3.26
hbase_AsyncConnectionImpl_getChoreService_rdh
/** * If choreService has not been created yet, create the ChoreService. */ synchronized ChoreService getChoreService() { if (isClosed()) { throw new IllegalStateException("connection is already closed"); } if (choreService == null) { choreService = new ChoreService("AsyncConn Chore Se...
3.26
hbase_AsyncConnectionImpl_getLocator_rdh
// we will override this method for testing retry caller, so do not remove this method. AsyncRegionLocator getLocator() { return locator; }
3.26