name stringlengths 12 178 | code_snippet stringlengths 8 36.5k | score float64 3.26 3.68 |
|---|---|---|
hbase_MultiByteBuff_getItemIndex_rdh | /* Returns in which sub ByteBuffer, the given element index will be available. */
private int getItemIndex(int elemIndex) {
if (elemIndex < 0) {
throw new IndexOutOfBoundsException();
}
int index = 1;
while (elemIndex >= this.itemBeginPos[index]) {
index++;
if (index == this.itemBeginPos.length) {
... | 3.26 |
hbase_MultiByteBuff_hasRemaining_rdh | /**
* Returns true if there are elements between the current position and the limt
*
* @return true if there are elements, false otherwise
*/
@Override
public final boolean hasRemaining() {
checkRefCount();
return this.curItem.hasRemaining() || ((this.curItemIndex < this.limitedItemIndex) && this.items[this... | 3.26 |
hbase_MultiByteBuff_asSubByteBuffer_rdh | /**
* Returns bytes from given offset till length specified, as a single ByteBuffer. When all these
* bytes happen to be in a single ByteBuffer, which this object wraps, that ByteBuffer item as
* such will be returned (with offset in this ByteBuffer where the bytes starts). So users are
* warned not to change the p... | 3.26 |
hbase_MultiByteBuff_rewind_rdh | /**
* Rewinds this MBB and the position is set to 0
*
* @return this object
*/
@Override
public MultiByteBuff rewind() {checkRefCount();
for (int i = 0; i < this.items.length; i++) {
this.items[i].rewind();
}
this.curItemIndex = 0;
this.curItem = this.items[this.curItemIndex];
this.markedItemIndex = -1;
ret... | 3.26 |
hbase_MultiByteBuff_limit_rdh | /**
* Returns the limit of this MBB
*
* @return limit of the MBB
*/
@Override
public int limit() {
return this.limit;
} | 3.26 |
hbase_MultiByteBuff_put_rdh | /**
* Copies from the given byte[] to this MBB.
*/
@Override
public MultiByteBuff put(byte[] src, int offset, int length) {
checkRefCount();
if (this.curItem.remaining() >= length) {ByteBufferUtils.copyFromArrayToBuffer(this.curItem, src, offset, length);
return this;
}
int end = offset + l... | 3.26 |
hbase_MultiByteBuff_toBytes_rdh | /**
* Copy the content from this MBB to a byte[] based on the given offset and length the position
* from where the copy should start the length upto which the copy has to be done
*
* @return byte[] with the copied contents from this MBB.
*/
@Override
public byte[] toBytes(int
offset, int length) {
checkRefCou... | 3.26 |
hbase_MultiByteBuff_getShort_rdh | /**
* Returns the short value at the current position. Also advances the position by the size of
* short
*
* @return the short value at the current position
*/
@Override
public short getShort() {
checkRefCount();
int
remaining = this.curItem.remaining();
if (remaining >= Bytes.SIZEOF_SHORT) {
... | 3.26 |
hbase_MultiByteBuff_remaining_rdh | /**
* Returns the number of elements between the current position and the limit.
*
* @return the remaining elements in this MBB
*/
@Override
public int remaining() {
checkRefCount();
int remain =
0;
for (int i = curItemIndex; i < items.length; i++) {
remain += items[i].remaining();
}
... | 3.26 |
hbase_MultiByteBuff_reset_rdh | /**
* Similar to {@link ByteBuffer}.reset(), ensures that this MBB is reset back to last marked
* position.
*
* @return This MBB
*/ @Override
public MultiByteBuff reset() {
checkRefCount();
// when the buffer is moved to the next one.. the reset should happen on the previous marked
// item and the new one should b... | 3.26 |
hbase_MultiByteBuff_putInt_rdh | /**
* Writes an int to this MBB at its current position. Also advances the position by size of int
*
* @param val
* Int value to write
* @return this object
*/
@Override
public MultiByteBuff putInt(int val) {
checkRefCount();
if (this.curItem.remaining() >= Bytes.SIZEOF_INT) {
this.curItem.putI... | 3.26 |
hbase_MultiByteBuff_array_rdh | /**
*
* @throws UnsupportedOperationException
* MBB does not support array based operations
*/
@Override
public byte[] array() {
throw new UnsupportedOperationException();
} | 3.26 |
hbase_MultiByteBuff_skip_rdh | /**
* Jumps the current position of this MBB by specified length.
*/
@Override
public MultiByteBuff skip(int length) {
checkRefCount();
// Get available bytes from this item and remaining from next
int jump = 0;
while (true) {
jump = this.curItem.remaining();
if (jump >= length) {
... | 3.26 |
hbase_MultiByteBuff_getInt_rdh | /**
* Returns the int value at the current position. Also advances the position by the size of int
*
* @return the int value at the current position
*/
@Override
public int
getInt() {
checkRefCount();
int remaining = this.curItem.remaining();
if (remaining >= Bytes.SIZEOF_INT) {
return this.cu... | 3.26 |
hbase_MultiByteBuff_putLong_rdh | /**
* Writes a long to this MBB at its current position. Also advances the position by size of long
*
* @param val
* Long value to write
* @return this object
*/
@Override
public MultiByteBuff putLong(long val) {
checkRefCount();
if (this.curItem.remaining() >= Bytes.SIZEOF_LONG) {
this.curItem.... | 3.26 |
hbase_MultiByteBuff_arrayOffset_rdh | /**
*
* @throws UnsupportedOperationException
* MBB does not support array based operations
*/
@Override
public int arrayOffset() {
throw new UnsupportedOperationException();
} | 3.26 |
hbase_MultiByteBuff_mark_rdh | /**
* Marks the current position of the MBB
*
* @return this object
*/
@Override
public MultiByteBuff mark() {
checkRefCount();
this.markedItemIndex = this.curItemIndex;
this.curItem.mark();
return this;
} | 3.26 |
hbase_MultiByteBuff_slice_rdh | /**
* Returns an MBB which is a sliced version of this MBB. The position, limit and mark of the new
* MBB will be independent than that of the original MBB. The content of the new MBB will start at
* this MBB's current position
*
* @return a sliced MBB
*/
@Override
public MultiByteBuff slice() {
checkRefCount();
... | 3.26 |
hbase_MultiByteBuff_capacity_rdh | /**
* Returns the total capacity of this MultiByteBuffer.
*/
@Override
public int capacity() {
checkRefCount();
int c = 0;
for (ByteBuffer item : this.items) {
c += item.capacity();
}
return c;
} | 3.26 |
hbase_MultiByteBuff_get_rdh | /**
* Copies the content from an this MBB to a ByteBuffer
*
* @param out
* the ByteBuffer to which the copy has to happen, its position will be
* advanced.
* @param sourceOffset
* the offset in the MBB from which the elements has to be copied
* @param length
* the length in the MBB upto which the eleme... | 3.26 |
hbase_MultiByteBuff_hasArray_rdh | /**
* Returns false. MBB does not support array based operations
*/@Override
public boolean hasArray() {
return false;
} | 3.26 |
hbase_MultiByteBuff_getLong_rdh | /**
* Returns the long value at the current position. Also advances the position by the size of long
*
* @return the long value at the current position
*/
@Override
public long getLong() {
checkRefCount();
int remaining = this.curItem.remaining();
if (remaining >= Bytes.SIZEOF_LONG) {
return this.curItem.getLon... | 3.26 |
hbase_MultiByteBuff_moveBack_rdh | /**
* Jumps back the current position of this MBB by specified length.
*/
@Override
public MultiByteBuff moveBack(int length) {
checkRefCount();
while (length != 0) {
if (length > curItem.position()) {
length -= curItem.position();
this.curItem.position(0);
this... | 3.26 |
hbase_MultiByteBuff_position_rdh | /**
* Sets this MBB's position to the given value.
*
* @return this object
*/
@Override
public MultiByteBuff
position(int position) {
checkRefCount();
// Short circuit for positioning within the cur item. Mostly that is the case.
if ((this.itemBeginPos[this.curItemIndex] <= position) && (this.itemBeginP... | 3.26 |
hbase_ExecutorType_getExecutorName_rdh | /**
* Returns Conflation of the executor type and the passed {@code serverName}.
*/
String getExecutorName(String serverName) {
return (this.toString() + "-") + serverName.replace("%", "%%");
} | 3.26 |
hbase_PairOfSameType_getFirst_rdh | /**
* Return the first element stored in the pair.
*/
public T getFirst() {
return first;
} | 3.26 |
hbase_PairOfSameType_getSecond_rdh | /**
* Return the second element stored in the pair.
*/
public T getSecond() {
return second;
} | 3.26 |
hbase_RawCellBuilderFactory_create_rdh | /**
* Returns the cell that is created
*/
public static RawCellBuilder create() {
return new KeyValueBuilder();} | 3.26 |
hbase_ProcedurePrepareLatch_getNoopLatch_rdh | /**
* Returns the singleton latch which does nothing.
*/
public static ProcedurePrepareLatch getNoopLatch() {
return noopLatch;
} | 3.26 |
hbase_ProcedurePrepareLatch_createBlockingLatch_rdh | /**
* Creates a latch which blocks.
*/
public static ProcedurePrepareLatch createBlockingLatch() {
return new CompatibilityLatch();
} | 3.26 |
hbase_ProcedurePrepareLatch_m0_rdh | /**
* Create a latch if the client does not have async proc support
*
* @param major
* major version with async proc support
* @param minor
* minor version with async proc support
* @return a CompatibilityLatch or a NoopLatch if the client has async proc support
*/
public static ProcedurePrepareLatch m0(int... | 3.26 |
hbase_ProcedurePrepareLatch_createLatch_rdh | /**
* Create a latch if the client does not have async proc support. This uses the default 1.1
* version.
*
* @return a CompatibilityLatch or a NoopLatch if the client has async proc support
*/public static ProcedurePrepareLatch createLatch() {
// don't use the latch if we have procedure support (default 1.1)
... | 3.26 |
hbase_LockProcedure_setTimeoutFailure_rdh | /**
* Re run the procedure after every timeout to write new WAL entries so we don't hold back old
* WALs.
*
* @return false, so procedure framework doesn't mark this procedure as failure.
*/
@Override
protected synchronized boolean setTimeoutFailure(final MasterProcedureEnv env) {
synchronized(event) {
... | 3.26 |
hbase_LockProcedure_updateHeartBeat_rdh | /**
* Updates timeout deadline for the lock.
*/
public void updateHeartBeat() {
f1.set(EnvironmentEdgeManager.currentTime());
if (LOG.isDebugEnabled()) {
LOG.debug("Heartbeat " + toString());
}} | 3.26 |
hbase_LockProcedure_unlock_rdh | // Can be called before procedure gets scheduled, in which case, the execute() will finish
// immediately and release the underlying locks.
public void unlock(final MasterProcedureEnv env) {
unlock.set(true);
locked.set(false);
// Maybe timeout already awakened the event and the procedure has finished.
... | 3.26 |
hbase_LockProcedure_beforeReplay_rdh | /**
* On recovery, re-execute from start to acquire the locks. Need to explicitly set it to RUNNABLE
* because the procedure might have been in WAITING_TIMEOUT state when crash happened. In which
* case, it'll be sent back to timeout queue on recovery, which we don't want since we want to
* require locks.
*/
@Over... | 3.26 |
hbase_Writables_copyWritable_rdh | /**
* Copy one Writable to another. Copies bytes using data streams.
*
* @param bytes
* Source Writable
* @param tgt
* Target Writable
* @return The target Writable.
* @throws IOException
* e
*/
public static Writable copyWritable(final byte[] bytes, final Writable tgt) throws IOException {
DataInpu... | 3.26 |
hbase_OrderedInt64_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.encodeInt64(dst, val... | 3.26 |
hbase_OrderedInt64_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.decodeInt64(sr... | 3.26 |
hbase_StorageClusterVersionModel_getVersion_rdh | /**
* Returns the storage cluster version
*/
@XmlAttribute(name = "Version")
public String getVersion() {
return version;
} | 3.26 |
hbase_StorageClusterVersionModel_setVersion_rdh | /**
*
* @param version
* the storage cluster version
*/
public void setVersion(String version) {
this.version = version;
} | 3.26 |
hbase_StorageClusterVersionModel_valueOf_rdh | // needed for jackson deserialization
private static StorageClusterVersionModel valueOf(String value) {
StorageClusterVersionModel versionModel = new StorageClusterVersionModel();
versionModel.setVersion(value);
return versionModel;
} | 3.26 |
hbase_StorageClusterVersionModel_toString_rdh | /* (non-Javadoc)
@see java.lang.Object#toString()
*/
@Override
public String toString() {
return version;
} | 3.26 |
hbase_AbstractFSWAL_trySetReadyForRolling_rdh | // return whether we have successfully set readyForRolling to true.
private boolean trySetReadyForRolling() {
// Check without holding lock first. Usually we will just return here.
// waitingRoll is volatile and unacedEntries is only accessed inside event loop so it is safe to
// check them outside the consumeLock.
if ... | 3.26 |
hbase_AbstractFSWAL_findRegionsToForceFlush_rdh | /**
* If the number of un-archived WAL files ('live' WALs) is greater than maximum allowed, check the
* first (oldest) WAL, and return those regions which should be flushed so that it can be
* let-go/'archived'.
*
* @return stores of regions (encodedRegionNames) to flush in order to archive oldest WAL file.
*/
Ma... | 3.26 |
hbase_AbstractFSWAL_atHeadOfRingBufferEventHandlerAppend_rdh | /**
* Exposed for testing only. Use to tricks like halt the ring buffer appending.
*/
protected void atHeadOfRingBufferEventHandlerAppend() {
// Noop
} | 3.26 |
hbase_AbstractFSWAL_markClosedAndClean_rdh | /**
* Mark this WAL file as closed and call cleanOldLogs to see if we can archive this file.
*/
private void markClosedAndClean(Path path) {
WALProps props = walFile2Props.get(path);
// typically this should not be null, but if there is no big issue if it is already null, so
// let's make the code more r... | 3.26 |
hbase_AbstractFSWAL_updateStore_rdh | /**
* updates the sequence number of a specific store. depending on the flag: replaces current seq
* number if the given seq id is bigger, or even if it is lower than existing one
*/
@Override
public void updateStore(byte[] encodedRegionName, byte[] familyName, Long sequenceid, boolean onlyIfGreater) {
sequenceIdA... | 3.26 |
hbase_AbstractFSWAL_requestLogRoll_rdh | // public only until class moves to o.a.h.h.wal
public void requestLogRoll() {
requestLogRoll(ERROR);
} | 3.26 |
hbase_AbstractFSWAL_getInflightWALCloseCount_rdh | /**
* Returns number of WALs currently in the process of closing.
*/
public int getInflightWALCloseCount() {
return inflightWALClosures.size();
} | 3.26 |
hbase_AbstractFSWAL_getSyncedTxid_rdh | /**
* This method is to adapt {@link FSHLog} and {@link AsyncFSWAL}. For {@link AsyncFSWAL}, we use
* {@link AbstractFSWAL#highestProcessedAppendTxid} at the point we calling
* {@link AsyncFSWAL#doWriterSync} method as successful syncedTxid. For {@link FSHLog}, because we
* use multi-thread {@code SyncRunner}s, we ... | 3.26 |
hbase_AbstractFSWAL_main_rdh | /**
* Pass one or more log file names and it will either dump out a text version on
* <code>stdout</code> or split the specified log files.
*/
public static void main(String[] args) throws IOException {
if (args.length < 2) {
usage();
System.exit(-1);
}
// either dump using the WALPrettyPrinter or split, dependi... | 3.26 |
hbase_AbstractFSWAL_getFileNumFromFileName_rdh | /**
* A log file has a creation timestamp (in ms) in its file name ({@link #filenum}. This helper
* method returns the creation timestamp from a given log file. It extracts the timestamp assuming
* the filename is created with the {@link #computeFilename(long filenum)} method.
*
* @return ... | 3.26 |
hbase_AbstractFSWAL_doReplaceWriter_rdh | /**
* Notice that you need to clear the {@link #rollRequested} flag in this method, as the new writer
* will begin to work before returning from this method. If we clear the flag after returning from
* this call, we may miss a roll request. The implementation class should choose a proper place to
* clear the {@link... | 3.26 |
hbase_AbstractFSWAL_skipRemoteWAL_rdh | // close marker.
// Setting markerEdit only to true is for transiting from A to S, where we need to give up writing
// any pending wal entries as they will be discarded. The remote cluster will replicated the
// correct data back later. We still need to allow writing marker edits such as close region event
// to allow ... | 3.26 |
hbase_AbstractFSWAL_getNumLogFiles_rdh | // public only until class moves to o.a.h.h.wal
/**
* Returns the number of log files in use
*/
public int getNumLogFiles() {
// +1 for current use log
return getNumRolledLogFiles() + 1;
} | 3.26 |
hbase_AbstractFSWAL_computeFilename_rdh | /**
* This is a convenience method that computes a new filename with a given file-number.
*
* @param filenum
* to use
*/
protected Path computeFilename(final long filenum) {
if (filenum < 0) {
throw new RuntimeException("WAL file number can't be < 0");
}String child = ((walFilePrefix + WAL_FILE_NAME_DELI... | 3.26 |
hbase_AbstractFSWAL_getWALArchivePath_rdh | /* only public so WALSplitter can use.
@return archived location of a WAL file with the given path p
*/
public static Path getWALArchivePath(Path archiveDir, Path p) {
return new Path(archiveDir, p.getName());
} | 3.26 |
hbase_AbstractFSWAL_replaceWriter_rdh | /**
* Cleans up current writer closing it and then puts in place the passed in {@code nextWriter}.
* <p/>
* <ul>
* <li>In the case of creating a new WAL, oldPath will be null.</li>
* <li>In the case of rolling over from one file to the next, none of the parameters will be null.
* </li>
* <li>In the case of closi... | 3.26 |
hbase_AbstractFSWAL_getLastTxid_rdh | // confirm non-empty before calling
private static long getLastTxid(Deque<FSWALEntry> queue) {
return queue.peekLast().getTxid();} | 3.26 |
hbase_AbstractFSWAL_doCheckSlowSync_rdh | /**
* Returns true if we exceeded the slow sync roll threshold over the last check interval
*/
protected boolean doCheckSlowSync()
{
boolean result = false;
long now = EnvironmentEdgeManager.currentTime();
long v142 = now -
lastTimeCheckSlowSync;
if (v142 >= slowSyncCheckInterval) {
if (slowSyncCount.get() >= slowSyn... | 3.26 |
hbase_AbstractFSWAL_getPreallocatedEventCount_rdh | // must be power of 2
protected final int getPreallocatedEventCount() {
// Preallocate objects to use on the ring buffer. The way that appends and syncs work, we will
// be stuck and make no progress if the buffer is filled with appends only and there is no
// sync. If no sync, then the handlers will be out... | 3.26 |
hbase_AbstractFSWAL_getLogFileSize_rdh | // public only until class moves to o.a.h.h.wal
/**
* Returns the size of log files in use
*/
public long getLogFileSize() {
return this.totalLogSize.get();
} | 3.26 |
hbase_AbstractFSWAL_getFiles_rdh | /**
* Get the backing files associated with this WAL.
*
* @return may be null if there are no files.
*/
FileStatus[] getFiles() throws IOException {
return CommonFSUtils.listStatus(fs, walDir, ourFiles);
} | 3.26 |
hbase_AbstractFSWAL_finishSync_rdh | // try advancing the highestSyncedTxid as much as possible
private int finishSync() {
if (unackedAppends.isEmpty()) {
// All outstanding appends have been acked.
if (toWriteAppends.isEmpty()) {
// Also no appends that wait to be written out, then just finished all pending syncs.
long v98 = highestSyncedTxid.get();
for ... | 3.26 |
hbase_AbstractFSWAL_isHsync_rdh | // find all the sync futures between these two txids to see if we need to issue a hsync, if no
// sync futures then just use the default one.
private boolean isHsync(long
beginTxid, long endTxid) {
SortedSet<SyncFuture> futures = syncFutures.subSet(new SyncFuture().reset(beginTxid, false), new SyncFuture().reset(endTxi... | 3.26 |
hbase_AbstractFSWAL_getCurrentFileName_rdh | /**
* This is a convenience method that computes a new filename with a given using the current WAL
* file-number
*/
public Path getCurrentFileName() {
return computeFilename(this.filenum.get());
} | 3.26 |
hbase_AbstractFSWAL_tellListenersAboutPreLogRoll_rdh | /**
* Tell listeners about pre log roll.
*/private void tellListenersAboutPreLogRoll(final Path oldPath, final Path newPath) throws IOException {
coprocessorHost.preWALRoll(oldPath, newPath);
if (!this.listeners.isEmpty()) {
for (WALActionsListener i : this.listeners) {
i.preLogRoll(old... | 3.26 |
hbase_AbstractFSWAL_getNewPath_rdh | /**
* retrieve the next path to use for writing. Increments the internal filenum.
*/
private Path getNewPath()
throws IOException {
this.filenum.set(Math.max(m0() + 1, EnvironmentEdgeManager.currentTime()));
Path newPath = getCurrentFileName();
return newPath;
} | 3.26 |
hbase_AbstractFSWAL_getNumRolledLogFiles_rdh | // public only until class moves to o.a.h.h.wal
/**
* Returns the number of rolled log files
*/
public int getNumRolledLogFiles() {
return walFile2Props.size();
} | 3.26 |
hbase_AbstractFSWAL_getLogFileSizeIfBeingWritten_rdh | /**
* if the given {@code path} is being written currently, then return its length.
* <p>
* This is used by replication to prevent replicating unacked log entries. See
* https://issues.apache.org/jira/browse/HBASE-14004 for more details.
*/
@Override
public OptionalLong getLogFileSizeIfBeingWritten(Path path) {
ro... | 3.26 |
hbase_AbstractFSWAL_markFutureDoneAndOffer_rdh | /**
* Helper that marks the future as DONE and offers it back to the cache.
*/
protected void
markFutureDoneAndOffer(SyncFuture future, long txid, Throwable t) {
future.done(txid, t);
syncFutureCache.offer(future);
} | 3.26 |
hbase_StoreFileInfo_computeRefFileHDFSBlockDistribution_rdh | /**
* helper function to compute HDFS blocks distribution of a given reference file.For reference
* file, we don't compute the exact value. We use some estimate instead given it might be good
* enough. we assume bottom part takes the first half of reference file, top part takes the second
* half of the reference fi... | 3.26 |
hbase_StoreFileInfo_getActiveFileName_rdh | /**
* Return the active file name that contains the real data.
* <p>
* For referenced hfile, we will return the name of the reference file as it will be used to
* construct the StoreFileReader. And for linked hfile, we will return the name of the file being
* linked.
*/
public String getActiveFileName() {
if ... | 3.26 |
hbase_StoreFileInfo_isMobFile_rdh | /**
* Checks if the file is a MOB file
*
* @param path
* path to a file
* @return true, if - yes, false otherwise
*/
public static boolean isMobFile(final Path path) {
String fileName = path.getName();
String[] parts = fileName.split(MobUtils.SEP);
if (parts.length != 2) {
return false;
... | 3.26 |
hbase_StoreFileInfo_isValid_rdh | /**
* Return if the specified file is a valid store file or not.
*
* @param fileStatus
* The {@link FileStatus} of the file
* @return <tt>true</tt> if the file is valid
*/
public static boolean isValid(final FileStatus fileStatus) throws IOException {
final Path p = fileStatus.getPath();
if (fileStatus... | 3.26 |
hbase_StoreFileInfo_getReferredToRegionAndFile_rdh | /* Return region and file name referred to by a Reference.
@param referenceFile HFile name which is a Reference.
@return Calculated referenced region and file name.
@throws IllegalArgumentException when referenceFile regex fails to match.
*/
public static Pair<String, String> getReferredToRegionAndFile(final String re... | 3.26 |
hbase_StoreFileInfo_isTopReference_rdh | /**
* Returns True if the store file is a top Reference
*/
public boolean isTopReference() {
return (this.reference != null) && Reference.isTopFileRegion(this.reference.getFileRegion());
} | 3.26 |
hbase_StoreFileInfo_getFileStatus_rdh | /**
* Returns The {@link FileStatus} of the file
*/
public FileStatus getFileStatus() throws IOException {
return getReferencedFileStatus(fs);} | 3.26 |
hbase_StoreFileInfo_getSize_rdh | /**
* Size of the Hfile
*/
public long getSize() {
return size;} | 3.26 |
hbase_StoreFileInfo_isReference_rdh | /**
*
* @param name
* file name to check.
* @return True if the path has format of a HStoreFile reference.
*/
public static boolean isReference(final
String name) {
Matcher m = REF_NAME_PATTERN.matcher(name);
return
m.matches() && (m.groupCount() > 1);
} | 3.26 |
hbase_StoreFileInfo_getPath_rdh | /**
* Returns The {@link Path} of the file
*/
public Path getPath() {
return initialPath;
} | 3.26 |
hbase_StoreFileInfo_isLink_rdh | /**
* Returns True if the store file is a link
*/
public boolean isLink() {
return (this.link != null) && (this.reference == null);
} | 3.26 |
hbase_StoreFileInfo_getHDFSBlockDistribution_rdh | /**
* Returns the HDFS block distribution
*/
public HDFSBlocksDistribution getHDFSBlockDistribution() {
return this.hdfsBlocksDistribution;
} | 3.26 |
hbase_StoreFileInfo_computeHDFSBlocksDistribution_rdh | /**
* Compute the HDFS Block Distribution for this StoreFile
*/
public HDFSBlocksDistribution computeHDFSBlocksDistribution(final FileSystem fs) throws IOException {
// guard against the case where we get the FileStatus from link, but by the time we
// call compute the file is moved again
if (this.link !=... | 3.26 |
hbase_StoreFileInfo_setRegionCoprocessorHost_rdh | /**
* Sets the region coprocessor env.
*/
public void setRegionCoprocessorHost(RegionCoprocessorHost coprocessorHost) {this.coprocessorHost = coprocessorHost;
} | 3.26 |
hbase_StoreFileInfo_isMobRefFile_rdh | /**
* Checks if the file is a MOB reference file, created by snapshot
*
* @param path
* path to a file
* @return true, if - yes, false otherwise
*/
public static boolean isMobRefFile(final Path path) {
String fileName = path.getName();
int lastIndex = fileName.lastIndexOf(MobUtils.SEP);
if (lastInd... | 3.26 |
hbase_StoreFileInfo_getReferencedFileStatus_rdh | /**
* Get the {@link FileStatus} of the file referenced by this StoreFileInfo
*
* @param fs
* The current file system to use.
* @return The {@link FileStatus} of the file referenced by this StoreFileInfo
*/
public FileStatus getReferencedFileStatus(final FileSystem fs) throws IOException {
FileStatus statu... | 3.26 |
hbase_StoreFileInfo_validateStoreFileName_rdh | /**
* Validate the store file name.
*
* @param fileName
* name of the file to validate
* @return <tt>true</tt> if the file could be a valid store file, <tt>false</tt> otherwise
*/
public static boolean validateStoreFileName(final String fileName) {... | 3.26 |
hbase_StoreFileInfo_m0_rdh | /**
*
* @param path
* Path to check.
* @return True if the path has format of a HFile.
*/
public static boolean m0(final Path path) {
return m0(path.getName());
} | 3.26 |
hbase_StoreFileInfo_getModificationTime_rdh | /**
* Returns Get the modification time of the file.
*/
public long getModificationTime() throws IOException {
return getFileStatus().getModificationTime();
} | 3.26 |
hbase_StoreFileInfo_getCreatedTimestamp_rdh | /**
* Returns timestamp when this file was created (as returned by filesystem)
*/
public long getCreatedTimestamp() {
return createdTimestamp;
}
/* Return path to the file referred to by a Reference. Presumes a directory hierarchy of
<code>${hbase.rootdir}/data/${namespace} | 3.26 |
hbase_RecoveredEditsOutputSink_closeWriters_rdh | /**
* Close all of the output streams.
*
* @return true when there is no error.
*/
private boolean closeWriters() throws IOException {
List<IOException> thrown = Lists.newArrayList();
for (RecoveredEditsWriter writer : writers.values()) { closeCompletionService.submit(() -> {
Path dst = closeRec... | 3.26 |
hbase_RecoveredEditsOutputSink_getRecoveredEditsWriter_rdh | /**
* Get a writer and path for a log starting at the given entry. This function is threadsafe so
* long as multiple threads are always acting on different regions.
*
* @return null if this region shouldn't output any logs
*/private RecoveredEditsWriter getRecoveredEditsWriter(TableName tableName, byte[] region, l... | 3.26 |
hbase_ClientUtil_calculateTheClosestNextRowKeyForPrefix_rdh | /**
* <p>
* When scanning for a prefix the scan should stop immediately after the the last row that has the
* specified prefix. This method calculates the closest next rowKey immediately following the
* given rowKeyPrefix.
* </p>
* <p>
* <b>IMPORTANT: This converts a rowKey<u>Prefix</u> into a rowKey</b>.
* </p... | 3.26 |
hbase_CompactSplit_getRegionSplitLimit_rdh | /**
* Returns the regionSplitLimit
*/
public int getRegionSplitLimit() {
return this.regionSplitLimit;
} | 3.26 |
hbase_CompactSplit_deregisterChildren_rdh | /**
* {@inheritDoc }
*/
@Override
public void deregisterChildren(ConfigurationManager manager) {
// No children to register
} | 3.26 |
hbase_CompactSplit_getCompactionQueueSize_rdh | /**
* Returns the current size of the queue containing regions that are processed.
*
* @return The current size of the regions queue.
*/
public int getCompactionQueueSize() {
return longCompactions.getQueue().size() + shortCompactions.getQueue().size();
} | 3.26 |
hbase_CompactSplit_m0_rdh | /**
* Returns the shortCompactions thread pool executor
*/
ThreadPoolExecutor m0() {return shortCompactions;
} | 3.26 |
hbase_CompactSplit_registerChildren_rdh | /**
* {@inheritDoc }
*/
@Override
public void registerChildren(ConfigurationManager manager) {
// No children to register.
} | 3.26 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.