Examples of RowResult


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

      callable = new ScannerCallable(connection, META_TABLE_NAME,
        COLUMN_FAMILY_ARRAY, startRow, LATEST_TIMESTAMP, null);
      // Open scanner
      connection.getRegionServerWithRetries(callable);
      try {
        RowResult r = null;
        do {
          r = connection.getRegionServerWithRetries(callable);
          if (r == null || r.size() == 0) {
            break;
          }
        } while(visitor.processRow(r));
        // Advance the startRow to the end key of the current region
        startRow = callable.getHRegionInfo().getEndKey();
View Full Code Here

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

          COLUMN_FAMILY_ARRAY, tableName, HConstants.LATEST_TIMESTAMP, null);

      List<byte []> emptyRows = new ArrayList<byte []>();
      try {
        while (true) {
          RowResult values = server.next(scannerId);
          if(values == null || values.size() == 0) {
            break;
          }
          HRegionInfo info = this.master.getHRegionInfo(values.getRow(), values);
          if (info == null) {
            emptyRows.add(values.getRow());
            LOG.error(COL_REGIONINFO + " not found on " + values.getRow());
            continue;
          }
          String serverName = Writables.cellToString(values.get(COL_SERVER));
          long startCode = Writables.cellToLong(values.get(COL_STARTCODE));
          if (Bytes.compareTo(info.getTableDesc().getName(), tableName) > 0) {
            break; // Beyond any more entries for this table
          }

          tableExists = true;
View Full Code Here

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

      HbaseMapWritable<byte [], Cell> cells =
        new HbaseMapWritable<byte [], Cell>();
      for (HStore s: stores.values()) {
        s.getFull(key, null, cells);
      }
      return new RowResult(key.getRow(), cells);
    } finally {
      splitsAndClosesLock.readLock().unlock();
    }
  }
View Full Code Here

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

      try {
        scannerId =
          server.openScanner(firstMetaServer.getRegionInfo().getRegionName(),
            HConstants.COL_REGIONINFO_ARRAY, tableName,
            HConstants.LATEST_TIMESTAMP, null);
        RowResult values = server.next(scannerId);
        if (values == null || values.size() == 0) {
          break;
        }
        boolean found = false;
        for (Map.Entry<byte [], Cell> e: values.entrySet()) {
          if (Bytes.equals(e.getKey(), HConstants.COL_REGIONINFO)) {
            info = (HRegionInfo) Writables.getWritable(
              e.getValue().getValue(), info);
           
            if (Bytes.equals(info.getTableDesc().getName(), tableName)) {
View Full Code Here

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

    List<ToDoEntry> toDoList = new ArrayList<ToDoEntry>();
    Set<HRegionInfo> regions = new HashSet<HRegionInfo>();
    List<byte []> emptyRows = new ArrayList<byte []>();
    try {
      while (true) {
        RowResult 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;
        }
       
        byte [] row = values.getRow();
       
        if (LOG.isDebugEnabled() && row != null) {
          LOG.debug("shutdown scanner looking at " + row.toString());
        }

        // Check server name.  If null, be conservative and treat as though
        // region had been on shutdown server (could be null because we
        // missed edits in hlog because hdfs does not do write-append).
        String serverName = Writables.cellToString(values.get(COL_SERVER));
        if (serverName.length() > 0 &&
            deadServerName.compareTo(serverName) != 0) {
          // This isn't the server you're looking for - move along
          continue;
        }
View Full Code Here

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

    byte [] metaRegionName = m.getRegionName();
    HRegionInterface srvr = connection.getHRegionConnection(m.getServer());
    long scannerid = srvr.openScanner(metaRegionName, COL_REGIONINFO_ARRAY,
      tableName, LATEST_TIMESTAMP, null);
    try {
      RowResult data = srvr.next(scannerid);
      if (data != null && data.size() > 0) {
        HRegionInfo info = Writables.getHRegionInfo(data.get(COL_REGIONINFO));
        if (Bytes.equals(info.getTableDesc().getName(), tableName)) {
          // A region for this table already exists. Ergo table exists.
          throw new TableExistsException(Bytes.toString(tableName));
        }
      }
View Full Code Here

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

     * @return RowResult
     *
     * @see org.apache.hadoop.mapred.RecordReader#createValue()
     */
    public RowResult createValue() {
      return new RowResult();
    }
View Full Code Here

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

     * @throws IOException
     */
    @SuppressWarnings("unchecked")
    public boolean next(ImmutableBytesWritable key, RowResult value)
    throws IOException {
      RowResult result;
      try {
        result = this.scanner.next();
      } catch (UnknownScannerException e) {
        LOG.debug("recovered from " + StringUtils.stringifyException(e))
        restart(lastRow);
        this.scanner.next();    // skip presumed already mapped row
        result = this.scanner.next();
      }
      boolean hasMore = result != null && result.size() > 0;
      if (hasMore) {
        key.set(result.getRow());
        lastRow = key.get();
        Writables.copyWritable(result, value);
      }
      return hasMore;
    }
View Full Code Here

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

      Field.Store.YES, Field.Index.UN_TOKENIZED);
    keyField.setOmitNorms(true);
    doc.add(keyField);

    while (values.hasNext()) {
      RowResult value = values.next();

      // each column (name-value pair) is a field (name-value pair)
      for (Map.Entry<byte [], Cell> entry : value.entrySet()) {
        // name is already UTF-8 encoded
        String column = Bytes.toString(entry.getKey());
        byte[] columnValue = entry.getValue().getValue();
        Field.Store store = indexConf.isStore(column)?
          Field.Store.YES: Field.Store.NO;
View Full Code Here

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

      this.latestRegion = null;
    }
   
    private HRegionInfo nextRegion() throws IOException {
      try {
        RowResult results = getMetaRow();
        if (results == null) {
          return null;
        }
        Cell regionInfo = results.get(COL_REGIONINFO);
        if (regionInfo == null || regionInfo.getValue().length == 0) {
          throw new NoSuchElementException("meta region entry missing " +
            COL_REGIONINFO);
        }
        HRegionInfo region = Writables.getHRegionInfo(regionInfo.getValue());
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.