Skip to content

Commit

Permalink
clean up added logs
Browse files Browse the repository at this point in the history
  • Loading branch information
bastrik committed Oct 13, 2020
1 parent 93aad59 commit 0e20842
Show file tree
Hide file tree
Showing 4 changed files with 0 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,6 @@ public int read(byte[] b, int off, int len) throws IOException {
}

private int readInternal(byte[] b, int off, int len) throws IOException {
// LOG.warn("BlockInStream::readInternal before readChunk()");
if (mPos >= mLength)
{
return -1;
Expand All @@ -285,7 +284,6 @@ private int readInternal(byte[] b, int off, int len) throws IOException {
}
int toRead = Math.min(len, mCurrentChunk.readableBytes());
mCurrentChunk.readBytes(b, off, toRead);
// LOG.warn("BlockInStream::readInternal read {} bytes from chunk", toRead);
mPos += toRead;
if (mPos >= mLength)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -186,10 +186,8 @@ public int read(byte[] b, int off, int len) throws IOException {
IOException lastException = null;
while (bytesLeft > 0 && mPosition != mLength && retry.attempt()) {
try {
// LOG.warn("FileInStream::read: before updateStream()");
updateStream();
int bytesRead = mBlockInStream.read(b, currentOffset, bytesLeft);
// LOG.warn("FileInStream::read {} bytes from block", bytesRead);
if (bytesRead > 0) {
bytesLeft -= bytesRead;
currentOffset += bytesRead;
Expand Down Expand Up @@ -378,7 +376,6 @@ private void updateStream() throws IOException {
}
// Set the stream to the correct position.
long offset = mPosition % mBlockSize;
// LOG.warn("FileInStream blockInStream={}", mBlockInStream);
mBlockInStream.seek(offset);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,6 @@ public void onNext(OpenLocalBlockRequest request) {
public OpenLocalBlockResponse call() throws Exception {
Preconditions.checkState(mRequest == null);
mRequest = request;
// LOG.warn("ShortCircuit Block onNext entry, blockId: {}", mRequest.getBlockId());
if (mLockId == BlockLockManager.INVALID_LOCK_ID) {
mSessionId = IdUtils.createSessionId();
// TODO(calvin): Update the locking logic so this can be done better
Expand All @@ -99,7 +98,6 @@ public OpenLocalBlockResponse call() throws Exception {
}
OpenLocalBlockResponse response = OpenLocalBlockResponse.newBuilder()
.setPath(mWorker.readBlock(mSessionId, mRequest.getBlockId(), mLockId)).build();
// LOG.warn("ShortCircuit Block onNext, response: {}", response);
mWorker.unlockBlock(mLockId);
mLockId = BlockLockManager.INVALID_LOCK_ID;
return response;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -301,7 +301,6 @@ public int open(String path, FuseFileInfo fi) {
}

private int openInternal(String path, FuseFileInfo fi) {
// LOG.warn("Enter openInternal, path={}", path);
final AlluxioURI uri = mPathResolverCache.getUnchecked(path);
try {
long fd = mNextOpenFileId.getAndIncrement();
Expand All @@ -311,7 +310,6 @@ private int openInternal(String path, FuseFileInfo fi) {
if (fd % 100 == 1) {
LOG.info("open(fd={},entries={})", fd, mOpenFileEntries.size());
}
// LOG.warn("Exit openInternal, path={}", path);
return 0;
} catch (Throwable e) {
LOG.error("Failed to open {}: ", path, e);
Expand All @@ -326,7 +324,6 @@ public int read(String path, ByteBuffer buf, long size, long offset, FuseFileInf
}

private int readInternal(String path, ByteBuffer buf, long size, long offset, FuseFileInfo fi) {
// LOG.warn("Enter ReadInternal, path={}", path);
if (mReadOps.incrementAndGet() % 10000 == 500) {
long cachedBytes =
MetricsSystem.meter(MetricKey.CLIENT_CACHE_BYTES_READ_CACHE.getName()).getCount();
Expand All @@ -341,7 +338,6 @@ private int readInternal(String path, ByteBuffer buf, long size, long offset, Fu
final int sz = (int) size;
long fd = fi.fh.get();
// FileInStream is not thread safe
// LOG.warn("ReadInternal acquiring lock lockId={} for fileID={}", Math.floorMod((int) fd, LOCK_SIZE), fd);
try (LockResource r1 = new LockResource(getFileLock(fd).writeLock())) {
// LOG.warn("ReadInternal acquired lock for fileID={}", fd);
FileInStream is = mOpenFileEntries.get(fd);
Expand All @@ -367,7 +363,6 @@ private int readInternal(String path, ByteBuffer buf, long size, long offset, Fu
LOG.error("Failed to read {},{},{}: ", path, size, offset, e);
return -ErrorCodes.EIO();
}
// LOG.warn("Exit ReadInternal, path={}", path);
return nread;
}

Expand Down Expand Up @@ -430,14 +425,11 @@ public int release(String path, FuseFileInfo fi) {
}

private int releaseInternal(String path, FuseFileInfo fi) {
// LOG.warn("Enter releaseInternal, path={}", path);
long fd = fi.fh.get();
if (mReleaseOps.incrementAndGet() % 100 == 1) {
LOG.info("release(fd={},entries={})", fd, mOpenFileEntries.size());
}
// LOG.warn("releaseInternal acquiring lock lockId={} for fileID={}", Math.floorMod((int) fd, LOCK_SIZE), fd);
try (LockResource r1 = new LockResource(getFileLock(fd).writeLock())) {
// LOG.warn("releaseInternal acquired lock for fileID={}", fd);
FileInStream is = mOpenFileEntries.remove(fd);
FileOutStream os = mCreateFileEntries.remove(fd);
if (is == null && os == null) {
Expand All @@ -454,7 +446,6 @@ private int releaseInternal(String path, FuseFileInfo fi) {
LOG.error("Failed closing {}", path, e);
return -ErrorCodes.EIO();
}
// LOG.warn("Exit releaseInternal, path={}", path);
return 0;
}

Expand Down

0 comments on commit 0e20842

Please sign in to comment.