private boolean exists(String key) { return cache.get(key) != null; }
public long length() { Metadata metadata=cache.get(getPath()); if(metadata != null) return metadata.length; return 0; }
public boolean exists() { return cache.get(getPath()) != null; }
private boolean isFile(String key) { Metadata val=cache.get(key); return val.isFile(); }
protected void initMetadata() { Metadata metadata=cache.get(getPath()); if(metadata != null) this.chunk_size=metadata.getChunkSize(); }
public boolean isDirectory() { Metadata val=cache.get(getPath()); return val.isDirectory(); }
public boolean isFile() { Metadata val=cache.get(getPath()); return val.isFile(); }
private byte[] fetchNextChunk() { int chunk_number=getChunkNumber(); String key=name + ".#" + chunk_number; byte[] val= cache.get(key); if(log.isTraceEnabled()) log.trace("fetching index=" + index + ", key=" + key +": " + (val != null? val.length + " bytes" : "null")); return val; }
void setLength(int new_length) { Metadata metadata=cache.get(getPath()); if(metadata != null) { metadata.length=new_length; metadata.setModificationTime(System.currentTimeMillis()); cache.put(getPath(), metadata, (short)-1, 0, false); } else System.err.println("metadata for " + getPath() + " not found !"); }
public void remove(String path, boolean synchronous) { if(path == null) return; GridFile.Metadata md=metadata.get(path); if(md == null) return; int num_chunks=md.getLength() / md.getChunkSize() + 1; for(int i=0; i < num_chunks; i++) data.remove(path + ".#" + i, synchronous); } }
private boolean exists(String key) { return cache.get(key) != null; }
public long length() { Metadata metadata=cache.get(getPath()); if(metadata != null) return metadata.length; return 0; }
private boolean isFile(String key) { Metadata val=cache.get(key); return val.isFile(); }
public boolean exists() { return cache.get(getPath()) != null; }
protected void initMetadata() { Metadata metadata=cache.get(getPath()); if(metadata != null) this.chunk_size=metadata.getChunkSize(); }
public boolean isDirectory() { Metadata val=cache.get(getPath()); return val.isDirectory(); }
public boolean isFile() { Metadata val=cache.get(getPath()); return val.isFile(); }
public void remove(String path, boolean synchronous) { if(path == null) return; GridFile.Metadata md=metadata.get(path); if(md == null) return; int num_chunks=md.getLength() / md.getChunkSize() + 1; for(int i=0; i < num_chunks; i++) data.remove(path + ".#" + i, synchronous); } }
private byte[] fetchNextChunk() { int chunk_number=getChunkNumber(); String key=name + ".#" + chunk_number; byte[] val= cache.get(key); if(log.isTraceEnabled()) log.trace("fetching index=" + index + ", key=" + key +": " + (val != null? val.length + " bytes" : "null")); return val; }
void setLength(int new_length) { Metadata metadata=cache.get(getPath()); if(metadata != null) { metadata.length=new_length; metadata.setModificationTime(System.currentTimeMillis()); cache.put(getPath(), metadata, (short)-1, 0, false); } else System.err.println("metadata for " + getPath() + " not found !"); }