name stringlengths 12 178 | code_snippet stringlengths 8 36.5k | score float64 3.26 3.68 |
|---|---|---|
hbase_CompactSplit_isUnderCompaction_rdh | /**
* Check if this store is under compaction
*/
public boolean isUnderCompaction(final HStore s) {
return underCompactionStores.contains(getStoreNameForUnderCompaction(s));
} | 3.26 |
hbase_CompactSplit_getLongCompactions_rdh | /**
* Returns the longCompactions thread pool executor
*/
ThreadPoolExecutor getLongCompactions() {
return longCompactions;
} | 3.26 |
hbase_CompactSplit_onConfigurationChange_rdh | /**
* {@inheritDoc }
*/
@Override
public void onConfigurationChange(Configuration newConf) {
// Check if number of large / small compaction threads has changed, and then
// adjust the core pool size of the thread pools, by using the
// setCorePoolSize() method. According to the javadocs, it is safe to
... | 3.26 |
hbase_CompactSplit_requestSplit_rdh | /* The User parameter allows the split thread to assume the correct user identity */
private synchronized void requestSplit(final Region r, byte[] midKey, User user) {
if (midKey == null) {
LOG.debug(("Region " + r.getRegionInfo().getRegionNameAsString()) + " not splittable because midkey=null");
re... | 3.26 |
hbase_CompactSplit_shutdownLongCompactions_rdh | /**
* Shutdown the long compaction thread pool. Should only be used in unit test to prevent long
* compaction thread pool from stealing job from short compaction queue
*/
void shutdownLongCompactions() {
this.longCompactions.shutdown();
} | 3.26 |
hbase_CompactSplit_interruptIfNecessary_rdh | /**
* Only interrupt once it's done with a run through the work loop.
*/
void interruptIfNecessary() {
splits.shutdown();
longCompactions.shutdown();
shortCompactions.shutdown();
} | 3.26 |
hbase_CompactSplit_requestCompactionInternal_rdh | // set protected for test
protected void requestCompactionInternal(HRegion region, HStore store, String why, int priority, boolean selectNow, CompactionLifeCycleTracker tracker, CompactionCompleteTracker completeTracker, User user) throws IOException {
if (!this.isCompactionsEnabled()) {
LOG.info(("Ignorin... | 3.26 |
hbase_ByteBufferKeyOnlyKeyValue_m0_rdh | // The position in BB where the family length is added.
private int m0() {
return getFamilyLengthPosition(getRowLength());
} | 3.26 |
hbase_ByteBufferKeyOnlyKeyValue_setKey_rdh | /**
* A setter that helps to avoid object creation every time and whenever there is a need to create
* new OffheapKeyOnlyKeyValue.
*
* @param key
* - the key part of the cell
* @param offset
* - offset of the cell
* @param length
* - length of the cell
* @param rowLen
* - the rowlen part of the cell
... | 3.26 |
hbase_MetricsMasterQuotaSourceImpl_m0_rdh | /**
* Summarizes the usage and limit for many targets (table or namespace) into JSON.
*/
private String m0(Iterable<Entry<String, Entry<Long, Long>>> data, String target) {
StringBuilder sb = new StringBuilder();
for (Entry<String, Entry<Long, Long>> tableUsage : data) {
String tableName = tableUsage.... | 3.26 |
hbase_AssignReplicationQueuesProcedure_shouldSkip_rdh | // check whether ReplicationSyncUp has already done the work for us, if so, we should skip
// claiming the replication queues and deleting them instead.
private boolean shouldSkip(MasterProcedureEnv env) throws IOException {
MasterFileSystem v14 = env.getMasterFileSystem();
Path syncUpDir = new Path(v14.getRoo... | 3.26 |
hbase_SecurityInfo_getInfo_rdh | /**
* Returns the security configuration associated with the given service name.
*/
public static SecurityInfo getInfo(String serviceName) {
return infos.get(serviceName);
} | 3.26 |
hbase_SecurityInfo_addInfo_rdh | /**
* Adds a security configuration for a new service name. Note that this will have no effect if the
* service name was already registered.
*/
public static void addInfo(String serviceName, SecurityInfo securityInfo) {
infos.putIfAbsent(serviceName, securityInfo);
} | 3.26 |
hbase_LockAndQueue_releaseExclusiveLock_rdh | /**
* Returns whether we should wake the procedures waiting on the lock here.
*/
public boolean releaseExclusiveLock(Procedure<?> proc) {
if ((exclusiveLockOwnerProcedure == null) || (exclusiveLockOwnerProcedure.getProcId() != proc.getProcId())) {
// We are not the lock owner, it is probably inherited from the p... | 3.26 |
hbase_LockAndQueue_releaseSharedLock_rdh | /**
* Returns whether we should wake the procedures waiting on the lock here.
*/
public boolean releaseSharedLock() {// hasExclusiveLock could be true, it usually means we acquire shared lock while we or our
// parent have held the xlock. And since there is still an exclusive lock, we do not need to
// wake a... | 3.26 |
hbase_LockAndQueue_trySharedLock_rdh | // ======================================================================
// try/release Shared/Exclusive lock
// ======================================================================
/**
* Returns whether we have succesfully acquired the shared lock.
*/
public boolean trySharedLock(Procedure<?> proc) {
if (ha... | 3.26 |
hbase_NamespaceStateManager_checkAndUpdateNamespaceRegionCount_rdh | /**
* Check and update region count for an existing table. To handle scenarios like restore snapshot
*
* @param name
* name of the table for region count needs to be checked and updated
* @param incr
* count of regions
* @throws QuotaExceededException
* if quota exceeds for the number of regions allowed i... | 3.26 |
hbase_NamespaceStateManager_deleteNamespace_rdh | /**
* Delete the namespace state.
*
* @param namespace
* the name of the namespace to delete
*/
void deleteNamespace(String namespace) {
this.nsStateCache.remove(namespace);
} | 3.26 |
hbase_NamespaceStateManager_initialize_rdh | /**
* Initialize namespace state cache by scanning meta table.
*/
private void initialize() throws IOException {
List<NamespaceDescriptor> namespaces = this.f0.getClusterSchema().getNamespaces();
for (NamespaceDescriptor namespace : namespaces) {
addNamespace(namespace.getName());
List<TableNa... | 3.26 |
hbase_NamespaceStateManager_start_rdh | /**
* Starts the NamespaceStateManager. The boot strap of cache is done in the post master start hook
* of the NamespaceAuditor class.
*
* @throws IOException
* Signals that an I/O exception has occurred.
*/
public void start() throws IOException {
LOG.info("Namespace State Manager started.");
initializ... | 3.26 |
hbase_NamespaceStateManager_getState_rdh | /**
* Gets an instance of NamespaceTableAndRegionInfo associated with namespace.
*
* @param name
* The name of the namespace
* @return An instance of NamespaceTableAndRegionInfo.
*/
public NamespaceTableAndRegionInfo getState(String name)
{
return nsStateCache.get(name);
} | 3.26 |
hbase_IncreasingToUpperBoundRegionSplitPolicy_getCountOfCommonTableRegions_rdh | /**
* Returns Count of regions on this server that share the table this.region belongs to
*/
private int getCountOfCommonTableRegions() {
RegionServerServices rss = region.getRegionServerServices();
// Can be null in tests
if (rss ==
null) {
return 0;
}
TableName tablename = region.get... | 3.26 |
hbase_CommonFSUtils_getWALRegionDir_rdh | /**
* Returns the WAL region directory based on the given table name and region name
*
* @param conf
* configuration to determine WALRootDir
* @param tableName
* Table that the region is under
* @param encodedRegionName
* Region name used for creating the final region directory
* @return the region direc... | 3.26 |
hbase_CommonFSUtils_getDefaultBlockSize_rdh | /**
* Return the number of bytes that large input files should be optimally be split into to minimize
* i/o time.
*
* @param fs
* filesystem object
* @return the default block size for the path's filesystem
*/
public static long getDefaultBlockSize(final FileSystem fs, final Path path) {
return fs.getDefaultB... | 3.26 |
hbase_CommonFSUtils_getWrongWALRegionDir_rdh | /**
* For backward compatibility with HBASE-20734, where we store recovered edits in a wrong
* directory without BASE_NAMESPACE_DIR. See HBASE-22617 for more details.
*
* @deprecated For compatibility, will be removed in 4.0.0.
*/
@Deprecated
public static Path getWrongWALRegionDir(final Configuration conf, final ... | 3.26 |
hbase_CommonFSUtils_getDefaultReplication_rdh | /* Get the default replication.
@param fs filesystem object
@param f path of file
@return default replication for the path's filesystem
*/
public static short getDefaultReplication(final FileSystem fs, final Path path) {
return fs.getDefaultReplication(path);
} | 3.26 |
hbase_CommonFSUtils_isHDFS_rdh | /**
* Return true if this is a filesystem whose scheme is 'hdfs'.
*
* @throws IOException
* from underlying FileSystem
*/
public static boolean isHDFS(final Configuration conf) throws IOException {
FileSystem fs = FileSystem.get(conf);
String scheme = fs.getUri().getScheme();
return scheme.equalsIgnoreCase("hdfs... | 3.26 |
hbase_CommonFSUtils_removeWALRootPath_rdh | /**
* Checks for the presence of the WAL log root path (using the provided conf object) in the given
* path. If it exists, this method removes it and returns the String representation of remaining
* relative path.
*
* @param path
* must not be null
* @param conf
* must not be null
* @return String represen... | 3.26 |
hbase_CommonFSUtils_listLocatedStatus_rdh | /**
* Calls fs.listFiles() to get FileStatus and BlockLocations together for reducing rpc call
*
* @param fs
* file system
* @param dir
* directory
* @return LocatedFileStatus list
*/
public static List<LocatedFileStatus> listLocatedStatus(final FileSystem fs, final Path dir) throws IOException {
List<Loca... | 3.26 |
hbase_CommonFSUtils_delete_rdh | /**
* Calls fs.delete() and returns the value returned by the fs.delete()
*
* @param fs
* must not be null
* @param path
* must not be null
* @param recursive
* delete tree rooted at path
* @return the value returned by the fs.delete()
* @throws IOException
* from underlying FileSystem
*/
public sta... | 3.26 |
hbase_CommonFSUtils_listStatus_rdh | /**
* Calls fs.listStatus() and treats FileNotFoundException as non-fatal This would accommodates
* differences between hadoop versions
*
* @param fs
* file system
* @param dir
* directory
* @return null if dir is empty or doesn't exist, otherwise FileStatus array
*/
public static FileStatus[] listStatus(f... | 3.26 |
hbase_CommonFSUtils_isExists_rdh | /**
* Calls fs.exists(). Checks if the specified path exists
*
* @param fs
* must not be null
* @param path
* must not be null
* @return the value returned by fs.exists()
* @throws IOException
* from underlying FileSystem
*/
public static boolean isExists(final FileSystem fs, final Path
path) throws IOE... | 3.26 |
hbase_CommonFSUtils_create_rdh | /**
* Create the specified file on the filesystem. By default, this will:
* <ol>
* <li>apply the umask in the configuration (if it is enabled)</li>
* <li>use the fs configured buffer size (or 4096 if not set)</li>
* <li>use the default replication</li>
* <li>use the default block size</li>
* <li>not track progre... | 3.26 |
hbase_CommonFSUtils_invokeSetStoragePolicy_rdh | /* All args have been checked and are good. Run the setStoragePolicy invocation. */
private static void invokeSetStoragePolicy(final FileSystem fs, final Path path, final String storagePolicy) throws IOException {
Exception toThrow = null;
try {
fs.setStoragePolicy(path, storagePolicy);
LOG.debug("Set storagePolicy={} ... | 3.26 |
hbase_CommonFSUtils_getDirUri_rdh | /**
* Returns the URI in the string format
*
* @param c
* configuration
* @param p
* path
* @return - the URI's to string format
*/
public static String getDirUri(final Configuration c, Path p) throws IOException {
if (p.toUri().getScheme() != null) {
return p.toUri().toString();
}
return null;
} | 3.26 |
hbase_CommonFSUtils_validateRootPath_rdh | /**
* Verifies root directory path is a valid URI with a scheme
*
* @param root
* root directory path
* @return Passed <code>root</code> argument.
* @throws IOException
* if not a valid URI with a scheme
*/
public static Path validateRootPath(Path root) throws
IOException {
try {
URI rootURI = new URI(... | 3.26 |
hbase_CommonFSUtils_isRecoveredEdits_rdh | /**
* Checks if the given path is the one with 'recovered.edits' dir.
*
* @param path
* must not be null
* @return True if we recovered edits
*/
public static boolean isRecoveredEdits(Path path) {
return path.toString().contains(HConstants.RECOVERED_EDITS_DIR); } | 3.26 |
hbase_CommonFSUtils_getPath_rdh | /**
* Return the 'path' component of a Path. In Hadoop, Path is a URI. This method returns the 'path'
* component of a Path's URI: e.g. If a Path is
* <code>hdfs://example.org:9000/hbase_trunk/TestTable/compaction.dir</code>, this method returns
* <code>/hbase_trunk/TestTable/compaction.dir</code>. This method is u... | 3.26 |
hbase_CommonFSUtils_getTableDir_rdh | /**
* Returns the {@link org.apache.hadoop.fs.Path} object representing the table directory under
* path rootdir
*
* @param rootdir
* qualified path of HBase root directory
* @param tableName
* name of table
* @return {@link org.apache.hadoop.fs.Path} for table
*/
public static Path getTableDir(Path rootdi... | 3.26 |
hbase_CommonFSUtils_m1_rdh | /**
* Sets storage policy for given path. If the passed path is a directory, we'll set the storage
* policy for all files created in the future in said directory. Note that this change in storage
* policy takes place at the FileSystem level; it will persist beyond this RS's lifecycle. If
* we're running on a versio... | 3.26 |
hbase_CommonFSUtils_logFSTree_rdh | /**
* Recursive helper to log the state of the FS
*
* @see #logFileSystemState(FileSystem, Path, Logger)
*/
private static void logFSTree(Logger log, final FileSystem fs, final Path root, String prefix) throws IOException {
FileStatus[] files = listStatus(fs, root, null);
if (files == null) {
return;
}
for (FileSt... | 3.26 |
hbase_CommonFSUtils_getRootDir_rdh | /**
* Get the path for the root data directory
*
* @param c
* configuration
* @return {@link Path} to hbase root directory from configuration as a qualified Path.
* @throws IOException
* e
*/
public static Path getRootDir(final Configuration c) throws IOException {
Path p = new Path(c.get(HConstants.HBASE_D... | 3.26 |
hbase_CommonFSUtils_checkShortCircuitReadBufferSize_rdh | /**
* Check if short circuit read buffer size is set and if not, set it to hbase value.
*
* @param conf
* must not be null
*/
public static void checkShortCircuitReadBufferSize(final Configuration conf) {
final int defaultSize = HConstants.DEFAULT_BLOCKSIZE * 2;
final int notSet = -1;
// DFSConfigKeys.DFS_CLIEN... | 3.26 |
hbase_CommonFSUtils_isMatchingTail_rdh | /**
* Compare path component of the Path URI; e.g. if hdfs://a/b/c and /a/b/c, it will compare the
* '/a/b/c' part. If you passed in 'hdfs://a/b/c and b/c, it would return true. Does not consider
* schema; i.e. if schemas different but path or subpath matches, the two will equate.
*
* @param pathToSearch
* Path... | 3.26 |
hbase_CommonFSUtils_deleteDirectory_rdh | /**
* Delete if exists.
*
* @param fs
* filesystem object
* @param dir
* directory to delete
* @return True if deleted <code>dir</code>
* @throws IOException
* e
*/
public static boolean deleteDirectory(final FileSystem fs, final Path dir) throws IOException {
return fs.exists(dir) && fs.delete(dir, tru... | 3.26 |
hbase_CommonFSUtils_logFileSystemState_rdh | /**
* Log the current state of the filesystem from a certain root directory
*
* @param fs
* filesystem to investigate
* @param root
* root file/directory to start logging from
* @param log
* log to output information
* @throws IOException
* if an unexpected exception occurs
*/
public static void logF... | 3.26 |
hbase_CommonFSUtils_getTableName_rdh | /**
* Returns the {@link org.apache.hadoop.hbase.TableName} object representing the table directory
* under path rootdir
*
* @param tablePath
* path of table
* @return {@link org.apache.hadoop.fs.Path} for table
*/
public static TableName getTableName(Path tablePath) {
return TableName.valueOf(tablePath.getP... | 3.26 |
hbase_CommonFSUtils_m0_rdh | /**
* Compare of path component. Does not consider schema; i.e. if schemas different but
* <code>path</code> starts with <code>rootPath</code>, then the function returns true
*
* @param rootPath
* value to check for
* @param path
* subject to check
* @return True if <code... | 3.26 |
hbase_CommonFSUtils_getWALTableDir_rdh | /**
* Returns the Table directory under the WALRootDir for the specified table name
*
* @param conf
* configuration used to get the WALRootDir
* @param tableName
* Table to get the directory for
* @return a path to the WAL table directory for the specified table
* @throws IOException
* if there is an exc... | 3.26 |
hbase_CommonFSUtils_getCurrentFileSystem_rdh | /**
* Returns the filesystem of the hbase rootdir.
*
* @throws IOException
* from underlying FileSystem
*/
public static FileSystem getCurrentFileSystem(Configuration conf) throws IOException {
return getRootDir(conf).getFileSystem(conf);
} | 3.26 |
hbase_CommonFSUtils_getDefaultBufferSize_rdh | /**
* Returns the default buffer size to use during writes. The size of the buffer should probably be
* a multiple of hardware page size (4096 on Intel x86), and it determines how much data is
* buffered during read and write operations.
*
* @param fs
* filesystem object
* @return default buffer size to use du... | 3.26 |
hbase_DirScanPool_onConfigurationChange_rdh | /**
* Checks if pool can be updated. If so, mark for update later.
*
* @param conf
* configuration
*/@Override
public synchronized void onConfigurationChange(Configuration conf) {int newSize = CleanerChore.calculatePoolSize(conf.get(f0.cleanerPoolSizeConfigName, f0.cleanerPoolSizeConfigDefault));
if (newSiz... | 3.26 |
hbase_SegmentScanner_getHighest_rdh | /**
* Private internal method that returns the higher of the two key values, or null if they are both
* null
*/
private Cell getHighest(Cell first, Cell second) {
if ((first == null) && (second == null))
{
return null;
}
if ((first != null) && (second != null)) {
int compare = segmen... | 3.26 |
hbase_SegmentScanner_reseek_rdh | /**
* Reseek the scanner at or after the specified KeyValue. This method is guaranteed to seek at or
* after the required key only if the key comes after the current position of the scanner. Should
* not be used to seek to a key which may come before the current position.
*
* @param cell
* seek value (should be... | 3.26 |
hbase_SegmentScanner_toString_rdh | // debug method
@Override
public String
toString() {
String res = ("Store segment scanner of type " + this.getClass().getName()) + "; ";
res += ("Scanner order " + getScannerOrder()) + "; ";
res += getSegment().toString();
return res;
} | 3.26 |
hbase_SegmentScanner_realSeekDone_rdh | /**
* This scanner is working solely on the in-memory MemStore and doesn't work on store files,
* MutableCellSetSegmentScanner always does the seek, therefore always returning true.
*/
@Override
public boolean realSeekDone() {return true;
} | 3.26 |
hbase_SegmentScanner_seek_rdh | /**
* Seek the scanner at or after the specified Cell.
*
* @param cell
* seek value
* @return true if scanner has values left, false if end of scanner
*/
@Override
public boolean seek(Cell cell) throws IOException {
if (closed) {
return false;
}
if (cell == null)
{
close();
... | 3.26 |
hbase_SegmentScanner_getSegment_rdh | /**
* ******************* Private Methods *********************
*/
private Segment getSegment() {
return segment;
} | 3.26 |
hbase_SegmentScanner_backwardSeek_rdh | /**
* Seek the scanner at or before the row of specified Cell, it firstly tries to seek the scanner
* at or after the specified Cell, return if peek KeyValue of scanner has the same row with
* specified Cell, otherwise seek the scanner at the first Cell of the row which is the previous
* row of specified KeyValue
... | 3.26 |
hbase_SegmentScanner_shipped_rdh | /**
* Called after a batch of rows scanned (RPC) and set to be returned to client. Any in between
* cleanup can be done here. Nothing to be done for MutableCellSetSegmentScanner.
*/
@Override
public void shipped() throws IOException {
// do nothing
} | 3.26 |
hbase_SegmentScanner_m0_rdh | /**
* Look at the next Cell in this scanner, but do not iterate the scanner
*
* @return the currently observed Cell
*/
@Override
public Cell m0() {
// sanity check, the current should be always valid
if (closed) {
return null;
}
if ((current != null) && (current.getSequenceId() > readPoint... | 3.26 |
hbase_SegmentScanner_seekToLastRow_rdh | /**
* Seek the scanner at the first KeyValue of last row
*
* @return true if scanner has values left, false if the underlying data is empty
*/
@Override
public boolean seekToLastRow() throws IOException {
if (closed) {
return false;
}
Cell v7 =
(segment.isEmpty()) ?
null : segment.last()... | 3.26 |
hbase_SegmentScanner_updateCurrent_rdh | /**
* Private internal method for iterating over the segment, skipping the cells with irrelevant MVCC
*/
protected void updateCurrent() {
Cell next = null;
try {
while
(f0.hasNext()) {
next =
f0.next();
if (next.getSequenceId() <= this.readPoint) {
current = next;
... | 3.26 |
hbase_SegmentScanner_isFileScanner_rdh | /**
* Returns true if this is a file scanner. Otherwise a memory scanner is assumed.
*/
@Override
public boolean isFileScanner()
{
return false;
} | 3.26 |
hbase_SegmentScanner_close_rdh | /**
* Close the KeyValue scanner.
*/
@Override
public void close() {
if (closed) {
return;
}
getSegment().decScannerCount();
closed = true;
} | 3.26 |
hbase_SegmentScanner_enforceSeek_rdh | /**
* This function should be never called on scanners that always do real seek operations (i.e. most
* of the scanners and also this one). The easiest way to achieve this is to call
* {@link #realSeekDone()} first.
*/
@Override
public void enforceSeek() throws IOException {
throw new NotImplementedException("e... | 3.26 |
hbase_SegmentScanner_shouldUseScanner_rdh | /**
* This functionality should be resolved in the higher level which is MemStoreScanner, currently
* returns true as default. Doesn't throw IllegalStateException in order not to change the
* signature of the overridden method
*/
@Override
public boolean shouldUseScanner(Scan scan, HStore store, long oldestUnexpire... | 3.26 |
hbase_SnapshotDescriptionUtils_getCorruptedFlagFileForSnapshot_rdh | /**
* Get the flag file path if the snapshot is corrupted
*
* @param workingDir
* the directory where we build the specific snapshot
* @return {@link Path} snapshot corrupted flag file path
*/
public static Path getCorruptedFlagFileForSnapshot(final Path workingDir)
{
return new Path(workingDir, SNAPSHOT_CO... | 3.26 |
hbase_SnapshotDescriptionUtils_getSpecifiedSnapshotDir_rdh | /**
* Get the directory within the given filepath to store the snapshot instance
*
* @param snapshotsDir
* directory to store snapshot directory within
* @param snapshotName
* name of the snapshot to take
* @return the final directory for the snapshot in the given filepath
*/
private static final Path getSp... | 3.26 |
hbase_SnapshotDescriptionUtils_getCompletedSnapshotDir_rdh | /**
* Get the directory for a completed snapshot. This directory is a sub-directory of snapshot root
* directory and all the data files for a snapshot are kept under this directory.
*
* @param snapshotName
* name of the snapshot being taken
* @param rootDir
* hbase root directory
* @return the final directo... | 3.26 |
hbase_SnapshotDescriptionUtils_getSnapshotsDir_rdh | /**
*
* @param rootDir
* hbase root directory
* @return the directory for all completed snapshots;
*/
public static final Path getSnapshotsDir(Path rootDir) {
return new Path(rootDir, HConstants.SNAPSHOT_DIR_NAME);
} | 3.26 |
hbase_SnapshotDescriptionUtils_isExpiredSnapshot_rdh | /**
* Method to check whether TTL has expired for specified snapshot creation time and snapshot ttl.
* NOTE: For backward compatibility (after the patch deployment on HMaster), any snapshot with ttl
* 0 is to be considered as snapshot to keep FOREVER. Default ttl value specified by
* {@link HConstants#DEFAULT_SNAPS... | 3.26 |
hbase_SnapshotDescriptionUtils_getDefaultWorkingSnapshotDir_rdh | /**
* Get the default working directory for snapshots - where they are built, where they are
* temporarily copied on export, etc.
*
* @param rootDir
* root directory of the HBase installation
* @return Path to the default snapshot tmp directory, relative to the passed root directory
*/
private static Path getD... | 3.26 |
hbase_SnapshotDescriptionUtils_readSnapshotInfo_rdh | /**
* Read in the {@link SnapshotDescription} stored for the snapshot in the passed directory
*
* @param fs
* filesystem where the snapshot was taken
* @param snapshotDir
* directory where the snapshot was stored
* @return the stored snapshot description
* @throws CorruptedSnapshotException
* if the snap... | 3.26 |
hbase_SnapshotDescriptionUtils_getSnapshotRootDir_rdh | /**
* Get the snapshot root directory. All the snapshots are kept under this directory, i.e.
* ${hbase.rootdir}/.snapshot
*
* @param rootDir
* hbase root directory
* @return the base directory in which all snapshots are kept
*/
public static Path getSnapshotRootDir(final Path rootDir) {
return new Path(ro... | 3.26 |
hbase_SnapshotDescriptionUtils_completeSnapshot_rdh | /**
* Commits the snapshot process by moving the working snapshot to the finalized filepath
*
* @param snapshotDir
* The file path of the completed snapshots
* @param workingDir
* The file path of the in progress snapshots
* @param fs
* The file system of the completed snapshots
* @param workingDirFs
* ... | 3.26 |
hbase_SnapshotDescriptionUtils_getMaxMasterTimeout_rdh | /**
*
* @param conf
* {@link Configuration} from which to check for the timeout
* @param type
* type of snapshot being taken
* @param defaultMaxWaitTime
* Default amount of time to wait, if none is in the configuration
* @return the max amount of time the master should wait for a snapshot to complete
*/
... | 3.26 |
hbase_SnapshotDescriptionUtils_validate_rdh | /**
* Convert the passed snapshot description into a 'full' snapshot description based on default
* parameters, if none have been supplied. This resolves any 'optional' parameters that aren't
* supplied to their default values.
*
* @param snapshot
* general snapshot descriptor
* @param conf
* Configuration ... | 3.26 |
hbase_SnapshotDescriptionUtils_getWorkingSnapshotDir_rdh | /**
* Get the directory to build a snapshot, before it is finalized
*
* @param snapshotName
* name of the snapshot
* @param rootDir
* root directory of the hbase installation
* @param conf
* Configuration of the HBase instance
* @return {@link Path} where one can build a snapshot
*/
public static Path g... | 3.26 |
hbase_Server_getFileSystem_rdh | /**
* Returns Return the FileSystem object used (can return null!).
*/
// TODO: Distinguish between "dataFs" and "walFs".
default FileSystem getFileSystem() {
// This default is pretty dodgy!
Configuration c = getConfiguration();
FileSystem fs = null;
try {
if (c != null) {fs = FileSystem.get(... | 3.26 |
hbase_Server_isStopping_rdh | /**
* Returns True is the server is Stopping
*/
// Note: This method is not part of the Stoppable Interface.
default boolean
isStopping() {
return false;
} | 3.26 |
hbase_Server_getConnection_rdh | /**
* Returns a reference to the servers' connection. Important note: this method returns a reference
* to Connection which is managed by Server itself, so callers must NOT attempt to close
* connection obtained.
*/
default Connection getConnection() {
return getAsyncConnection().toConnection();
} | 3.26 |
hbase_Server_getAsyncConnection_rdh | /**
* Returns a reference to the servers' async connection.
* <p/>
* Important note: this method returns a reference to Connection which is managed by Server
* itself, so callers must NOT attempt to close connection obtained.
*/
default AsyncConnection getAsyncConnection() {
return
getAsyncClusterConnectio... | 3.26 |
hbase_SyncFuture_reset_rdh | /**
* Call this method to clear old usage and get it ready for new deploy.
*
* @param txid
* the new transaction id
*/
SyncFuture reset(long txid, boolean forceSync) {
if ((t != null) && (t != Thread.currentThread())) {
throw new IllegalStateException();
}
t = Thread.currentThread();
if (... | 3.26 |
hbase_SyncFuture_getThread_rdh | /**
* Returns the thread that owned this sync future, use with caution as we return the reference to
* the actual thread object.
*
* @return the associated thread instance.
*/
Thread getThread() {
return t;
} | 3.26 |
hbase_FileLink_getAvailablePath_rdh | /**
* Returns the path of the first available link.
*/
public Path getAvailablePath(FileSystem fs) throws IOException {
for (int v10 = 0; v10 < locations.length; ++v10) {
if (fs.exists(locations[v10])) {
return locations[v10];
}
}throw new FileNotFoundException(toString());
}
/**
* Get the FileStatus of the referen... | 3.26 |
hbase_FileLink_getBackReferencesDir_rdh | /**
* Get the directory to store the link back references
* <p>
* To simplify the reference count process, during the FileLink creation a back-reference is added
* to the back-reference directory of the specified file.
*
* @param storeDir
* Root directory for the link reference folder
* @param fileName
* F... | 3.26 |
hbase_FileLink_getBackReferenceFileName_rdh | /**
* Get the referenced file name from the reference link directory path.
*
* @param dirPath
* Link references directory path
* @return Name of the file referenced
*/
public static String getBackReferenceFileName(final Path dirPath) {
return dirPath.getName().substring(BACK_REFERENCES_DIRECTORY_PREFIX.length()... | 3.26 |
hbase_FileLink_setLocations_rdh | /**
* NOTE: This method must be used only in the constructor! It creates a List with the specified
* locations for the link.
*/
protected void setLocations(Path originPath, Path... alternativePaths) {
assert this.locations == null : "Link locations already set";
List<Path> paths = new ArrayList<>(alternativePaths.le... | 3.26 |
hbase_FileLink_isBackReferencesDir_rdh | /**
* Checks if the specified directory path is a back reference links folder.
*
* @param dirPath
* Directory path to verify
* @return True if the specified directory is a link references folder
*/
public static boolean isBackReferencesDir(final Path dirPath) {
if (dirPath ==
null) {
return false;
}
return dir... | 3.26 |
hbase_FileLink_exists_rdh | /**
* Returns true if the file pointed by the link exists
*/
public boolean exists(final FileSystem fs) throws IOException {
for (int i = 0; i < locations.length; ++i) {
if (fs.exists(locations[i])) {
return true;
}
}
return false;
} | 3.26 |
hbase_FileLink_getLocations_rdh | /**
* Returns the locations to look for the linked file.
*/
public Path[] getLocations() {
return locations;
} | 3.26 |
hbase_FileLink_open_rdh | /**
* Open the FileLink for read.
* <p>
* It uses a wrapper of FSDataInputStream that is agnostic to the location of the file, even if
* the file switches between locations.
*
* @param fs
* {@link FileSystem} on which to open the FileLink
* @param bufferSize
* the size of the buffer to be used.
* @return ... | 3.26 |
hbase_FileLink_tryOpen_rdh | /**
* Try to open the file from one of the available locations.
*
* @return FSDataInputStream stream of the opened file link
* @throws IOException
* on unexpected error, or file not found.
*/
private FSDataInputStream tryOpen() throws IOException {
IOException exception = null;
for (Path path : fileLink.getLo... | 3.26 |
hbase_FileLink_getUnderlyingFileLinkInputStream_rdh | /**
* If the passed FSDataInputStream is backed by a FileLink, returns the underlying InputStream for
* the resolved link target. Otherwise, returns null.
*/
public static FSDataInputStream getUnderlyingFileLinkInputStream(FSDataInputStream stream) {
if (stream.getWrappedStream() instanceof FileLinkInputStream) {
r... | 3.26 |
hbase_StoreFlusher_performFlush_rdh | /**
* Performs memstore flush, writing data from scanner into sink.
*
* @param scanner
* Scanner to get data from.
* @param sink
* Sink to write data to. Could be StoreFile.Writer.
* @param throughputController
* A controller to avoid flush too fast
*/
protected void performFlush(InternalScanner scanner,... | 3.26 |
hbase_StoreFlusher_createScanner_rdh | /**
* Creates the scanner for flushing snapshot. Also calls coprocessors.
*
* @return The scanner; null if coprocessor is canceling the flush.
*/
protected final InternalScanner createScanner(List<KeyValueScanner> snapshotScanners, FlushLifeCycleTracker tracker) throws IOException
{
ScanInfo scanInfo;
if (s... | 3.26 |
hbase_ConcurrentMapUtils_computeIfAbsentEx_rdh | /**
* In HBASE-16648 we found that ConcurrentHashMap.get is much faster than computeIfAbsent if the
* value already exists. So here we copy the implementation of
* {@link ConcurrentMap#computeIfAbsent(Object, java.util.function.Function)}. It uses get and
* putIfAbsent to implement computeIfAbsent. And notice that ... | 3.26 |
hbase_ConcurrentMapUtils_computeIfAbsent_rdh | /**
* In HBASE-16648 we found that ConcurrentHashMap.get is much faster than computeIfAbsent if the
* value already exists. Notice that the implementation does not guarantee that the supplier will
* only be executed once.
*/
public static <K, V> V computeIfAbsent(ConcurrentMap<K, V> map, K key, Supplier<V> suppl... | 3.26 |
hbase_LogRollRegionServerProcedureManager_start_rdh | /**
* Start accepting backup procedure requests.
*/
@Override
public void start() {
if (!BackupManager.isBackupEnabled(rss.getConfiguration())) {
LOG.warn(("Backup is not enabled. Check your " + BackupRestoreConstants.BACKUP_ENABLE_KEY) + " setting");
return;
}
this.memberRpcs.start(rss.g... | 3.26 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.