Package fr.dyade.aaa.util

Examples of fr.dyade.aaa.util.Operation.free()


        // alloc a new one
        op.value = new byte[buf.length];
      }
      System.arraycopy(buf, 0, op.value, 0, buf.length);
    }
    if (old != null) old.free();

  }

  private final byte[] getFromLog(Hashtable log, Object key) throws IOException {
    // Searches in the log a new value for the object.
View Full Code Here


    Hashtable log = ((Context) perThreadContext.get()).getLog();
    Operation op = Operation.alloc(Operation.DELETE, dirName, name);
    Operation old = (Operation) log.put(key, op);
    if (old != null) {
      if (old.type == Operation.CREATE) op.type = Operation.NOOP;
      old.free();
    }
  }

  public final synchronized void commit(boolean release) throws IOException {
    if (phase != RUN)
View Full Code Here

                      if (old.type == Operation.CREATE) {
                        // There is no need to memorize the deletion, the object will be never
                        // created on disk.
                        old.type = Operation.NOOP;
                        log.remove(key);
                        old.free();
                        logFile[logidx%nbLogFile].logCounter -= 1;
                      } else {
                        // The operation is a save, overload it.
                        old.type = Operation.DELETE;
                        old.logidx = logidx;
View Full Code Here

                log.remove(key);
                op.free();
                logFile[logidx%nbLogFile].logCounter -= 1;
              }
            }
            old.free();
          }
        }
      } catch (NoSuchElementException exc) {}
      write(Operation.END);
View Full Code Here

              repository.delete(op.dirName, op.name);
            }

            iterator.remove();
            op.free();
          }
        } catch (NoSuchElementException exc) {}

        repository.commit();
      }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.