Examples of openScanner()


Examples of org.apache.hadoop.hbase.ipc.HRegionInterface.openScanner()

    // created. Throw already-exists exception.
    MetaRegion m = regionManager.getFirstMetaRegionForRegion(newRegion);
       
    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));
View Full Code Here

Examples of org.apache.hadoop.hbase.ipc.HRegionInterface.openScanner()

    Map<HRegionInfo, RowResult> splitParents =
      new HashMap<HRegionInfo, RowResult>();
    List<byte []> emptyRows = new ArrayList<byte []>();
    try {
      regionServer = master.connection.getHRegionConnection(region.getServer());
      scannerId = regionServer.openScanner(region.getRegionName(),
        COLUMN_FAMILY_ARRAY, EMPTY_START_ROW, HConstants.LATEST_TIMESTAMP, null);
      int numberOfRegionsFound = 0;
      while (true) {
        RowResult values = regionServer.next(scannerId);
        if (values == null || values.size() == 0) {
View Full Code Here

Examples of org.apache.hadoop.hbase.ipc.HRegionInterface.openScanner()

      try {

        Scan scan = MetaReader.getScanForTableName(tableName);
        scan.addColumn(HConstants.CATALOG_FAMILY,
            HConstants.REGIONINFO_QUALIFIER);
        scannerId = server.openScanner(
          firstMetaServer.getRegionInfo().getRegionName(), scan);
        // Get a batch at a time.
        Result values = server.next(scannerId);

        // let us wait until .META. table is updated and
View Full Code Here

Examples of org.apache.hadoop.hbase.ipc.HRegionInterface.openScanner()

      try {

        Scan scan = MetaReader.getScanForTableName(tableName);
        scan.addColumn(HConstants.CATALOG_FAMILY,
            HConstants.REGIONINFO_QUALIFIER);
        scannerId = server.openScanner(
          firstMetaServer.getRegionInfo().getRegionName(), scan);
        // Get a batch at a time.
        Result values = server.next(scannerId);

        // let us wait until .META. table is updated and
View Full Code Here

Examples of org.apache.hadoop.hbase.ipc.HRegionInterface.openScanner()

    if (splitRegion) {
      r = getMetaTableRowResultAsSplitRegion(REGIONINFO, SERVERNAME_A);
    } else {
      r = getMetaTableRowResult(REGIONINFO, SERVERNAME_A);
    }
    Mockito.when(implementation.openScanner((byte [])Mockito.any(), (Scan)Mockito.any())).
      thenReturn(System.currentTimeMillis());
    // Return a good result first and then return null to indicate end of scan
    Mockito.when(implementation.next(Mockito.anyLong(), Mockito.anyInt())).
      thenReturn(new Result [] {r}, (Result [])null);
View Full Code Here

Examples of org.apache.hadoop.hbase.ipc.HRegionInterface.openScanner()

      result = new Result[2];
      result[0] = getMetaTableRowResult(REGIONINFO, SERVERNAME_A);
      result[1] = getMetaTableRowResult(REGIONINFO_2, SERVERNAME_A);
    }
    Result r = getMetaTableRowResult(REGIONINFO, SERVERNAME_A);
    Mockito.when(ri .openScanner((byte[]) Mockito.any(), (Scan) Mockito.any())).
      thenReturn(System.currentTimeMillis());
   if (enabling) {
      Mockito.when(ri.next(Mockito.anyLong(), Mockito.anyInt())).thenReturn(result, result, result,
          (Result[]) null);
      // If a get, return the above result too for REGIONINFO_2
View Full Code Here

Examples of org.apache.hadoop.hbase.ipc.HRegionInterface.openScanner()

      // printed if we FAIL.  We eventually succeed after retry so these don't
      // show.  We will know if they happened or not because we will ask
      // mockito at the end of this test to verify that openscanner was indeed
      // called the wanted number of times.
      final long scannerid = 123L;
      Mockito.when(implementation.openScanner((byte [])Mockito.any(),
          (Scan)Mockito.any())).
        thenThrow(new IOException("Server not running (1 of 3)")).
        thenThrow(new IOException("Server not running (2 of 3)")).
        thenThrow(new IOException("Server not running (3 of 3)")).
        thenReturn(scannerid);
View Full Code Here

Examples of org.apache.hadoop.hbase.ipc.HRegionInterface.openScanner()

    HRegionInfo info = new HRegionInfo();
    for (int tries = 0; tries < numRetries; tries++) {
      long scannerId = -1L;
      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;
View Full Code Here

Examples of org.apache.hadoop.hbase.ipc.HRegionInterface.openScanner()

    byte [] metaRegionName = m.getRegionName();
    HRegionInterface srvr = this.connection.getHRegionConnection(m.getServer());
    byte[] firstRowInTable = Bytes.toBytes(tableName + ",,");
    Scan scan = new Scan(firstRowInTable);
    scan.addColumn(HConstants.CATALOG_FAMILY, HConstants.REGIONINFO_QUALIFIER);
    long scannerid = srvr.openScanner(metaRegionName, scan);
    try {
      Result data = srvr.next(scannerid);
      if (data != null && data.size() > 0) {
        HRegionInfo info = Writables.getHRegionInfo(
          data.getValue(HConstants.CATALOG_FAMILY,
View Full Code Here

Examples of org.apache.hadoop.hbase.ipc.HRegionInterface.openScanner()

      regionServer =
        this.master.getServerConnection().getHRegionConnection(region.getServer());
      Scan s = new Scan().addFamily(HConstants.CATALOG_FAMILY);
      // Make this scan do a row at a time otherwise, data can be stale.
      s.setCaching(1);
      scannerId = regionServer.openScanner(region.getRegionName(), s);
      while (true) {
        Result values = regionServer.next(scannerId);
        if (values == null || values.size() == 0) {
          break;
        }
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.