Package org.apache.hadoop.hbase

Examples of org.apache.hadoop.hbase.HStoreKey$MetaStoreKeyComparator


        if (success) {
          long commitTime = (b.getTimestamp() == LATEST_TIMESTAMP)?
            System.currentTimeMillis(): b.getTimestamp();
          List<byte []> deletes = null;
          for (BatchOperation op: b) {
            HStoreKey key = new HStoreKey(row, op.getColumn(), commitTime,
                this.regionInfo);
            byte[] val = null;
            if (op.isPut()) {
              val = op.getValue();
              if (HLogEdit.isDeleted(val)) {
View Full Code Here


    Integer lid = getLock(lockid, row);
    long now = System.currentTimeMillis();
    try {
      for (HStore store : stores.values()) {
        List<HStoreKey> keys =
          store.getKeys(new HStoreKey(row, ts, this.regionInfo),
            ALL_VERSIONS, now, null);
        TreeMap<HStoreKey, byte []> edits = new TreeMap<HStoreKey, byte []>(
          new HStoreKey.HStoreKeyWritableComparator(regionInfo));
        for (HStoreKey key: keys) {
          edits.put(key, HLogEdit.deleteBytes.get());
View Full Code Here

    Integer lid = getLock(lockid, row);
    long now = System.currentTimeMillis();
    try {
      for (HStore store : stores.values()) {
        List<HStoreKey> keys =
          store.getKeys(new HStoreKey(row, timestamp, this.regionInfo),
            ALL_VERSIONS, now, columnPattern);
          TreeMap<HStoreKey, byte []> edits = new TreeMap<HStoreKey, byte []>(
            new HStoreKey.HStoreKeyWritableComparator(regionInfo));
          for (HStoreKey key: keys) {
            edits.put(key, HLogEdit.deleteBytes.get());
View Full Code Here

    long now = System.currentTimeMillis();
    try {
      // find the HStore for the column family
      HStore store = getStore(family);
      // find all the keys that match our criteria
      List<HStoreKey> keys = store.getKeys(new HStoreKey(row, timestamp,
        this.regionInfo), ALL_VERSIONS, now, null);
      // delete all the cells
      TreeMap<HStoreKey, byte []> edits = new TreeMap<HStoreKey, byte []>(
        new HStoreKey.HStoreKeyWritableComparator(regionInfo));
      for (HStoreKey key: keys) {
View Full Code Here

        String familyName = Bytes.toString(store.getFamily().getName());
        // check the family name match the family pattern.
        if(!(familyPattern.matcher(familyName).matches()))
          continue;
       
        List<HStoreKey> keys = store.getKeys(new HStoreKey(row, timestamp,
            this.regionInfo), ALL_VERSIONS, now, null);
        TreeMap<HStoreKey, byte []> edits = new TreeMap<HStoreKey, byte []>(
          new HStoreKey.HStoreKeyWritableComparator(regionInfo));
        for (HStoreKey key: keys) {
          edits.put(key, HLogEdit.deleteBytes.get());
View Full Code Here

  @SuppressWarnings("unchecked")
  private void deleteMultiple(final byte [] row, final byte [] column,
      final long ts, final int versions)
  throws IOException {
    checkReadOnly();
    HStoreKey origin = new HStoreKey(row, column, ts, this.regionInfo);
    Set<HStoreKey> keys = getKeys(origin, versions);
    if (keys.size() > 0) {
      TreeMap<HStoreKey, byte []> edits = new TreeMap<HStoreKey, byte []>(
        new HStoreKey.HStoreKeyWritableComparator(regionInfo));
      for (HStoreKey key: keys) {
View Full Code Here

    final long timestamp, final Integer lockid)
  throws IOException {
    checkRow(row);
    Integer lid = getLock(lockid, row);
    try {
      HStoreKey origin;
      if (column != null) {
        origin = new HStoreKey(row, column, timestamp);
      } else {
        origin = new HStoreKey(row, timestamp);
      }
      return !getKeys(origin, 1).isEmpty();
    } finally {
      if (lockid == null)
        releaseRowLock(lid);
View Full Code Here

          regionInfo.getTableDesc().getName(), updatesByColumn,
          (regionInfo.isMetaRegion() || regionInfo.isRootRegion()));
      }
      long size = 0;
      for (Map.Entry<HStoreKey, byte[]> e: updatesByColumn.entrySet()) {
        HStoreKey key = e.getKey();
        size = this.memcacheSize.addAndGet(
          getStore(key.getColumn()).add(key, e.getValue()));
      }
      flush = isFlushSize(size);
    } finally {
      this.updatesLock.readLock().unlock();
    }
View Full Code Here

    meta.checkResources();
    // The row key is the region name
    byte [] row = r.getRegionName();
    Integer lid = meta.obtainRowLock(row);
    try {
      HStoreKey key = new HStoreKey(row, COL_REGIONINFO,
        System.currentTimeMillis(), r.getRegionInfo());
      TreeMap<HStoreKey, byte[]> edits = new TreeMap<HStoreKey, byte[]>(
        new HStoreKey.HStoreKeyWritableComparator(meta.getRegionInfo()));
      edits.put(key, Writables.getBytes(r.getRegionInfo()));
      meta.update(edits);
View Full Code Here

    checkColumn(column);
   
    Integer lid = obtainRowLock(row);
    splitsAndClosesLock.readLock().lock();
    try {
      HStoreKey hsk = new HStoreKey(row, column);
      long ts = System.currentTimeMillis();
      byte [] value = null;

      HStore store = getStore(column);
View Full Code Here

TOP

Related Classes of org.apache.hadoop.hbase.HStoreKey$MetaStoreKeyComparator

Copyright © 2018 www.massapicom. 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.