Examples of HbaseMapWritable


Examples of org.apache.hadoop.hbase.io.HbaseMapWritable

                    tableName, System.currentTimeMillis(), null);

              List<Text> emptyRows = new ArrayList<Text>();
              try {
                while (true) {
                  HbaseMapWritable values = server.next(scannerId);
                  if(values == null || values.size() == 0) {
                    break;
                  }
                  RowMap rm = toRowMap(values);
                  SortedMap<Text, byte[]> map = rm.getMap();
                  Text row = rm.getRow();
View Full Code Here

Examples of org.apache.hadoop.hbase.io.HbaseMapWritable

    // Do initial RPC setup.
    this.hbaseMaster = (HMasterRegionInterface)HbaseRPC.waitForProxy(
      HMasterRegionInterface.class, HMasterRegionInterface.versionID,
      new HServerAddress(conf.get(MASTER_ADDRESS)).getInetSocketAddress(),
      this.conf);
    HbaseMapWritable result = null;
    long lastMsg = 0;
    while(!stopRequested.get()) {
      try {
        this.requestCount.set(0);
        this.serverInfo.setLoad(new HServerLoad(0, onlineRegions.size()));
View Full Code Here

Examples of org.apache.hadoop.hbase.io.HbaseMapWritable

    checkOpen();
    requestCount.incrementAndGet();
    try {
      HRegion region = getRegion(regionName);
      HbaseMapWritable result = new HbaseMapWritable();
      Map<Text, byte[]> map = region.getFull(row, ts);
      for (Map.Entry<Text, byte []> es: map.entrySet()) {
        result.put(new HStoreKey(row, es.getKey()),
            new ImmutableBytesWritable(es.getValue()));
      }
      return result;
     
    } catch (IOException e) {
View Full Code Here

Examples of org.apache.hadoop.hbase.io.HbaseMapWritable

    checkOpen();
    requestCount.incrementAndGet();
    try {
      // locate the region we're operating on
      HRegion region = getRegion(regionName);
      HbaseMapWritable result = new HbaseMapWritable();
      // ask the region for all the data
      Map<Text, byte[]> map = region.getClosestRowBefore(row);
      // convert to a MapWritable
      if (map == null) {
        return null;
      }
      for (Map.Entry<Text, byte []> es: map.entrySet()) {
        result.put(new HStoreKey(row, es.getKey()),
            new ImmutableBytesWritable(es.getValue()));
      }
      return result;
     
    } catch (IOException e) {
View Full Code Here

Examples of org.apache.hadoop.hbase.io.HbaseMapWritable

        throw new UnknownScannerException("Name: " + scannerName);
      }
      this.leases.renewLease(scannerId, scannerId);

      // Collect values to be returned here
      HbaseMapWritable values = new HbaseMapWritable();
      HStoreKey key = new HStoreKey();
      TreeMap<Text, byte []> results = new TreeMap<Text, byte []>();
      while (s.next(key, results)) {
        for(Map.Entry<Text, byte []> e: results.entrySet()) {
          values.put(new HStoreKey(key.getRow(), e.getKey(), key.getTimestamp()),
            new ImmutableBytesWritable(e.getValue()));
        }

        if(values.size() > 0) {
          // Row has something in it. Return the value.
          break;
        }

        // No data for this row, go get another.
View Full Code Here

Examples of org.apache.hadoop.hbase.io.HbaseMapWritable

  /**
   * @return Subset of configuration to pass initializing regionservers: e.g.
   * the filesystem to use and root directory to use.
   */
  protected HbaseMapWritable createConfigurationSubset() {
    HbaseMapWritable mw = addConfig(new HbaseMapWritable(), HConstants.HBASE_DIR);
    return addConfig(mw, "fs.default.name");
  }
View Full Code Here

Examples of org.apache.hadoop.hbase.io.HbaseMapWritable

      Text metaRegionName = m.getRegionName();
      HRegionInterface server = connection.getHRegionConnection(m.getServer());
      long scannerid = server.openScanner(metaRegionName, COL_REGIONINFO_ARRAY,
          tableName, System.currentTimeMillis(), null);
      try {
        HbaseMapWritable data = server.next(scannerid);
           
        // Test data and that the row for the data is for our table. If table
        // does not exist, scanner will return row after where our table would
        // be inserted if it exists so look for exact match on table name.
           
        if (data != null && data.size() > 0) {
          for (Writable k: data.keySet()) {
            if (HRegionInfo.getTableNameFromRegionName(
                ((HStoreKey) k).getRow()).equals(tableName)) {
         
              // Then a region for this table already exists. Ergo table exists.
                 
View Full Code Here

Examples of org.apache.hadoop.hbase.io.HbaseMapWritable

          regionServer.openScanner(region.getRegionName(), COLUMN_FAMILY_ARRAY,
              EMPTY_START_ROW, System.currentTimeMillis(), null);

        int numberOfRegionsFound = 0;
        while (true) {
          HbaseMapWritable values = regionServer.next(scannerId);
          if (values == null || values.size() == 0) {
            break;
          }

          // TODO: Why does this have to be a sorted map?
          RowMap m = toRowMap(values);
View Full Code Here

Examples of org.apache.hadoop.hbase.io.HbaseMapWritable

      List<ToDoEntry> toDoList = new ArrayList<ToDoEntry>();
      Set<HRegionInfo> regions = new HashSet<HRegionInfo>();
      List<Text> emptyRows = new ArrayList<Text>();
      try {
        while (true) {
          HbaseMapWritable values = null;
          try {
            values = server.next(scannerId);
          } catch (IOException e) {
            LOG.error("Shutdown scanning of meta region",
              RemoteExceptionHandler.checkIOException(e));
            break;
          }
          if (values == null || values.size() == 0) {
            break;
          }
          // TODO: Why does this have to be a sorted map?
          RowMap rm = toRowMap(values);
          Text row = rm.getRow();
View Full Code Here

Examples of org.apache.hadoop.hbase.io.HbaseMapWritable

    // Do initial RPC setup.
    this.hbaseMaster = (HMasterRegionInterface)HbaseRPC.waitForProxy(
      HMasterRegionInterface.class, HMasterRegionInterface.versionID,
      new HServerAddress(conf.get(MASTER_ADDRESS)).getInetSocketAddress(),
      this.conf);
    HbaseMapWritable result = null;
    long lastMsg = 0;
    while(!stopRequested.get()) {
      try {
        this.requestCount.set(0);
        this.serverInfo.setLoad(new HServerLoad(0, onlineRegions.size()));
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.