Java 类org.apache.hadoop.hbase.regionserver.MultiVersionConsistencyControl.WriteEntry 实例源码

项目:HIndex    文件:HRegion.java   
/**
 * Atomically apply the given map of family->edits to the memstore.
 * This handles the consistency control on its own, but the caller
 * should already have locked updatesLock.readLock(). This also does
 * <b>not</b> check the families for validity.
 *
 * @param familyMap Map of kvs per family
 * @param localizedWriteEntry The WriteEntry of the MVCC for this transaction.
 *        If null, then this method internally creates a mvcc transaction.
 * @return the additional memory usage of the memstore caused by the
 * new entries.
 */
private long applyFamilyMapToMemstore(Map<byte[], List<Cell>> familyMap,
  MultiVersionConsistencyControl.WriteEntry localizedWriteEntry) {
  long size = 0;
  boolean freemvcc = false;

  try {
    if (localizedWriteEntry == null) {
      localizedWriteEntry = mvcc.beginMemstoreInsert();
      freemvcc = true;
    }

    for (Map.Entry<byte[], List<Cell>> e : familyMap.entrySet()) {
      byte[] family = e.getKey();
      List<Cell> cells = e.getValue();

      Store store = getStore(family);
      for (Cell cell: cells) {
        KeyValue kv = KeyValueUtil.ensureKeyValue(cell);
        kv.setMvccVersion(localizedWriteEntry.getWriteNumber());
        size += store.add(kv);
      }
    }
  } finally {
    if (freemvcc) {
      mvcc.completeMemstoreInsert(localizedWriteEntry);
    }
  }

   return size;
 }
项目:PyroDB    文件:HRegion.java   
/**
 * Atomically apply the given map of family->edits to the memstore.
 * This handles the consistency control on its own, but the caller
 * should already have locked updatesLock.readLock(). This also does
 * <b>not</b> check the families for validity.
 *
 * @param familyMap Map of kvs per family
 * @param localizedWriteEntry The WriteEntry of the MVCC for this transaction.
 *        If null, then this method internally creates a mvcc transaction.
 * @return the additional memory usage of the memstore caused by the
 * new entries.
 */
private long applyFamilyMapToMemstore(Map<byte[], List<Cell>> familyMap,
  MultiVersionConsistencyControl.WriteEntry localizedWriteEntry) {
  long size = 0;
  boolean freemvcc = false;

  try {
    if (localizedWriteEntry == null) {
      localizedWriteEntry = mvcc.beginMemstoreInsert();
      freemvcc = true;
    }

    for (Map.Entry<byte[], List<Cell>> e : familyMap.entrySet()) {
      byte[] family = e.getKey();
      List<Cell> cells = e.getValue();

      Store store = getStore(family);
      for (Cell cell: cells) {
        KeyValue kv = KeyValueUtil.ensureKeyValue(cell);
        kv.setMvccVersion(localizedWriteEntry.getWriteNumber());
        size += store.add(kv);
      }
    }
  } finally {
    if (freemvcc) {
      mvcc.completeMemstoreInsert(localizedWriteEntry);
    }
  }

   return size;
 }
项目:c5    文件:HRegion.java   
/**
 * Atomically apply the given map of family->edits to the memstore.
 * This handles the consistency control on its own, but the caller
 * should already have locked updatesLock.readLock(). This also does
 * <b>not</b> check the families for validity.
 *
 * @param familyMap Map of kvs per family
 * @param localizedWriteEntry The WriteEntry of the MVCC for this transaction.
 *        If null, then this method internally creates a mvcc transaction.
 * @return the additional memory usage of the memstore caused by the
 * new entries.
 */
private long applyFamilyMapToMemstore(Map<byte[], List<Cell>> familyMap,
  MultiVersionConsistencyControl.WriteEntry localizedWriteEntry) {
  long size = 0;
  boolean freemvcc = false;

  try {
    if (localizedWriteEntry == null) {
      localizedWriteEntry = mvcc.beginMemstoreInsert();
      freemvcc = true;
    }

    for (Map.Entry<byte[], List<Cell>> e : familyMap.entrySet()) {
      byte[] family = e.getKey();
      List<Cell> cells = e.getValue();

      Store store = getStore(family);
      for (Cell cell: cells) {
        KeyValue kv = KeyValueUtil.ensureKeyValue(cell);
        kv.setMvccVersion(localizedWriteEntry.getWriteNumber());
        size += store.add(kv);
      }
    }
  } finally {
    if (freemvcc) {
      mvcc.completeMemstoreInsert(localizedWriteEntry);
    }
  }

   return size;
 }
项目:DominoHBase    文件:HRegion.java   
/**
 * Atomically apply the given map of family->edits to the memstore.
 * This handles the consistency control on its own, but the caller
 * should already have locked updatesLock.readLock(). This also does
 * <b>not</b> check the families for validity.
 *
 * @param familyMap Map of kvs per family
 * @param localizedWriteEntry The WriteEntry of the MVCC for this transaction.
 *        If null, then this method internally creates a mvcc transaction.
 * @return the additional memory usage of the memstore caused by the
 * new entries.
 */
private long applyFamilyMapToMemstore(Map<byte[], List<KeyValue>> familyMap,
  MultiVersionConsistencyControl.WriteEntry localizedWriteEntry) {
  long size = 0;
  boolean freemvcc = false;

  try {
    if (localizedWriteEntry == null) {
      localizedWriteEntry = mvcc.beginMemstoreInsert();
      freemvcc = true;
    }

    for (Map.Entry<byte[], List<KeyValue>> e : familyMap.entrySet()) {
      byte[] family = e.getKey();
      List<KeyValue> edits = e.getValue();

      Store store = getStore(family);
      for (KeyValue kv: edits) {
        kv.setMemstoreTS(localizedWriteEntry.getWriteNumber());
        size += store.add(kv);
      }
    }
  } finally {
    if (freemvcc) {
      mvcc.completeMemstoreInsert(localizedWriteEntry);
    }
  }

   return size;
 }