Package org.apache.hadoop.hbase.ipc

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


    // rebuild its list of user regions and it will also get the HRI that goes
    // with an encoded name by doing a Get on .META.
    HRegionInterface ri = Mockito.mock(HRegionInterface.class);
    // Get a meta row result that has region up on SERVERNAME_A for REGIONINFO
    Result r = getMetaTableRowResult(REGIONINFO, SERVERNAME_A);
    Mockito.when(ri .openScanner((byte[]) Mockito.any(), (Scan) Mockito.any())).
      thenReturn(System.currentTimeMillis());
    // Return good result 'r' first and then return null to indicate end of scan
    Mockito.when(ri.next(Mockito.anyLong(), Mockito.anyInt())).thenReturn(new Result[] { r });
    // If a get, return the above result too for REGIONINFO
    Mockito.when(ri.get((byte[]) Mockito.any(), (Get) Mockito.any())).
View Full Code Here

      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

    // 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

    Set<MetaRegion> regions = regionManager.getMetaRegionsForTable(tableName);
    for (MetaRegion m: regions) {
      byte [] metaRegionName = m.getRegionName();
      HRegionInterface srvr = connection.getHRegionConnection(m.getServer());
      long scannerid =
        srvr.openScanner(metaRegionName,
          new byte[][] {COL_REGIONINFO, COL_SERVER},
          tableName,
          LATEST_TIMESTAMP,
          null);
      try {
View Full Code Here

    Set<MetaRegion> regions = regionManager.getMetaRegionsForTable(tableName);
    for (MetaRegion m: regions) {
      byte [] metaRegionName = m.getRegionName();
      HRegionInterface srvr = connection.getHRegionConnection(m.getServer());
      long scannerid =
          srvr.openScanner(metaRegionName,
            new byte[][] {COL_REGIONINFO, COL_SERVER},
            tableName,
            LATEST_TIMESTAMP,
            null);
      try {
View Full Code Here

    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

    for (int tries = 0; tries < (this.numRetries * this.retryLongerMultiplier); tries++) {
      long scannerId = -1L;
      try {
        Scan scan = new 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, batchCount);
        if (values == null || values.length == 0) {
          break;
View Full Code Here

      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

    HRegionInterface ri = Mockito.mock(HRegionInterface.class);
    // Get a meta row result that has region up on SERVERNAME_A for REGIONINFO
    Result r = getMetaTableRowResult(REGIONINFO, SERVERNAME_A);

    final long scannerid = 123L;
    Mockito.when(ri.openScanner((byte[]) Mockito.any(), (Scan) Mockito.any()))
        .thenReturn(scannerid);
    // Make it so a verifiable answer comes back when next is called. Return
    // the verifiable answer and then a null so we stop scanning. Our
    // verifiable answer is something that looks like a row in META with
    // a server and startcode that is that of the above defined servername.
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.