Ejemplo n.º 1
0
 @Override
 public void store(Value v) {
   // Should be used only if ice goes to HDFS
   assert this == getIce();
   assert !v.isPersisted();
   byte[] m = v.memOrLoad();
   assert (m == null || m.length == v._max); // Assert not saving partial files
   store(new Path(_iceRoot, getIceName(v)), m);
   v.setdsk(); // Set as write-complete to disk
 }
Ejemplo n.º 2
0
 @Override
 public void delete(final Value v) {
   assert this == getIce();
   assert !v.isPersisted(); // Upper layers already cleared out
   run(
       new Callable() {
         @Override
         public Object call() throws Exception {
           Path p = new Path(_iceRoot, getIceName(v));
           FileSystem fs = FileSystem.get(p.toUri(), CONF);
           fs.delete(p, true);
           if (v.isArray()) { // Also nuke directory if the top-level ValueArray dies
             p = new Path(_iceRoot, getIceDirectory(v._key));
             fs = FileSystem.get(p.toUri(), CONF);
             fs.delete(p, true);
           }
           return null;
         }
       },
       false,
       0);
 }