Browse Source

enable read cache

pull/1507/head
Chris Lu 4 years ago
parent
commit
735912e0f5
  1. 2
      other/java/client/src/main/java/seaweedfs/client/SeaweedRead.java
  2. 3
      other/java/client/src/main/java/seaweedfs/client/SeaweedWrite.java

2
other/java/client/src/main/java/seaweedfs/client/SeaweedRead.java

@ -15,7 +15,7 @@ public class SeaweedRead {
private static final Logger LOG = LoggerFactory.getLogger(SeaweedRead.class); private static final Logger LOG = LoggerFactory.getLogger(SeaweedRead.class);
static ChunkCache chunkCache = new ChunkCache(0);
static ChunkCache chunkCache = new ChunkCache(4);
// returns bytesRead // returns bytesRead
public static long read(FilerGrpcClient filerGrpcClient, List<VisibleInterval> visibleIntervals, public static long read(FilerGrpcClient filerGrpcClient, List<VisibleInterval> visibleIntervals,

3
other/java/client/src/main/java/seaweedfs/client/SeaweedWrite.java

@ -61,9 +61,6 @@ public class SeaweedWrite {
String etag = multipartUpload(targetUrl, auth, bytes, bytesOffset, bytesLength, cipherKey); String etag = multipartUpload(targetUrl, auth, bytes, bytesOffset, bytesLength, cipherKey);
// cache fileId ~ bytes
SeaweedRead.chunkCache.setChunk(fileId, bytes);
LOG.debug("write file chunk {} size {}", targetUrl, bytesLength); LOG.debug("write file chunk {} size {}", targetUrl, bytesLength);
return FilerProto.FileChunk.newBuilder() return FilerProto.FileChunk.newBuilder()

Loading…
Cancel
Save