auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void createWithLengthLimit() throws Exception { String c256 = String.join("", Collections.nCopies(16, "0123456789ABCDEF")); assertEquals(256, c256.length()); mFileInfo.flags.set(O_WRONLY.intValue()); assertEquals(-ErrorCodes.ENAMETOOLONG(), mFuseFs.create("/foo/" + c256, 0, mFileInfo)); }

Target:
public void createWithLengthLimit() throws Exception { String c256 = String.join("", Collections.nCopies(16, "0123456789ABCDEF")); mFileInfo.flags.set(O_WRONLY.intValue()); assertEquals(-ErrorCodes.ENAMETOOLONG(), mFuseFs.create("/foo/" + c256, 0, mFileInfo)); }
Source:
public static <T> void call(Logger logger, RpcCallableThrowsIOException<T> callable, String methodName, boolean failureOk, String description, StreamObserver<T> responseObserver, Object... args) { try { responseObserver .onNext(callAndReturn(logger, callable, methodName, failureOk, description, args)); responseObserver.onCompleted(); } catch (StatusException e) { responseObserver.onError(e); } }

Target:
public static <T> void call(Logger logger, RpcCallableThrowsIOException<T> callable, String methodName, boolean failureOk, String description, StreamObserver<T> responseObserver, Object... args) { T response; try { response = callAndReturn(logger, callable, methodName, failureOk, description, args); } catch (StatusException e) { responseObserver.onError(e); return; } responseObserver.onNext(response); responseObserver.onCompleted(); }
Source:
protected String getRootKey() { if (mUri.getScheme() != null && mUri.getScheme().equals("s3a")) { return Constants.HEADER_S3A + mBucketName; } else { return Constants.HEADER_S3 + mBucketName; } }

Target:
protected String getRootKey() { if ("s3a".equals(mUri.getScheme())) { return Constants.HEADER_S3A + mBucketName; } else { return Constants.HEADER_S3 + mBucketName; } }
Source:
public boolean remove(T element) { return mQueue.removeIf(x -> x.mValue == element); }

Target:
public boolean remove(T element) { return mQueue.removeIf(x -> x.getValue() == element); }
Source:
public GrpcChannel(GrpcManagedChannelPool.ChannelKey channelKey, Channel channel, long shutdownTimeoutMs) { mChannelKey = channelKey; mChannelHealthState = channel instanceof AuthenticatedChannel ? () -> (((AuthenticatedChannel) channel).isAuthenticated() && mChannelHealthy) : () -> mChannelHealthy; if (channel instanceof AuthenticatedChannel) { // Store {@link AuthenticatedChannel::#close) for signaling end of // authenticated session during shutdown. mAuthCloseCallback = ((AuthenticatedChannel) channel)::close; } mChannel = ClientInterceptors.intercept(channel, new ChannelResponseTracker((this))); mChannelReleased = false; mShutdownTimeoutMs = shutdownTimeoutMs; }

Target:
public GrpcChannel(GrpcManagedChannelPool.ChannelKey channelKey, Channel channel, long shutdownTimeoutMs) { mChannelKey = channelKey; mChannelHealthState = () -> mChannelHealthy; mChannel = ClientInterceptors.intercept(channel, new ChannelResponseTracker((this))); mChannelReleased = false; mShutdownTimeoutMs = shutdownTimeoutMs; }
Source:
public Map<String, String> getXAttr() { return mXAttr; }

Target:
public Map<String, byte[]> getXAttr() { return mXAttr; }
Source:
private CreateOptions(String authUmask) { mAcl = null; mCreateParent = false; mEnsureAtomic = false; // default owner and group are null (unset) mOwner = null; mGroup = null; mMode = ModeUtils.applyFileUMask(Mode.defaults(), authUmask); mXAttr = new HashMap<>(); }

Target:
private CreateOptions(String authUmask) { mAcl = null; mCreateParent = false; mEnsureAtomic = false; // default owner and group are null (unset) mOwner = null; mGroup = null; mMode = ModeUtils.applyFileUMask(Mode.defaults(), authUmask); }
Source:
public synchronized void loadConfIfNotLoaded(InetSocketAddress address) throws AlluxioStatusException { boolean clusterConfLoaded = mClusterConf.clusterDefaultsLoaded(); boolean pathConfLoaded = mIsPathConfLoaded; loadConf(address, !clusterConfLoaded, !pathConfLoaded); }

Target:
public synchronized void loadConfIfNotLoaded(InetSocketAddress address) throws AlluxioStatusException { loadConf(address, !mClusterConf.clusterDefaultsLoaded(), !mIsPathConfLoaded); }
Source:
default String hash() { return null; }

Target:
default String hash() { return ""; }
Source:
public Version(Supplier<Stream<byte[]>> properties) { try { mMD5 = MessageDigest.getInstance("MD5"); } catch (NoSuchAlgorithmException e) { throw new RuntimeException(e); } mProperties = properties; mShouldUpdate = new AtomicBoolean(true); mVersion = ""; }

Target:
public Version(Supplier<Stream<byte[]>> properties) { try { mMD5 = MessageDigest.getInstance("MD5"); } catch (NoSuchAlgorithmException e) { throw new RuntimeException(e); } mProperties = properties; mShouldUpdate = new AtomicBoolean(true); }
Source:
public int hashCode() { return Objects.hashCode( mCommonOptions, mAcl, mBlockSizeBytes, mGroup, mLocationPolicy, mMode, mMountId, mOwner, mReplicationDurable, mReplicationMax, mReplicationMin, mUfsPath, mWriteTier, mWriteType ); }

Target:
public int hashCode() { return Objects.hashCode( mAcl, mBlockSizeBytes, mCommonOptions, mGroup, mLocationPolicy, mMode, mMountId, mOwner, mReplicationDurable, mReplicationMax, mReplicationMin, mUfsPath, mWriteTier, mWriteType ); }
Source:
public void record(long timeNano, int numEvents) { long leftEndPoint = bucket(timeNano); mSeries.put(leftEndPoint, (mSeries.getOrDefault(leftEndPoint, 0)) + numEvents); }

Target:
public void record(long timeNano, int numEvents) { long leftEndPoint = bucket(timeNano); mSeries.put(leftEndPoint, mSeries.getOrDefault(leftEndPoint, 0) + numEvents); }
Source:
public Map<String, List<String>> getLostStorage() { return Collections.unmodifiableMap(mLostStorage); }

Target:
public Map<String, List<String>> getLostStorage() { return new HashMap<>(mLostStorage); }
Source:
public List<String> getLostStorage() { return Collections.unmodifiableList(mLostStorage); }

Target:
public List<String> getLostStorage() { return new ArrayList<>(mLostStorage); }
Source:
public Map<String, List<String>> getDirectoryPathsOnTiers() { Map<String, List<String>> pathsOnTiers = new HashMap<>(); for (Pair<String, String> tierPath : mCapacityBytesOnDirs.keySet()) { String tier = tierPath.getFirst(); pathsOnTiers.computeIfAbsent(tier, k -> new ArrayList<>()); pathsOnTiers.get(tier).add(tierPath.getSecond()); } return pathsOnTiers; }

Target:
public Map<String, List<String>> getDirectoryPathsOnTiers() { Map<String, List<String>> pathsOnTiers = new HashMap<>(); for (Pair<String, String> tierPath : mCapacityBytesOnDirs.keySet()) { String tier = tierPath.getFirst(); pathsOnTiers.computeIfAbsent(tier, k -> new ArrayList<>()).add(tierPath.getSecond()); } return pathsOnTiers; }
Source:
private void applyPathProperties(PathPropertiesEntry entry) { final String path = entry.getPath(); final Map<String, String> properties = entry.getPropertiesMap(); if (mProperties.containsKey(path)) { mProperties.get(path).clear(); mProperties.get(path).putAll(properties); } else { mProperties.put(path, new HashMap<>(properties)); } }

Target:
private void applyPathProperties(PathPropertiesEntry entry) { String path = entry.getPath(); Map<String, String> properties = entry.getPropertiesMap(); if (mProperties.containsKey(path)) { mProperties.get(path).clear(); mProperties.get(path).putAll(properties); } else { mProperties.put(path, new HashMap<>(properties)); } }
Source:
private void applyRemovePathProperties(RemovePathPropertiesEntry entry) { final String path = entry.getPath(); mProperties.remove(path); }

Target:
private void applyRemovePathProperties(RemovePathPropertiesEntry entry) { String path = entry.getPath(); mProperties.remove(path); }
Source:
public static Collection<? extends PropertyKey> defaultKeys() { return Sets.newHashSet(DEFAULT_KEYS_MAP.values() .parallelStream().filter(key -> !PropertyKey.isRemoved(key)) .collect(Collectors.toSet())); }

Target:
public static Collection<? extends PropertyKey> defaultKeys() { return Sets.newHashSet(DEFAULT_KEYS_MAP.values()); }
Source:
public LsCommand() { mExtensionsDir = ServerConfiguration.get(PropertyKey.EXTENSIONS_DIR); }

Target:
public LsCommand() { }
Source:
private ListObjectsV2Result getObjectListingChunk(ListObjectsV2Request request) throws IOException { AmazonClientOperation<ListObjectsV2Result> op = () -> { // Query S3 for the next batch of objects. ListObjectsV2Result result = mClient.listObjectsV2(request); // Advance the request continuation token to the next set of objects. request.setContinuationToken(result.getNextContinuationToken()); return result; }; try { return retry(op, "get next chunk of listing result"); } catch (AmazonClientException e) { throw new IOException(e); } }

Target:
private ListObjectsV2Result getObjectListingChunk(ListObjectsV2Request request) throws IOException { try { return retry(() -> { // Query S3 for the next batch of objects. ListObjectsV2Result result = mClient.listObjectsV2(request); // Advance the request continuation token to the next set of objects. request.setContinuationToken(result.getNextContinuationToken()); return result; }, "get next chunk of listing result"); } catch (AmazonClientException e) { throw new IOException(e); } }
Source:
public Response createDirectory(@PathParam("path") final String path, final CreateDirectoryPOptions options) { return RestUtils.call((RestUtils.RestCallable<Void>) () -> { if (options == null) { mFileSystem.createDirectory(new AlluxioURI(path), FileSystemOptions.createDirectoryDefaults(ServerConfiguration.global())); } else { mFileSystem.createDirectory(new AlluxioURI(path), options); } return null; }, ServerConfiguration.global()); }

Target:
public Response createDirectory(@PathParam("path") final String path, final CreateDirectoryPOptions options) { return RestUtils.call((RestUtils.RestCallable<Void>) () -> { if (options == null) { mFileSystem.createDirectory(new AlluxioURI(path)); } else { mFileSystem.createDirectory(new AlluxioURI(path), options); } return null; }, ServerConfiguration.global()); }
Source:
public void getStartTimeMs() throws Exception { Assert.assertTrue(getInfo(NO_PARAMS).getStartTimeMs() > 0); }

Target:
public void getStartTimeMs() throws Exception { assertTrue(getInfo(NO_PARAMS).getStartTimeMs() > 0); }
Source:
public synchronized void close() throws IOException { if (mWriter != null) { mWriter.close(); mWriter = null; mAsyncWriter.close(); mAsyncWriter = null; } if (mTailerThread != null) { mTailerThread.awaitTermination(false); mTailerThread = null; } mState = State.CLOSED; }

Target:
public synchronized void close() throws IOException { if (mWriter != null) { mWriter.close(); mWriter = null; } if (mAsyncWriter != null) { mAsyncWriter.close(); mAsyncWriter = null; } if (mTailerThread != null) { mTailerThread.awaitTermination(false); mTailerThread = null; } mState = State.CLOSED; }
Source:
public void release(int port) { Reservation r = mReserved.remove(port); if (r != null) { r.mFile.delete(); try { r.mLock.release(); r.mChannel.close(); } catch (IOException e) { throw new RuntimeException(e); } } }

Target:
public void release(int port) { Reservation r = mReserved.remove(port); if (r != null) { // If delete fails, we may leave a file behind. However, the file will be unlocked, so another // process can still take the port. r.mFile.delete(); try { r.mLock.release(); r.mLock.channel().close(); } catch (IOException e) { throw new RuntimeException(e); } } }
Source:
void startServing() { startServing("", ""); }

Target:
protected void startServing() { startServing("", ""); }
Source:
public static BlockStore.Factory getBlockStoreFactory() { MetastoreType type = Configuration.getEnum(PropertyKey.MASTER_METASTORE, MetastoreType.class); switch (type) { case HEAP: return lockManger -> new HeapBlockStore(); case ROCKS: return args -> new RocksBlockStore(Configuration.global()); default: throw new IllegalStateException("Unknown metastore type: " + type); } }

Target:
public static BlockStore.Factory getBlockStoreFactory() { MetastoreType type = Configuration.getEnum(PropertyKey.MASTER_METASTORE, MetastoreType.class); switch (type) { case HEAP: return args -> new HeapBlockStore(args); case ROCKS: return args -> new RocksBlockStore(args); default: throw new IllegalStateException("Unknown metastore type: " + type); } }
Source:
public void remove(Long inodeId) { System.out.printf("Remove %s from rocks%n", inodeId); try { byte[] id = Longs.toByteArray(inodeId); mDb.delete(mInodesColumn, mDisableWAL, id); } catch (RocksDBException e) { throw new RuntimeException(e); } }

Target:
public void remove(Long inodeId) { try { byte[] id = Longs.toByteArray(inodeId); mDb.delete(mInodesColumn, mDisableWAL, id); } catch (RocksDBException e) { throw new RuntimeException(e); } }
Source:
public void removeChild(String name) { if (mChildren.remove(name) != null) { mWeight.decrementAndGet(); } }

Target:
public void removeChild(String name) { if (mChildren != null && mChildren.remove(name) != null) { mWeight.decrementAndGet(); } }
Source:
public void close() throws IOException { if (mClient.isShutdown()) { return; } mStream.close(); try { mStream.waitForComplete(CLOSE_TIMEOUT_MS); } finally { mContext.releaseBlockWorkerClient(mAddress, mClient); } }

Target:
public void close() throws IOException { try { if (mClient.isShutdown()) { return; } mStream.close(); mStream.waitForComplete(CLOSE_TIMEOUT_MS); } finally { mContext.releaseBlockWorkerClient(mAddress, mClient); } }
Source:
private LocalFileDataReader(LocalFileBlockReader reader, long offset, long len, long chunkSize) throws IOException { mReader = reader; Preconditions.checkArgument(chunkSize > 0); mPos = offset; mEnd = Math.min(mReader.getLength(), offset + len); mChunkSize = chunkSize; }

Target:
private LocalFileDataReader(LocalFileBlockReader reader, long offset, long len, long chunkSize) { mReader = reader; Preconditions.checkArgument(chunkSize > 0); mPos = offset; mEnd = Math.min(mReader.getLength(), offset + len); mChunkSize = chunkSize; }
Source:
public static FileSystemContext create(Subject subject, MasterInquireClient masterInquireClient, AlluxioConfiguration alluxioConf) { AlluxioProperties props = null; if (alluxioConf != null) { props = alluxioConf.getProperties(); } FileSystemContext context = new FileSystemContext(subject, props); context.init(masterInquireClient); return context; }

Target:
public static FileSystemContext create(Subject subject, MasterInquireClient masterInquireClient, AlluxioConfiguration alluxioConf) { FileSystemContext context = new FileSystemContext(subject, alluxioConf); context.init(masterInquireClient); return context; }
Source:
public static AlluxioConfiguration merge(AlluxioConfiguration conf, Map<?, ?> properties, Source source) { AlluxioProperties props = conf.getProperties(); props.merge(properties, source); return new InstancedConfiguration(props); }

Target:
public static void merge(AlluxioConfiguration conf, Map<?, ?> properties, Source source) { AlluxioProperties props = conf.getProperties(); props.merge(properties, source); }
Source:
public void close() throws IOException { mChannel.shutdown(); try { long timeout = Configuration.getMs(PropertyKey.WORKER_NETWORK_NETTY_SHUTDOWN_TIMEOUT); if (!mChannel.awaitTermination(timeout, TimeUnit.MILLISECONDS)) { LOGGER.warn("Timed out after {}ms to close gRPC channel to block worker.", timeout); } } catch (InterruptedException e) { Thread.currentThread().interrupt(); throw new RuntimeException(e); } }

Target:
public void close() throws IOException { mChannel.shutdown(); }
Source:
public void stop() throws IOException { if (mAsyncAuditLogWriter != null) { mAsyncAuditLogWriter.stop(); mAsyncAuditLogWriter = null; } super.stop(); mSyncManager.stop(); }

Target:
public void stop() throws IOException { if (mAsyncAuditLogWriter != null) { mAsyncAuditLogWriter.stop(); mAsyncAuditLogWriter = null; } mSyncManager.stop(); super.stop(); }
Source:
public List<alluxio.wire.SyncPointInfo> getSyncPathList() throws IOException, AlluxioException { FileSystemMasterClient masterClient = mFileSystemContext.acquireMasterClient(); try { return masterClient.getSyncPathList(); } catch (UnavailableException e) { throw e; } catch (AlluxioStatusException e) { throw e.toAlluxioException(); } finally { mFileSystemContext.releaseMasterClient(masterClient); } }

Target:
public List<SyncPointInfo> getSyncPathList() throws IOException, AlluxioException { FileSystemMasterClient masterClient = mFileSystemContext.acquireMasterClient(); try { return masterClient.getSyncPathList(); } catch (UnavailableException e) { throw e; } catch (AlluxioStatusException e) { throw e.toAlluxioException(); } finally { mFileSystemContext.releaseMasterClient(masterClient); } }
Source:
private static String newDbPath(String baseDir) { // We use a unique subdirectory to avoid conflicts with the previous RocksDB instance when we // re-create the db in initDB(). return PathUtils.concatPath(baseDir, "blocks-" + System.nanoTime() + "-" + CommonUtils.randomAlphaNumString(3)); }

Target:
private static String newDbPath(String baseDir) { // We use a unique subdirectory to avoid conflicts with the previous RocksDB instance when we // re-create the db in initDB(). return PathUtils.concatPath(baseDir, "blocks-" + System.currentTimeMillis() + "-" + CommonUtils.randomAlphaNumString(3)); }
Source:
public void createFileOutsideOfAlluxio(AlluxioURI uri) throws Exception { try (FileOutStream os = mFileSystem.createFile(uri, CreateFileOptions.defaults() .setWriteType(WriteType.THROUGH) .setBlockSizeBytes(TEST_BLOCK_SIZE))) { os.write(BufferUtils.getIncreasingByteArray(TEST_BLOCK_SIZE + 1)); } }

Target:
private void createFileOutsideOfAlluxio(AlluxioURI uri) throws Exception { try (FileOutStream os = mFileSystem.createFile(uri, CreateFileOptions.defaults() .setWriteType(WriteType.THROUGH) .setBlockSizeBytes(TEST_BLOCK_SIZE))) { os.write(BufferUtils.getIncreasingByteArray(TEST_BLOCK_SIZE + 1)); } }
Source:
private void assertBadAuthority(String authority, String failureMessage) throws Exception { try { useUriWithAuthority("zk@a:0,b:0,c:1"); fail(failureMessage); } catch (IllegalArgumentException e) { assertThat(e.getMessage(), containsString("does not match")); } }

Target:
private void assertBadAuthority(String authority, String failureMessage) throws Exception { try { useUriWithAuthority(authority); fail(failureMessage); } catch (IllegalArgumentException e) { assertThat(e.getMessage(), containsString("does not match")); } }
Source:
public int getInt(PropertyKey key) { String rawValue = get(key); try { return Integer.parseInt(lookup(rawValue)); } catch (NumberFormatException e) { throw new RuntimeException(ExceptionMessage.KEY_NOT_INTEGER.getMessage(key)); } catch (UnresolvablePropertyException e) { throw new RuntimeException(e); } }

Target:
public int getInt(PropertyKey key) { String rawValue = get(key); try { return Integer.parseInt(rawValue); } catch (NumberFormatException e) { throw new RuntimeException(ExceptionMessage.KEY_NOT_INTEGER.getMessage(key)); } }
Source:
public void noAuthorityNoWarning() throws IOException { URI unknown = URI.create("alluxio:///"); FileSystem.get(unknown, new org.apache.hadoop.conf.Configuration()); assertFalse(mTestLogger.mAppender.wasLogged("Authority \"\" is unknown")); }

Target:
public void noAuthorityNoWarning() throws IOException { URI unknown = URI.create("alluxio:///"); FileSystem.get(unknown, new org.apache.hadoop.conf.Configuration()); assertFalse(mTestLogger.wasLogged("Authority \"\" is unknown")); }
Source:
public void run() { mLastHeartbeatThread.start(); try { // Shutdown hooks should run quickly, so we limit the wait time to 500ms. It isn't the end // of the world if the final heartbeat fails. mLastHeartbeatThread.join(500); if (mLastHeartbeatThread.isAlive()) { LOG.warn("Failed to heartbeat to the metrics master before exit"); } } catch (InterruptedException e) { return; } }

Target:
public void run() { mLastHeartbeatThread.start(); try { // Shutdown hooks should run quickly, so we limit the wait time to 500ms. It isn't the end // of the world if the final heartbeat fails. mLastHeartbeatThread.join(500); } catch (InterruptedException e) { return; } finally { if (mLastHeartbeatThread.isAlive()) { LOG.warn("Failed to heartbeat to the metrics master before exit"); } } }
Source:
public void close() throws IOException { // super.close should be called first before releasing the resources in this instance, as the // super class may invoke other methods in this class. For example, // org.apache.hadoop.fs.FileSystem.close may check the existence of certain temp files before // closing super.close(); synchronized (CACHED_CONTEXTS_LOCK) { Pair<FileSystemContext, AtomicInteger> contextAndRefCount = CACHED_CONTEXTS.get(mContext.getParentSubject()); if (contextAndRefCount == null) { LOG.warn("Failed to find context to close, have you called close multiple times?"); return; } if (contextAndRefCount.getSecond().decrementAndGet() == 0) { contextAndRefCount.getFirst().close(); } } }

Target:
public void close() throws IOException { // super.close should be called first before releasing the resources in this instance, as the // super class may invoke other methods in this class. For example, // org.apache.hadoop.fs.FileSystem.close may check the existence of certain temp files before // closing super.close(); if (mContext != null) { mContext.close(); } }
Source:
public void mergeEmptyHadoopConfiguration() throws URISyntaxException { org.apache.hadoop.conf.Configuration hadoopConfig = new org.apache.hadoop.conf.Configuration(); long beforeSize = Configuration.toMap().size(); HadoopConfigurationUtils.mergeHadoopConfiguration(hadoopConfig, Configuration.global()); long afterSize = Configuration.toMap().size(); Assert.assertEquals(beforeSize, afterSize); Assert.assertFalse(Configuration.getBoolean(PropertyKey.ZOOKEEPER_ENABLED)); }

Target:
public void mergeEmptyHadoopConfiguration() { org.apache.hadoop.conf.Configuration hadoopConfig = new org.apache.hadoop.conf.Configuration(); long beforeSize = Configuration.toMap().size(); HadoopConfigurationUtils.mergeHadoopConfiguration(hadoopConfig, Configuration.global()); long afterSize = Configuration.toMap().size(); Assert.assertEquals(beforeSize, afterSize); Assert.assertFalse(Configuration.getBoolean(PropertyKey.ZOOKEEPER_ENABLED)); }
Source:
public String getHost() { if (getAuthorityType() == AuthorityType.SINGLE_MASTER) { SingleMasterAuthority authority = (SingleMasterAuthority) mUri.getAuthority(); return authority.getHost(); } return null; }

Target:
public String getHost() { if (mUri.getAuthority() instanceof SingleMasterAuthority) { SingleMasterAuthority authority = (SingleMasterAuthority) mUri.getAuthority(); return authority.getHost(); } return null; }
Source:
private TtlBucket getBucketContaining(Inode<?> inode) { if (inode.getTtl() <= Constants.NO_TTL) { // no bucket will contain a inode with NO_TTL. return null; } long ttlEndTimeMs = inode.getCreationTimeMs() + inode.getTtl(); // Gets the last bucket with interval start time less than or equal to the inode's life end // time. TtlBucket bucket = mBucketList.floor(new TtlBucket(ttlEndTimeMs)); if (bucket == null || bucket.getTtlIntervalEndTimeMs() < ttlEndTimeMs || (bucket.getTtlIntervalEndTimeMs() == ttlEndTimeMs && TtlBucket.getTtlIntervalMs() != 0)) { // 1. There is no bucket in the list, or // 2. All buckets' interval start time is larger than the inode's life end time, or // 3. No bucket actually contains ttlEndTimeMs in its interval. return null; } return bucket; }

Target:
private TtlBucket getBucketContaining(Inode<?> inode) { if (inode.getTtl() == Constants.NO_TTL) { // no bucket will contain a inode with NO_TTL. return null; } long ttlEndTimeMs = inode.getCreationTimeMs() + inode.getTtl(); // Gets the last bucket with interval start time less than or equal to the inode's life end // time. TtlBucket bucket = mBucketList.floor(new TtlBucket(ttlEndTimeMs)); if (bucket == null || bucket.getTtlIntervalEndTimeMs() < ttlEndTimeMs || (bucket.getTtlIntervalEndTimeMs() == ttlEndTimeMs && TtlBucket.getTtlIntervalMs() != 0)) { // 1. There is no bucket in the list, or // 2. All buckets' interval start time is larger than the inode's life end time, or // 3. No bucket actually contains ttlEndTimeMs in its interval. return null; } return bucket; }
Source:
public MetricsCommand(MetaMasterClient metaMasterClient, PrintStream printStream) throws IOException { mMetaMasterClient = metaMasterClient; mPrintStream = printStream; mMetricsMap = new TreeMap<>(mMetaMasterClient.getMetrics()); }

Target:
public MetricsCommand(MetaMasterClient metaMasterClient, PrintStream printStream) throws IOException { mMetaMasterClient = metaMasterClient; mPrintStream = printStream; }
Source:
public void setAcl(String path, AccessControlList acl) { // Noop here by default }

Target:
public void setAcl(String path, AccessControlList acl) throws IOException{ // Noop here by default }
Source:
public synchronized ConfigCheckReport getConfigCheckReport() { if (mConfigDirty == true) { mConfigDirty = false; regenerateReport(); } return mConfigCheckReport; }

Target:
public synchronized ConfigCheckReport getConfigCheckReport() { if (mConfigDirty) { // Reset mConfigDirty *before* calling regenerateReport so that if the configuration changes // during report regeneration, the change will be reflected in the next call to // getConfigCheckReport. mConfigDirty = false; regenerateReport(); } return mConfigCheckReport; }
Source:
public T removeAcl(List<AclEntry> entries) throws IOException { for (AclEntry entry : entries) { if (entry.isDefault()) { AccessControlList defaultAcl = getDefaultACL(); if (defaultAcl != null) { defaultAcl.removeEntry(entry); } } else { mAcl.removeEntry(entry); } } return getThis(); }

Target:
public T removeAcl(List<AclEntry> entries) throws IOException { for (AclEntry entry : entries) { if (entry.isDefault()) { AccessControlList defaultAcl = getDefaultACL(); defaultAcl.removeEntry(entry); } else { mAcl.removeEntry(entry); } } return getThis(); }
Source:
public String stripPrefixIfPresent(String path) { String stripedKey = CommonUtils.stripPrefixIfPresent(path, PathUtils.normalizePath(getRootKey(), PATH_SEPARATOR)); if (!stripedKey.equals(path)) { return stripedKey; } return CommonUtils.stripPrefixIfPresent(path, PATH_SEPARATOR); }

Target:
protected String stripPrefixIfPresent(String path) { String stripedKey = CommonUtils.stripPrefixIfPresent(path, PathUtils.normalizePath(getRootKey(), PATH_SEPARATOR)); if (!stripedKey.equals(path)) { return stripedKey; } return CommonUtils.stripPrefixIfPresent(path, PATH_SEPARATOR); }
Source:
LockedInodePath(AlluxioURI uri, InodeLockList lockList, InodeTree.LockMode lockMode) throws InvalidPathException { Preconditions.checkArgument(!lockList.getInodes().isEmpty()); mUri = uri; mPathComponents = PathUtils.getPathComponents(mUri.getPath()); mLockList = lockList; mLockMode = lockMode; }

Target:
LockedInodePath(AlluxioURI uri, InodeLockList lockList, InodeTree.LockMode lockMode) throws InvalidPathException { Preconditions.checkArgument(!lockList.isEmpty()); mUri = uri; mPathComponents = PathUtils.getPathComponents(mUri.getPath()); mLockList = lockList; mLockMode = lockMode; }
Source:
public boolean isOpen() { return mTransport != null && mTransport.isOpen(); }

Target:
public boolean isOpen() { return mTransport.isOpen(); }
Source:
public ServerConfigurationChecker(ServerConfigurationStore masterStore, ServerConfigurationStore workerStore) { mMasterStore = masterStore; mWorkerStore = workerStore; mConfigCheckReport = new ConfigCheckReport(); mLastLogConfigReportTimeMs = System.currentTimeMillis(); mMasterStore.registerChangeListener(this::regenerateReport); }

Target:
public ServerConfigurationChecker(ServerConfigurationStore masterStore, ServerConfigurationStore workerStore) { mMasterStore = masterStore; mWorkerStore = workerStore; mConfigCheckReport = new ConfigCheckReport(); mMasterStore.registerChangeListener(this::regenerateReport); }
Source:
public Address setHost(String host) { Preconditions.checkNotNull(host, "host"); mHost = host; return this; }

Target:
public Address setHost(String host) { mHost = Preconditions.checkNotNull(host, "host"); return this; }
Source:
public void before() throws Exception { GROUPS.put(IMPERSONATION_USER, IMPERSONATION_GROUP1 + "," + IMPERSONATION_GROUP2); GROUPS.put(HDFS_USER, HDFS_GROUP1 + "," + HDFS_GROUP2); // Give the root dir 777, to write files as different users. FileSystem.Factory.get().setAttribute(new AlluxioURI("/"), SetAttributeOptions.defaults().setMode(new Mode((short) 0777))); }

Target:
public void before() throws Exception { // Give the root dir 777, to write files as different users. This must be run as the user // that starts the master process FileSystem.Factory.get().setAttribute(new AlluxioURI("/"), SetAttributeOptions.defaults().setMode(new Mode((short) 0777))); }
Source:
public String getId() { return mId; }

Target:
public long getId() { return mId; }
Source:
public synchronized void heartbeat(final List<Metric> metrics) throws IOException { retryRPC(new RpcCallable<Void>() { @Override public Void call() throws TException { mClient.metricsHeartbeat(FileSystemContext.INSTANCE.getId(), NetworkAddressUtils.getClientHostName(), new MetricsHeartbeatTOptions(metrics)); return null; } }); }

Target:
public synchronized void heartbeat(final List<Metric> metrics) throws IOException { retryRPC(new RpcCallable<Void>() { @Override public Void call() throws TException { mClient.metricsHeartbeat(Long.toString(FileSystemContext.get().getId()), NetworkAddressUtils.getClientHostName(), new MetricsHeartbeatTOptions(metrics)); return null; } }); }
Source:
public void clientHeartbeat(String clientId, String hostname, List<Metric> metrics) { if (metrics.isEmpty()) { return; } mMetricsStore.putClientMetrics(hostname, clientId, metrics); }

Target:
public void clientHeartbeat(String clientId, String hostname, List<Metric> metrics) { mMetricsStore.putClientMetrics(hostname, clientId, metrics); }
Source:
public static FileSystemContext get() { if (sInstance == null) { synchronized (FileSystemContext.class) { sInstance = create(); } } return sInstance; }

Target:
public static FileSystemContext get() { if (sInstance == null) { synchronized (FileSystemContext.class) { if (sInstance == null) { sInstance = create(); } } } return sInstance; }
Source:
private static void initializeGauges() { MetricsSystem.registerGaugeIfAbsent(MetricsSystem.getClientMetricName("NettyConnectionsOpen"), new Gauge<Long>() { @Override public Long getValue() { long ret = 0; for (NettyChannelPool pool : sInstance.mNettyChannelPools.values()) { ret += pool.size(); } return ret; } }); }

Target:
private static void initializeGauges() { MetricsSystem.registerGaugeIfAbsent(MetricsSystem.getClientMetricName("NettyConnectionsOpen"), new Gauge<Long>() { @Override public Long getValue() { long ret = 0; for (NettyChannelPool pool : get().mNettyChannelPools.values()) { ret += pool.size(); } return ret; } }); }
Source:
public MetaCommand masterHeartbeat(long masterId) { MasterInfo master = mMasters.getFirstByField(ID_INDEX, masterId); if (master == null) { LOG.warn("Could not find master id: for heartbeat.", masterId); return MetaCommand.Register; } synchronized (master) { master.updateLastUpdatedTimeMs(); } return MetaCommand.Nothing; }

Target:
public MetaCommand masterHeartbeat(long masterId) { MasterInfo master = mMasters.getFirstByField(ID_INDEX, masterId); if (master == null) { LOG.warn("Could not find master id: for heartbeat.", masterId); return MetaCommand.Register; } master.updateLastUpdatedTimeMs(); return MetaCommand.Nothing; }
Source:
protected void stopMasters() { try { mWorkerConfigChecker.reset(); mRegistry.stop(); } catch (IOException e) { throw Throwables.propagate(e); } }

Target:
protected void stopMasters() { try { mRegistry.stop(); } catch (IOException e) { throw Throwables.propagate(e); } }
Source:
public alluxio.thrift.Metric toThrift() { alluxio.thrift.Metric metric = new alluxio.thrift.Metric(); metric.setInstance(mInstance); metric.setHostname(mHostname); metric.setName(mName); if (!(mValue instanceof Integer) && !(mValue instanceof Long)) { LOG.error("The value of metric %s is neither integer nor long", this); } metric.setValue(((Number) mValue).longValue()); return metric; }

Target:
public alluxio.thrift.Metric toThrift() { alluxio.thrift.Metric metric = new alluxio.thrift.Metric(); metric.setInstance(mInstance.toString()); metric.setHostname(mHostname); metric.setName(mName); metric.setValue(mValue); return metric; }
Source:
protected DefaultMetricsMaster(MasterContext masterContext) { this(masterContext, new SystemClock(), ExecutorServiceFactories .fixedThreadPoolExecutorServiceFactory(Constants.METRICS_MASTER_NAME, 2)); }

Target:
DefaultMetricsMaster(MasterContext masterContext) { this(masterContext, new SystemClock(), ExecutorServiceFactories .fixedThreadPoolExecutorServiceFactory(Constants.METRICS_MASTER_NAME, 2)); }
Source:
public long getValue(Map<MetricsFilter, Set<Metric>> map) { long value = 0; for (Metric metric : map.get(mFilter)) { value += (long) metric.getValue(); } return value; }

Target:
public long getValue(Map<MetricsFilter, Set<Metric>> map) { long value = 0; for (Metric metric : map.get(mFilter)) { value += metric.getValue(); } return value; }
Source:
public static Map<String, String> toMap() { Map<String, String> map = toRawMap(); // Resolve values with ${VALUE} format String nestedPropIdentifier = "$"; for (Map.Entry<String, String> entry : map.entrySet()) { String value = entry.getValue(); if (value != null && value.contains(nestedPropIdentifier)) { map.put(entry.getKey(), lookup(value)); } } return map; }

Target:
public static Map<String, String> toMap() { Map<String, String> map = toRawMap(); for (Map.Entry<String, String> entry : map.entrySet()) { String value = entry.getValue(); if (value != null) { map.put(entry.getKey(), lookup(value)); } } return map; }
Source:
public AccessControlList getAcl(String path) throws UnimplementedException, IOException { throw new UnimplementedException("ACL is not supported"); }

Target:
public AccessControlList getAcl(String path) throws IOException { return null; }
Source:
public void testMetricsCapacity() { when(mBlockMaster.getCapacityBytes()).thenReturn(1000L); Assert.assertEquals(1000L, getGauge(Metrics.CAPACITY_TOTAL)); when(mBlockMaster.getUsedBytes()).thenReturn(200L); Assert.assertEquals(200L, getGauge(Metrics.CAPACITY_USED)); Assert.assertEquals(800L, getGauge(Metrics.CAPACITY_FREE)); }

Target:
public void testMetricsCapacity() { when(mBlockMaster.getCapacityBytes()).thenReturn(1000L); assertEquals(1000L, getGauge(Metrics.CAPACITY_TOTAL)); when(mBlockMaster.getUsedBytes()).thenReturn(200L); assertEquals(200L, getGauge(Metrics.CAPACITY_USED)); assertEquals(800L, getGauge(Metrics.CAPACITY_FREE)); }
Source:
public CapacityCommand(BlockMasterClient blockMasterClient, PrintStream printStream) { mBlockMasterClient = blockMasterClient; mPrintStream = printStream; initValues(); }

Target:
public CapacityCommand(BlockMasterClient blockMasterClient, PrintStream printStream) { mBlockMasterClient = blockMasterClient; mPrintStream = printStream; }
Source:
public synchronized List<WorkerInfo> getWorkerReport( final GetWorkerReportOptions options) throws IOException { return retryRPC(new RpcCallable<List<WorkerInfo>>() { @Override public List<WorkerInfo> call() throws TException { List<WorkerInfo> result = new ArrayList<>(); for (alluxio.thrift.WorkerInfo workerInfo : mClient .getWorkerReport(options.toThrift()).getWorkerInfoList()) { result.add(ThriftUtils.fromThrift(workerInfo)); } return result; } }); }

Target:
public synchronized List<WorkerInfo> getWorkerReport( final GetWorkerReportOptions options) throws IOException { return retryRPC(() -> { List<WorkerInfo> result = new ArrayList<>(); for (alluxio.thrift.WorkerInfo workerInfo : mClient .getWorkerReport(options.toThrift()).getWorkerInfoList()) { result.add(ThriftUtils.fromThrift(workerInfo)); } return result; }); }
Source:
public GetWorkerInfoListTResponse getWorkerInfoList(GetWorkerInfoListTOptions options) throws AlluxioTException { return RpcUtils.call(LOG, new RpcCallableThrowsIOException<GetWorkerInfoListTResponse>() { @Override public GetWorkerInfoListTResponse call() throws AlluxioException, AlluxioStatusException { List<WorkerInfo> workerInfos = new ArrayList<>(); for (alluxio.wire.WorkerInfo workerInfo : mBlockMaster.getWorkerInfoList()) { workerInfos.add(ThriftUtils.toThrift(workerInfo)); } return new GetWorkerInfoListTResponse(workerInfos); } }); }

Target:
public GetWorkerInfoListTResponse getWorkerInfoList(GetWorkerInfoListTOptions options) throws AlluxioTException { return RpcUtils.call(LOG, (RpcCallableThrowsIOException<GetWorkerInfoListTResponse>) () -> { List<WorkerInfo> workerInfos = new ArrayList<>(); for (alluxio.wire.WorkerInfo workerInfo : mBlockMaster.getWorkerInfoList()) { workerInfos.add(ThriftUtils.toThrift(workerInfo)); } return new GetWorkerInfoListTResponse(workerInfos); }); }
Source:
public Options getOptions() { return new Options() .addOption(LIVE_OPTION) .addOption(LOST_OPTION) .addOption(SPECIFIED_OPTION) .addOption(HELP_OPTION); }

Target:
public Options getOptions() { return new Options() .addOption(HELP_OPTION) .addOption(LIVE_OPTION) .addOption(LOST_OPTION) .addOption(SPECIFIED_OPTION); }
Source:
public String getDescription() { return "Report Alluxio running cluster information.\n" + "Where [category] is an optional argument. If no arguments are passed in, " + "summary information will be printed out.\n" + "[category] can be one of the following:\n" + " summary cluster summary\n" + " capacity worker capacity information\n"; }

Target:
public String getDescription() { return "Report Alluxio running cluster information.\n" + "Where [category] is an optional argument. If no arguments are passed in, " + "summary information will be printed out.\n" + "[category] can be one of the following:\n" + " capacity worker capacity information\n" + " summary cluster summary\n"; }
Source:
public BlockMasterInfo setCapacityBytesOnTiers(Map<String, Long> capacityBytesOnTiers) { mCapacityBytesOnTiers = new HashMap<>(); for (Map.Entry<String, Long> entry : capacityBytesOnTiers.entrySet()) { long capacity = entry.getValue(); if (capacity > 0) { mCapacityBytesOnTiers.put(entry.getKey(), capacity); } } return this; }

Target:
public BlockMasterInfo setCapacityBytesOnTiers(Map<String, Long> capacityBytesOnTiers) { mCapacityBytesOnTiers = new HashMap<>(capacityBytesOnTiers); return this; }
Source:
public int hashCode() { return Objects.hashCode(mLiveWorkerNum, mLostWorkerNum, mCapacityBytes, mUsedBytes, mFreeBytes, mCapacityBytesOnTiers, mUsedBytesOnTiers); }

Target:
public int hashCode() { return Objects.hashCode(mCapacityBytes, mCapacityBytesOnTiers, mFreeBytes, mLiveWorkerNum, mLostWorkerNum, mUsedBytes, mUsedBytesOnTiers); }
Source:
public RetryHandlingBlockMasterClient(MasterClientConfig conf) { super(conf); mClient = null; }

Target:
public RetryHandlingBlockMasterClient(MasterClientConfig conf) { super(conf); }
Source:
public synchronized BlockMasterInfo getBlockMasterInfo(final Set<BlockMasterInfoField> fields) throws IOException { return retryRPC(() -> { Set<alluxio.thrift.BlockMasterInfoField> thriftFields = new HashSet<>(); if (fields == null) { thriftFields = null; } else { for (BlockMasterInfoField field : fields) { thriftFields.add(field.toThrift()); } } return ThriftUtils.fromThrift( mClient.getBlockMasterInfo(new GetBlockMasterInfoTOptions(thriftFields)) .getBlockMasterInfo()); }); }

Target:
public synchronized BlockMasterInfo getBlockMasterInfo(final Set<BlockMasterInfoField> fields) throws IOException { return retryRPC(() -> { Set<alluxio.thrift.BlockMasterInfoField> thriftFields = null; if (fields != null) { thriftFields = new HashSet<>(); for (BlockMasterInfoField field : fields) { thriftFields.add(field.toThrift()); } } return ThriftUtils.fromThrift( mClient.getBlockMasterInfo(new GetBlockMasterInfoTOptions(thriftFields)) .getBlockMasterInfo()); }); }
Source:
public void validateArgs(String... args) throws InvalidArgumentException { if (args.length > 2) { throw new InvalidArgumentException( ExceptionMessage.INVALID_ARGS_GENERIC.getMessage(getCommandName())); } }

Target:
public void validateArgs(String... args) throws InvalidArgumentException { if (args.length > 1) { throw new InvalidArgumentException( ExceptionMessage.INVALID_ARGS_GENERIC.getMessage(getCommandName())); } }
Source:
public ReportCommand() { mMetaMasterClient = new RetryHandlingMetaMasterClient(MasterClientConfig.defaults()); mBlockMasterClient = new RetryHandlingBlockMasterClient(MasterClientConfig.defaults()); mPrintStream = new PrintStream(System.out); }

Target:
public ReportCommand() { mMetaMasterClient = new RetryHandlingMetaMasterClient(MasterClientConfig.defaults()); mBlockMasterClient = new RetryHandlingBlockMasterClient(MasterClientConfig.defaults()); mPrintStream = System.out; }
Source:
public boolean remove(@Nullable Object object) { if (object == null) { return false; } assert object != null : "@AssumeAssertion(nullness)"; // Locking this object protects against removing the exact object that might be in the // process of being added, but does not protect against removing a distinct, but equivalent // object. synchronized (object) { if (mPrimaryIndex != null && mPrimaryIndex.containsObject((T) object)) { // This isn't technically typesafe. However, given that success is true, it's very unlikely // that the object passed to remove is not of type <T>. @SuppressWarnings("unchecked") T tObj = (T) object; removeFromIndices(tObj); return true; } else { return false; } } }

Target:
public boolean remove(@Nullable Object object) { if (object == null) { return false; } // Locking this object protects against removing the exact object that might be in the // process of being added, but does not protect against removing a distinct, but equivalent // object. synchronized (object) { if (mPrimaryIndex.containsObject((T) object)) { // This isn't technically typesafe. However, given that success is true, it's very unlikely // that the object passed to remove is not of type <T>. @SuppressWarnings("unchecked") T tObj = (T) object; removeFromIndices(tObj); return true; } else { return false; } } }
Source:
public Options getOptions() { return new Options() .addOption(RECURSIVE_OPTION) .addOption(FORCE_OPTION) .addOption(LIST_DIR_AS_FILE_OPTION) .addOption(LIST_PINNED_FILES_OPTION) .addOption(LIST_HUMAN_READABLE_OPTION) .addOption(SORT_OPTION) .addOption(REVERSE_SORT_OPTION); }

Target:
public Options getOptions() { return new Options() .addOption(FORCE_OPTION) .addOption(LIST_DIR_AS_FILE_OPTION) .addOption(LIST_HUMAN_READABLE_OPTION) .addOption(LIST_PINNED_FILES_OPTION) .addOption(RECURSIVE_OPTION) .addOption(REVERSE_SORT_OPTION) .addOption(SORT_OPTION); }
Source:
public boolean isInSafeMode() { // bails out early before expensive clock checks if (!mWorkerConnectWaitStartTimeMs.isMarked()) { return false; } Long startTime = mWorkerConnectWaitStartTimeMs.getReference(); if (startTime == null) { // master has not started waiting for workers yet return true; } // lazily updates safe mode state upon inquiry long waitTime = Configuration.getMs(PropertyKey.MASTER_WORKER_CONNECT_WAIT_TIME); if (mClock.millis() - startTime < waitTime) { return true; } return !mWorkerConnectWaitStartTimeMs.compareAndSet(startTime, null, true, false); }

Target:
public boolean isInSafeMode() { // bails out early before expensive clock checks if (!mWorkerConnectWaitStartTimeMs.isMarked()) { return false; } Long startTime = mWorkerConnectWaitStartTimeMs.getReference(); if (startTime == null) { // master has not started waiting for workers yet return true; } // lazily updates safe mode state upon inquiry long waitTime = Configuration.getMs(PropertyKey.MASTER_WORKER_CONNECT_WAIT_TIME); if (mClock.millis() - startTime < waitTime) { return true; } mWorkerConnectWaitStartTimeMs.compareAndSet(startTime, null, true, false); return mWorkerConnectWaitStartTimeMs.isMarked(); }
Source:
public boolean validate(Map<String, String> optionsMap) { if (shouldSkip()) { return true; } if (!validateHdfsSettingParity(optionsMap)) { return false; } return true; }

Target:
public boolean validate(Map<String, String> optionsMap) { if (!validateHdfsSettingParity(optionsMap)) { return false; } return true; }
Source:
protected void startServing(String startMessage, String stopMessage) { MetricsSystem.startSinks(); mSafeModeManager.notifyRpcServerStarted(); startServingWebServer(); startJvmMonitorProcess(); LOG.info("Alluxio master version started{}. " + "bindHost={}, connectHost={}, rpcPort={}, webPort={}", RuntimeConstants.VERSION, startMessage, NetworkAddressUtils.getBindAddress(ServiceType.MASTER_RPC), NetworkAddressUtils.getConnectAddress(ServiceType.MASTER_RPC), NetworkAddressUtils.getPort(ServiceType.MASTER_RPC), NetworkAddressUtils.getPort(ServiceType.MASTER_WEB)); startServingRPCServer(); LOG.info("Alluxio master ended{}", stopMessage); }

Target:
protected void startServing(String startMessage, String stopMessage) { MetricsSystem.startSinks(); startServingWebServer(); startJvmMonitorProcess(); LOG.info("Alluxio master version started{}. " + "bindHost={}, connectHost={}, rpcPort={}, webPort={}", RuntimeConstants.VERSION, startMessage, NetworkAddressUtils.getBindAddress(ServiceType.MASTER_RPC), NetworkAddressUtils.getConnectAddress(ServiceType.MASTER_RPC), NetworkAddressUtils.getPort(ServiceType.MASTER_RPC), NetworkAddressUtils.getPort(ServiceType.MASTER_WEB)); startServingRPCServer(); LOG.info("Alluxio master ended{}", stopMessage); }
Source:
private void init(long offset) throws BlockDoesNotExistException, IOException { UnderFileSystem ufs = mUfsManager.get(mBlockMeta.getMountId()).getUfs(); ufs.connectFromWorker( NetworkAddressUtils.getConnectHost(NetworkAddressUtils.ServiceType.WORKER_RPC)); try { updateUnderFileSystemInputStream(offset); } catch (IOException e) { throw new BlockDoesNotExistException( ExceptionMessage.UFS_PATH_DOES_NOT_EXIST.getMessage(mBlockMeta.getUnderFileSystemPath()), e); } updateBlockWriter(offset); }

Target:
private void init(long offset) throws IOException { UnderFileSystem ufs = mUfsManager.get(mBlockMeta.getMountId()).getUfs(); ufs.connectFromWorker( NetworkAddressUtils.getConnectHost(NetworkAddressUtils.ServiceType.WORKER_RPC)); updateUnderFileSystemInputStream(offset); updateBlockWriter(offset); }
Source:
protected ObjectUnderFileSystem(AlluxioURI uri, UnderFileSystemConfiguration ufsConf) { super(uri, ufsConf); int numThreads = Configuration.getInt(PropertyKey.UNDERFS_OBJECT_STORE_SERVICE_THREADS); mExecutorService = ExecutorServiceFactories.fixedThreadPoolExecutorServiceFactory( "alluxio-underfs-object-service-worker", numThreads).create(); mOpenRetryBaseSleepMs = (int) Configuration.getMs(PropertyKey.UNDERFS_OBJECT_STORE_READ_RETRY_BASE_SLEEP_MS); mOpenRetryMaxSleepMs = (int) Configuration.getMs(PropertyKey.UNDERFS_OBJECT_STORE_READ_RETRY_MAX_SLEEP_MS); mOpenRetryMaxNum = Configuration.getInt(PropertyKey.UNDERFS_OBJECT_STORE_READ_RETRY_MAX_NUM); }

Target:
protected ObjectUnderFileSystem(AlluxioURI uri, UnderFileSystemConfiguration ufsConf) { super(uri, ufsConf); int numThreads = Configuration.getInt(PropertyKey.UNDERFS_OBJECT_STORE_SERVICE_THREADS); mExecutorService = ExecutorServiceFactories.fixedThreadPoolExecutorServiceFactory( "alluxio-underfs-object-service-worker", numThreads).create(); }
Source:
public long getPos() { try { return ((FSDataInputStream) in).getPos(); } catch (IOException e) { throw new RuntimeException("Failed to get position " + e); } }

Target:
public long getPos() throws IOException { return ((FSDataInputStream) in).getPos(); }
Source:
public static LocalAlluxioMaster create(final String workDirectory) throws IOException { if (!Files.isDirectory(Paths.get(workDirectory))) { Files.createDirectory(Paths.get(workDirectory)); } Configuration.set(PropertyKey.MASTER_SAFEMODE_WAIT, "0ms"); return new LocalAlluxioMaster(); }

Target:
public static LocalAlluxioMaster create(final String workDirectory) throws IOException { if (!Files.isDirectory(Paths.get(workDirectory))) { Files.createDirectory(Paths.get(workDirectory)); } return new LocalAlluxioMaster(); }