method2testcases stringlengths 118 6.63k |
|---|
### Question:
FSVisitor { public static void visitTableRecoveredEdits(final FileSystem fs, final Path tableDir, final FSVisitor.RecoveredEditsVisitor visitor) throws IOException { FileStatus[] regions = FSUtils.listStatus(fs, tableDir, new FSUtils.RegionDirFilter(fs)); if (regions == null) { LOG.info("No regions under ... |
### Question:
NativeIO { static native void posix_fadvise( FileDescriptor fd, long offset, long len, int flags) throws NativeIOException; static boolean isAvailable(); static native FileDescriptor open(String path, int flags, int mode); static native void chmod(String path, int mode); static void posixFadviseIfPossibl... |
### Question:
NativeIO { static native void sync_file_range( FileDescriptor fd, long offset, long nbytes, int flags) throws NativeIOException; static boolean isAvailable(); static native FileDescriptor open(String path, int flags, int mode); static native void chmod(String path, int mode); static void posixFadviseIfPo... |
### Question:
NativeIO { static native String getUserName(int uid) throws IOException; static boolean isAvailable(); static native FileDescriptor open(String path, int flags, int mode); static native void chmod(String path, int mode); static void posixFadviseIfPossible(
FileDescriptor fd, long offset, long len, ... |
### Question:
NativeIO { static native String getGroupName(int uid) throws IOException; static boolean isAvailable(); static native FileDescriptor open(String path, int flags, int mode); static native void chmod(String path, int mode); static void posixFadviseIfPossible(
FileDescriptor fd, long offset, long len,... |
### Question:
NativeIO { public static void renameTo(File src, File dst) throws IOException { if (!nativeLoaded) { if (!src.renameTo(dst)) { throw new IOException("renameTo(src=" + src + ", dst=" + dst + ") failed."); } } else { renameTo0(src.getAbsolutePath(), dst.getAbsolutePath()); } } static boolean isAvailable();... |
### Question:
SampleQuantiles { synchronized public void clear() { count = 0; bufferCount = 0; samples.clear(); } SampleQuantiles(Quantile[] quantiles); synchronized void insert(long v); synchronized Map<Quantile, Long> snapshot(); synchronized long getCount(); @VisibleForTesting synchronized int getSampleCount(); sync... |
### Question:
FSVisitor { public static void visitLogFiles(final FileSystem fs, final Path rootDir, final LogFileVisitor visitor) throws IOException { Path logsDir = new Path(rootDir, HConstants.HREGION_LOGDIR_NAME); FileStatus[] logServerDirs = FSUtils.listStatus(fs, logsDir); if (logServerDirs == null) { LOG.info("No... |
### Question:
PathData implements Comparable<PathData> { public PathData[] getDirectoryContents() throws IOException { checkIfExists(FileTypeRequirement.SHOULD_BE_DIRECTORY); FileStatus[] stats = fs.listStatus(path); PathData[] items = new PathData[stats.length]; for (int i=0; i < stats.length; i++) { String child = ge... |
### Question:
PathData implements Comparable<PathData> { public File toFile() { if (!(fs instanceof LocalFileSystem)) { throw new IllegalArgumentException("Not a local path: " + path); } return ((LocalFileSystem)fs).pathToFile(path); } PathData(String pathString, Configuration conf); PathData(File localPath, Configura... |
### Question:
PathData implements Comparable<PathData> { public static PathData[] expandAsGlob(String pattern, Configuration conf) throws IOException { Path globPath = new Path(pattern); FileSystem fs = globPath.getFileSystem(conf); FileStatus[] stats = fs.globStatus(globPath); PathData[] items = null; if (stats == nul... |
### Question:
PathData implements Comparable<PathData> { public String toString() { String scheme = uri.getScheme(); String decodedRemainder = uri.getSchemeSpecificPart(); if (scheme == null) { return decodedRemainder; } else { StringBuilder buffer = new StringBuilder(); buffer.append(scheme); buffer.append(":"); buffe... |
### Question:
ChRootedFs extends AbstractFileSystem { @Override public boolean delete(final Path f, final boolean recursive) throws IOException, UnresolvedLinkException { return myFs.delete(fullPath(f), recursive); } ChRootedFs(final AbstractFileSystem fs, final Path theRoot); @Override URI getUri(); String stripOutRoo... |
### Question:
ChRootedFs extends AbstractFileSystem { @Override public void mkdir(final Path dir, final FsPermission permission, final boolean createParent) throws IOException, UnresolvedLinkException { myFs.mkdir(fullPath(dir), permission, createParent); } ChRootedFs(final AbstractFileSystem fs, final Path theRoot); @... |
### Question:
ChRootedFileSystem extends FilterFileSystem { @Override public URI getUri() { return myUri; } ChRootedFileSystem(final URI uri, Configuration conf); void initialize(final URI name, final Configuration conf); @Override URI getUri(); Path getResolvedQualifiedPath(final Path f); @Override Path getWorkingDire... |
### Question:
ChRootedFileSystem extends FilterFileSystem { @Override public boolean delete(final Path f, final boolean recursive) throws IOException { return super.delete(fullPath(f), recursive); } ChRootedFileSystem(final URI uri, Configuration conf); void initialize(final URI name, final Configuration conf); @Overri... |
### Question:
ChRootedFileSystem extends FilterFileSystem { @Override public boolean rename(final Path src, final Path dst) throws IOException { return super.rename(fullPath(src), fullPath(dst)); } ChRootedFileSystem(final URI uri, Configuration conf); void initialize(final URI name, final Configuration conf); @Overrid... |
### Question:
ChRootedFileSystem extends FilterFileSystem { @Override public ContentSummary getContentSummary(Path f) throws IOException { return super.getContentSummary(fullPath(f)); } ChRootedFileSystem(final URI uri, Configuration conf); void initialize(final URI name, final Configuration conf); @Override URI getUri... |
### Question:
ChRootedFileSystem extends FilterFileSystem { @Override public Path resolvePath(final Path p) throws IOException { return super.resolvePath(fullPath(p)); } ChRootedFileSystem(final URI uri, Configuration conf); void initialize(final URI name, final Configuration conf); @Override URI getUri(); Path getReso... |
### Question:
ChRootedFileSystem extends FilterFileSystem { @Override public FSDataOutputStream create(final Path f, final FsPermission permission, final boolean overwrite, final int bufferSize, final short replication, final long blockSize, final Progressable progress) throws IOException { return super.create(fullPath... |
### Question:
HarFileSystem extends FilterFileSystem { public FileChecksum getFileChecksum(Path f) { return null; } HarFileSystem(); HarFileSystem(FileSystem fs); @Override String getScheme(); void initialize(URI name, Configuration conf); int getHarVersion(); Path getWorkingDirectory(); @Override URI getUri(); @Overr... |
### Question:
FilterFileSystem extends FileSystem { public FilterFileSystem() { } FilterFileSystem(); FilterFileSystem(FileSystem fs); FileSystem getRawFileSystem(); void initialize(URI name, Configuration conf); URI getUri(); Path makeQualified(Path path); BlockLocation[] getFileBlockLocations(FileStatus file, long s... |
### Question:
BlockCacheColumnFamilySummary implements Writable, Comparable<BlockCacheColumnFamilySummary> { @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (getClass() != obj.getClass()) return false; BlockCacheColumnFamilySummary other = (BlockCacheColumnF... |
### Question:
FilterFileSystem extends FileSystem { @Override public FSDataOutputStream create(Path f, FsPermission permission, boolean overwrite, int bufferSize, short replication, long blockSize, Progressable progress) throws IOException { return fs.create(f, permission, overwrite, bufferSize, replication, blockSize,... |
### Question:
FilterFileSystem extends FileSystem { public void setVerifyChecksum(boolean verifyChecksum) { fs.setVerifyChecksum(verifyChecksum); } FilterFileSystem(); FilterFileSystem(FileSystem fs); FileSystem getRawFileSystem(); void initialize(URI name, Configuration conf); URI getUri(); Path makeQualified(Path pa... |
### Question:
FilterFileSystem extends FileSystem { @Override public void setWriteChecksum(boolean writeChecksum) { fs.setWriteChecksum(writeChecksum); } FilterFileSystem(); FilterFileSystem(FileSystem fs); FileSystem getRawFileSystem(); void initialize(URI name, Configuration conf); URI getUri(); Path makeQualified(P... |
### Question:
LocalFileSystem extends ChecksumFileSystem { @Override public String getScheme() { return "file"; } LocalFileSystem(); LocalFileSystem(FileSystem rawLocalFileSystem); @Override void initialize(URI name, Configuration conf); @Override String getScheme(); FileSystem getRaw(); File pathToFile(Path path); @O... |
### Question:
LocalDirAllocator { int getCurrentDirectoryIndex() { AllocatorPerContext context = obtainContext(contextCfgItemName); return context.getCurrentDirectoryIndex(); } LocalDirAllocator(String contextCfgItemName); Path getLocalPathForWrite(String pathStr,
Configuration conf); Path getLocalPathForWrite(S... |
### Question:
LocalDirAllocator { public Path getLocalPathForWrite(String pathStr, Configuration conf) throws IOException { return getLocalPathForWrite(pathStr, SIZE_UNKNOWN, conf); } LocalDirAllocator(String contextCfgItemName); Path getLocalPathForWrite(String pathStr,
Configuration conf); Path getLocalPathFor... |
### Question:
LocalDirAllocator { public File createTmpFileForWrite(String pathStr, long size, Configuration conf) throws IOException { AllocatorPerContext context = obtainContext(contextCfgItemName); return context.createTmpFileForWrite(pathStr, size, conf); } LocalDirAllocator(String contextCfgItemName); Path getLoca... |
### Question:
LocalDirAllocator { public Path getLocalPathToRead(String pathStr, Configuration conf) throws IOException { AllocatorPerContext context = obtainContext(contextCfgItemName); return context.getLocalPathToRead(pathStr, conf); } LocalDirAllocator(String contextCfgItemName); Path getLocalPathForWrite(String pa... |
### Question:
SlabCache implements SlabItemActionWatcher, BlockCache, HeapSize { Entry<Integer, SingleSizeCache> getHigherBlock(int size) { return sizer.higherEntry(size - 1); } SlabCache(long size, long avgBlockSize); void addSlabByConf(Configuration conf); void cacheBlock(BlockCacheKey cacheKey, Cacheable cachedItem)... |
### Question:
LocalDirAllocator { @Deprecated @InterfaceAudience.LimitedPrivate({"MapReduce"}) public static void removeContext(String contextCfgItemName) { synchronized (contexts) { contexts.remove(contextCfgItemName); } } LocalDirAllocator(String contextCfgItemName); Path getLocalPathForWrite(String pathStr,
C... |
### Question:
ChecksumFileSystem extends FilterFileSystem { public static long getChecksumLength(long size, int bytesPerSum) { return ((size + bytesPerSum - 1) / bytesPerSum) * 4 + CHECKSUM_VERSION.length + 4; } ChecksumFileSystem(FileSystem fs); static double getApproxChkSumLength(long size); void setConf(Configuratio... |
### Question:
ChecksumFileSystem extends FilterFileSystem { @Override public FSDataOutputStream create(Path f, FsPermission permission, boolean overwrite, int bufferSize, short replication, long blockSize, Progressable progress) throws IOException { return create(f, permission, overwrite, true, bufferSize, replication,... |
### Question:
ChecksumFileSystem extends FilterFileSystem { @Override public boolean mkdirs(Path f) throws IOException { return fs.mkdirs(f); } ChecksumFileSystem(FileSystem fs); static double getApproxChkSumLength(long size); void setConf(Configuration conf); void setVerifyChecksum(boolean verifyChecksum); @Override v... |
### Question:
HFileBlock extends SchemaConfigured implements Cacheable { public int getUncompressedSizeWithoutHeader() { return uncompressedSizeWithoutHeader; } HFileBlock(BlockType blockType, int onDiskSizeWithoutHeader,
int uncompressedSizeWithoutHeader, long prevBlockOffset, ByteBuffer buf,
boolean fillH... |
### Question:
FileUtil { public static long getDU(File dir) { long size = 0; if (!dir.exists()) return 0; if (!dir.isDirectory()) { return dir.length(); } else { File[] allFiles = dir.listFiles(); if(allFiles != null) { for (int i = 0; i < allFiles.length; i++) { boolean isSymLink; try { isSymLink = org.apache.commons.... |
### Question:
HFileBlock extends SchemaConfigured implements Cacheable { void sanityCheck() throws IOException { buf.rewind(); { BlockType blockTypeFromBuf = BlockType.read(buf); if (blockTypeFromBuf != blockType) { throw new IOException("Block type stored in the buffer: " + blockTypeFromBuf + ", block type field: " + ... |
### Question:
UserGroupInformation { @Override public boolean equals(Object o) { if (o == this) { return true; } else if (o == null || getClass() != o.getClass()) { return false; } else { return subject == ((UserGroupInformation) o).subject; } } UserGroupInformation(Subject subject); @InterfaceAudience.Public @Interfac... |
### Question:
UserGroupInformation { public synchronized boolean addToken(Token<? extends TokenIdentifier> token) { return (token != null) ? addToken(token.getService(), token) : false; } UserGroupInformation(Subject subject); @InterfaceAudience.Public @InterfaceStability.Evolving static void setConfiguration(Configura... |
### Question:
LdapGroupsMapping implements GroupMappingServiceProvider, Configurable { String extractPassword(String pwFile) { if (pwFile.isEmpty()) { return ""; } try { StringBuilder password = new StringBuilder(); Reader reader = new FileReader(pwFile); int c = reader.read(); while (c > -1) { password.append((char)c)... |
### Question:
Credentials implements Writable { public void addAll(Credentials other) { addAll(other, true); } Credentials(); Credentials(Credentials credentials); byte[] getSecretKey(Text alias); Token<? extends TokenIdentifier> getToken(Text alias); void addToken(Text alias, Token<? extends TokenIdentifier> t); Coll... |
### Question:
Credentials implements Writable { public void mergeAll(Credentials other) { addAll(other, false); } Credentials(); Credentials(Credentials credentials); byte[] getSecretKey(Text alias); Token<? extends TokenIdentifier> getToken(Text alias); void addToken(Text alias, Token<? extends TokenIdentifier> t); C... |
### Question:
SecurityUtil { static boolean isTGSPrincipal(KerberosPrincipal principal) { if (principal == null) return false; if (principal.getName().equals("krbtgt/" + principal.getRealm() + "@" + principal.getRealm())) { return true; } return false; } @InterfaceAudience.Public @InterfaceStability.Evolving static St... |
### Question:
SecurityUtil { @InterfaceAudience.Public @InterfaceStability.Evolving public static String getServerPrincipal(String principalConfig, String hostname) throws IOException { String[] components = getComponents(principalConfig); if (components == null || components.length != 3 || !components[1].equals(HOSTNA... |
### Question:
SecurityUtil { @InterfaceAudience.Public @InterfaceStability.Evolving public static void login(final Configuration conf, final String keytabFileKey, final String userNameKey) throws IOException { login(conf, keytabFileKey, userNameKey, getLocalHostName()); } @InterfaceAudience.Public @InterfaceStability.... |
### Question:
HFileBlock extends SchemaConfigured implements Cacheable { @Override public long heapSize() { long size = ClassSize.align( SCHEMA_CONFIGURED_UNALIGNED_HEAP_SIZE + 2 * ClassSize.REFERENCE + 6 * Bytes.SIZEOF_INT + 1 * Bytes.SIZEOF_BYTE + 2 * Bytes.SIZEOF_LONG + Bytes.SIZEOF_BOOLEAN ); if (buf != null) { siz... |
### Question:
SecurityUtil { public static String getHostFromPrincipal(String principalName) { return new HadoopKerberosName(principalName).getHostName(); } @InterfaceAudience.Public @InterfaceStability.Evolving static String getServerPrincipal(String principalConfig,
String hostname); @InterfaceAudience.Public ... |
### Question:
SecurityUtil { public static String buildDTServiceName(URI uri, int defPort) { String authority = uri.getAuthority(); if (authority == null) { return null; } InetSocketAddress addr = NetUtils.createSocketAddr(authority, defPort); return buildTokenService(addr).toString(); } @InterfaceAudience.Public @Int... |
### Question:
DomainSocket implements Closeable { public static String getEffectivePath(String path, int port) { return path.replace("_PORT", String.valueOf(port)); } private DomainSocket(String path, int fd); static String getLoadingFailureReason(); @VisibleForTesting static void disableBindPathValidation(); static S... |
### Question:
DomainSocket implements Closeable { public static DomainSocket connect(String path) throws IOException { if (loadingFailureReason != null) { throw new UnsupportedOperationException(loadingFailureReason); } int fd = connect0(path); return new DomainSocket(path, fd); } private DomainSocket(String path, int... |
### Question:
SocketIOWithTimeout { SocketIOWithTimeout(SelectableChannel channel, long timeout) throws IOException { checkChannelValidity(channel); this.channel = channel; this.timeout = timeout; channel.configureBlocking(false); } SocketIOWithTimeout(SelectableChannel channel, long timeout); void setTimeout(long time... |
### Question:
ScriptBasedMapping extends CachedDNSToSwitchMapping { @Override public void setConf(Configuration conf) { super.setConf(conf); getRawMapping().setConf(conf); } ScriptBasedMapping(); ScriptBasedMapping(Configuration conf); @Override Configuration getConf(); @Override String toString(); @Override void setC... |
### Question:
NetUtils { public static InetAddress getLocalInetAddress(String host) throws SocketException { if (host == null) { return null; } InetAddress addr = null; try { addr = SecurityUtil.getByName(host); if (NetworkInterface.getByInetAddress(addr) == null) { addr = null; } } catch (UnknownHostException ignore) ... |
### Question:
NetUtils { public static void verifyHostnames(String[] names) throws UnknownHostException { for (String name: names) { if (name == null) { throw new UnknownHostException("null hostname found"); } URI uri = null; try { uri = new URI(name); if (uri.getHost() == null) { uri = new URI("http: } } catch (URISyn... |
### Question:
NetUtils { public static boolean isLocalAddress(InetAddress addr) { boolean local = addr.isAnyLocalAddress() || addr.isLoopbackAddress(); if (!local) { try { local = NetworkInterface.getByInetAddress(addr) != null; } catch (SocketException e) { local = false; } } return local; } static SocketFactory getS... |
### Question:
NetUtils { public static InetSocketAddress getConnectAddress(Server server) { return getConnectAddress(server.getListenerAddress()); } static SocketFactory getSocketFactory(Configuration conf,
Class<?> clazz); static SocketFactory getDefaultSocketFactory(Configuration conf); static SocketFactory ge... |
### Question:
NetUtils { public static InetSocketAddress createSocketAddr(String target) { return createSocketAddr(target, -1); } static SocketFactory getSocketFactory(Configuration conf,
Class<?> clazz); static SocketFactory getDefaultSocketFactory(Configuration conf); static SocketFactory getSocketFactoryFromP... |
### Question:
HServerAddress implements WritableComparable<HServerAddress> { @Override public int hashCode() { int result = address == null? 0: address.hashCode(); result ^= toString().hashCode(); return result; } HServerAddress(); HServerAddress(InetSocketAddress address); HServerAddress(final String hostname, final... |
### Question:
NetUtils { public static String normalizeHostName(String name) { try { return InetAddress.getByName(name).getHostAddress(); } catch (UnknownHostException e) { return name; } } static SocketFactory getSocketFactory(Configuration conf,
Class<?> clazz); static SocketFactory getDefaultSocketFactory(Con... |
### Question:
NetUtils { public static String getHostNameOfIP(String ipPort) { if (null == ipPort || !ipPortPattern.matcher(ipPort).matches()) { return null; } try { int colonIdx = ipPort.indexOf(':'); String ip = (-1 == colonIdx) ? ipPort : ipPort.substring(0, ipPort.indexOf(':')); return InetAddress.getByName(ip).get... |
### Question:
HServerAddress implements WritableComparable<HServerAddress> { public HServerAddress() { super(); } HServerAddress(); HServerAddress(InetSocketAddress address); HServerAddress(final String hostname, final int port); HServerAddress(HServerAddress other); String getBindAddress(); int getPort(); String ge... |
### Question:
DFSUtil { public static String getNamenodeNameServiceId(Configuration conf) { return getNameServiceId(conf, DFS_NAMENODE_RPC_ADDRESS_KEY); } private DFSUtil(); static Random getRandom(); static SecureRandom getSecureRandom(); static boolean isValidName(String src); static String bytes2String(byte[] bytes... |
### Question:
DFSUtil { public static String getBackupNameServiceId(Configuration conf) { return getNameServiceId(conf, DFS_NAMENODE_BACKUP_ADDRESS_KEY); } private DFSUtil(); static Random getRandom(); static SecureRandom getSecureRandom(); static boolean isValidName(String src); static String bytes2String(byte[] byte... |
### Question:
DFSUtil { public static String getSecondaryNameServiceId(Configuration conf) { return getNameServiceId(conf, DFS_NAMENODE_SECONDARY_HTTP_ADDRESS_KEY); } private DFSUtil(); static Random getRandom(); static SecureRandom getSecureRandom(); static boolean isValidName(String src); static String bytes2String(... |
### Question:
DFSUtil { public static Collection<String> getNameServiceIds(Configuration conf) { return conf.getTrimmedStringCollection(DFS_NAMESERVICES); } private DFSUtil(); static Random getRandom(); static SecureRandom getSecureRandom(); static boolean isValidName(String src); static String bytes2String(byte[] byt... |
### Question:
HServerAddress implements WritableComparable<HServerAddress> { @Override public String toString() { return this.cachedToString; } HServerAddress(); HServerAddress(InetSocketAddress address); HServerAddress(final String hostname, final int port); HServerAddress(HServerAddress other); String getBindAddre... |
### Question:
FileInputStreamCache { public synchronized void close() { if (closed) return; closed = true; IOUtils.cleanup(LOG, cacheCleaner); for (Iterator<Entry<Key, Value>> iter = map.entries().iterator(); iter.hasNext();) { Entry<Key, Value> entry = iter.next(); entry.getValue().close(); iter.remove(); } } FileInpu... |
### Question:
HServerAddress implements WritableComparable<HServerAddress> { @Override public boolean equals(Object o) { if (this == o) return true; if (o == null) return false; if (getClass() != o.getClass()) return false; return compareTo((HServerAddress)o) == 0; } HServerAddress(); HServerAddress(InetSocketAddress ... |
### Question:
HServerAddress implements WritableComparable<HServerAddress> { public void readFields(DataInput in) throws IOException { String hostname = in.readUTF(); int port = in.readInt(); if (hostname != null && hostname.length() > 0) { this.address = getResolvedAddress(new InetSocketAddress(hostname, port)); check... |
### Question:
LayoutVersion { public static boolean supports(final Feature f, final int lv) { final EnumSet<Feature> set = map.get(lv); return set != null && set.contains(f); } static String getString(); static boolean supports(final Feature f, final int lv); static int getCurrentLayoutVersion(); static final int BUGF... |
### Question:
MD5FileUtils { public static MD5Hash computeMd5ForFile(File dataFile) throws IOException { InputStream in = new FileInputStream(dataFile); try { MessageDigest digester = MD5Hash.getDigester(); DigestInputStream dis = new DigestInputStream(in, digester); IOUtils.copyBytes(dis, new IOUtils.NullOutputStream(... |
### Question:
MD5FileUtils { public static void verifySavedMD5(File dataFile, MD5Hash expectedMD5) throws IOException { MD5Hash storedHash = readStoredMd5ForFile(dataFile); if (!expectedMD5.equals(storedHash)) { throw new IOException( "File " + dataFile + " did not match stored MD5 checksum " + " (stored: " + storedHas... |
### Question:
ServerName implements Comparable<ServerName> { public static ServerName parseServerName(final String str) { return SERVERNAME_PATTERN.matcher(str).matches()? new ServerName(str): new ServerName(str, NON_STARTCODE); } ServerName(final String hostname, final int port, final long startcode); ServerName(fina... |
### Question:
LightWeightLinkedSet extends LightWeightHashSet<T> { @Override public Iterator<T> iterator() { return new LinkedSetIterator(); } LightWeightLinkedSet(int initCapacity, float maxLoadFactor,
float minLoadFactor); LightWeightLinkedSet(); T pollFirst(); @Override List<T> pollN(int n); @Override List<T>... |
### Question:
ServerName implements Comparable<ServerName> { public ServerName(final String hostname, final int port, final long startcode) { this.hostname = hostname; this.port = port; this.startcode = startcode; this.servername = getServerName(hostname, port, startcode); } ServerName(final String hostname, final int ... |
### Question:
LightWeightLinkedSet extends LightWeightHashSet<T> { public T pollFirst() { if (head == null) { return null; } T first = head.element; this.remove(first); return first; } LightWeightLinkedSet(int initCapacity, float maxLoadFactor,
float minLoadFactor); LightWeightLinkedSet(); T pollFirst(); @Overri... |
### Question:
LightWeightLinkedSet extends LightWeightHashSet<T> { @Override public List<T> pollAll() { List<T> retList = new ArrayList<T>(size); while (head != null) { retList.add(head.element); head = head.after; } this.clear(); return retList; } LightWeightLinkedSet(int initCapacity, float maxLoadFactor,
float... |
### Question:
LightWeightLinkedSet extends LightWeightHashSet<T> { @Override public List<T> pollN(int n) { if (n >= size) { return pollAll(); } List<T> retList = new ArrayList<T>(n); while (n-- > 0 && head != null) { T curr = head.element; this.removeElem(curr); retList.add(curr); } shrinkIfNecessary(); return retList;... |
### Question:
LightWeightLinkedSet extends LightWeightHashSet<T> { @Override public void clear() { super.clear(); this.head = null; this.tail = null; } LightWeightLinkedSet(int initCapacity, float maxLoadFactor,
float minLoadFactor); LightWeightLinkedSet(); T pollFirst(); @Override List<T> pollN(int n); @Overrid... |
### Question:
LightWeightLinkedSet extends LightWeightHashSet<T> { @Override @SuppressWarnings("unchecked") public <U> U[] toArray(U[] a) { if (a == null) { throw new NullPointerException("Input array can not be null"); } if (a.length < size) { a = (U[]) java.lang.reflect.Array.newInstance(a.getClass() .getComponentTyp... |
### Question:
ServerName implements Comparable<ServerName> { public static long getServerStartcodeFromServerName(final String serverName) { int index = serverName.lastIndexOf(SERVERNAME_SEPARATOR); return Long.parseLong(serverName.substring(index + 1)); } ServerName(final String hostname, final int port, final long sta... |
### Question:
HDFSBlocksDistribution { public void addHostsAndBlockWeight(String[] hosts, long weight) { if (hosts == null || hosts.length == 0) { return; } addUniqueWeight(weight); for (String hostname : hosts) { addHostAndBlockWeight(hostname, weight); } } HDFSBlocksDistribution(); @Override synchronized String toStr... |
### Question:
HDFSBlocksDistribution { public void add(HDFSBlocksDistribution otherBlocksDistribution) { Map<String,HostAndWeight> otherHostAndWeights = otherBlocksDistribution.getHostAndWeights(); for (Map.Entry<String, HostAndWeight> otherHostAndWeight: otherHostAndWeights.entrySet()) { addHostAndBlockWeight(otherHos... |
### Question:
BlockMissingException extends IOException { public BlockMissingException(String filename, String description, long offset) { super(description); this.filename = filename; this.offset = offset; } BlockMissingException(String filename, String description, long offset); String getFile(); long getOffset(); }... |
### Question:
QuorumJournalManager implements JournalManager { @Override public void format(NamespaceInfo nsInfo) throws IOException { QuorumCall<AsyncLogger,Void> call = loggers.format(nsInfo); try { call.waitFor(loggers.size(), loggers.size(), 0, FORMAT_TIMEOUT_MS, "format"); } catch (InterruptedException e) { throw ... |
### Question:
QuorumJournalManager implements JournalManager { @Override public void selectInputStreams(Collection<EditLogInputStream> streams, long fromTxnId, boolean inProgressOk) throws IOException { QuorumCall<AsyncLogger, RemoteEditLogManifest> q = loggers.getEditLogManifest(fromTxnId); Map<AsyncLogger, RemoteEdit... |
### Question:
QuorumJournalManager implements JournalManager { @Override public void recoverUnfinalizedSegments() throws IOException { Preconditions.checkState(!isActiveWriter, "already active writer"); LOG.info("Starting recovery process for unclosed journal segments..."); Map<AsyncLogger, NewEpochResponseProto> resps... |
### Question:
QuorumJournalManager implements JournalManager { @Override public void close() throws IOException { loggers.close(); } QuorumJournalManager(Configuration conf,
URI uri, NamespaceInfo nsInfo); QuorumJournalManager(Configuration conf,
URI uri, NamespaceInfo nsInfo,
AsyncLogger.Factory lo... |
### Question:
FuzzyRowFilter extends FilterBase { static SatisfiesCode satisfies(byte[] row, byte[] fuzzyKeyBytes, byte[] fuzzyKeyMeta) { return satisfies(row, 0, row.length, fuzzyKeyBytes, fuzzyKeyMeta); } FuzzyRowFilter(); FuzzyRowFilter(List<Pair<byte[], byte[]>> fuzzyKeysData); @Override ReturnCode filterKeyValue(... |
### Question:
QuorumJournalManager implements JournalManager { @Override public String toString() { return "QJM to " + loggers; } QuorumJournalManager(Configuration conf,
URI uri, NamespaceInfo nsInfo); QuorumJournalManager(Configuration conf,
URI uri, NamespaceInfo nsInfo,
AsyncLogger.Factory logge... |
### Question:
IPCLoggerChannel implements AsyncLogger { @Override public ListenableFuture<Void> sendEdits( final long segmentTxId, final long firstTxnId, final int numTxns, final byte[] data) { try { reserveQueueSpace(data.length); } catch (LoggerTooFarBehindException e) { return Futures.immediateFailedFuture(e); } fin... |
### Question:
Journal implements Closeable { synchronized NewEpochResponseProto newEpoch( NamespaceInfo nsInfo, long epoch) throws IOException { checkFormatted(); storage.checkConsistentNamespace(nsInfo); if (epoch <= getLastPromisedEpoch()) { throw new IOException("Proposed epoch " + epoch + " <= last promise " + getL... |
### Question:
JournalNode implements Tool, Configurable { public InetSocketAddress getBoundIpcAddress() { return rpcServer.getAddress(); } @Override void setConf(Configuration conf); @Override Configuration getConf(); @Override int run(String[] args); void start(); boolean isStarted(); InetSocketAddress getBoundIpcAdd... |
### Question:
DatanodeDescriptor extends DatanodeInfo { public Block[] getInvalidateBlocks(int maxblocks) { synchronized (invalidateBlocks) { Block[] deleteList = invalidateBlocks.pollToArray(new Block[Math.min( invalidateBlocks.size(), maxblocks)]); return deleteList.length == 0 ? null : deleteList; } } DatanodeDescri... |
### Question:
Host2NodesMap { boolean remove(DatanodeDescriptor node) { if (node==null) { return false; } String ipAddr = node.getIpAddr(); hostmapLock.writeLock().lock(); try { DatanodeDescriptor[] nodes = map.get(ipAddr); if (nodes==null) { return false; } if (nodes.length==1) { if (nodes[0]==node) { map.remove(ipAdd... |
### Question:
JspHelper { public static String getDelegationTokenUrlParam(String tokenString) { if (tokenString == null ) { return ""; } if (UserGroupInformation.isSecurityEnabled()) { return SET_DELEGATION + tokenString; } else { return ""; } } private JspHelper(); static DatanodeInfo bestNode(LocatedBlocks blks, Con... |
### Question:
TransferFsImage { static MD5Hash getFileClient(String nnHostPort, String queryString, List<File> localPaths, Storage dstStorage, boolean getChecksum) throws IOException { String str = HttpConfig.getSchemePrefix() + nnHostPort + "/getimage?" + queryString; LOG.info("Opening connection to " + str); URL url ... |
### Question:
ParseFilter { public Filter parseFilterString (String filterString) throws CharacterCodingException { return parseFilterString(Bytes.toBytes(filterString)); } Filter parseFilterString(String filterString); Filter parseFilterString(byte [] filterStringAsByteArray); byte [] extractFilterSimpleExpression(by... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.