Package com.alibaba.wasp

Examples of com.alibaba.wasp.EntityGroupLocation


      final Configuration conf, final ServerName sn, final EntityGroupInfo egi)
      throws IOException {
    FConnection c = TestFConnectionUtility.getMockedConnection(conf);
    Mockito.doNothing().when(c).close();
    // Make it so we return a particular location when asked.
    final EntityGroupLocation loc = new EntityGroupLocation(egi,
        sn.getHostname(), sn.getPort());
    Mockito.when(
        c.getEntityGroupLocation((byte[]) Mockito.any(),
            (byte[]) Mockito.any(), Mockito.anyBoolean())).thenReturn(loc);
    Mockito.when(
View Full Code Here


        assertEquals(sn.compareTo(egLocations[i]), 0);
      }

      // scanEntityGroupLocation
      byte[] row = Bytes.toBytes("20001");
      EntityGroupLocation egLocation = fMetaService.scanEntityGroupLocation(
          Bytes.toBytes(tableName), row);
      assertEquals(egLocation.getHostname(), egLocations[2].getHostname());
      assertEquals(egLocation.getPort(), egLocations[2].getPort());
      assertEquals(egLocation.getEntityGroupInfo().compareTo(egis.get(2)), 0);

      row = Bytes.toBytes(1);
      egLocation = fMetaService.scanEntityGroupLocation(
          Bytes.toBytes(tableName), row);
      assertEquals(egLocation.getHostname(), egLocations[0].getHostname());
      assertEquals(egLocation.getPort(), egLocations[0].getPort());
      assertEquals(egLocation.getEntityGroupInfo().compareTo(egis.get(0)), 0);

      List<EntityGroupLocation> egls = fMetaService
          .getEntityGroupLocations(Bytes.toBytes(tableName));
      assertEquals(egis.size(), egls.size());
View Full Code Here

TOP

Related Classes of com.alibaba.wasp.EntityGroupLocation

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.