Package org.apache.hadoop.hbase.client

Examples of org.apache.hadoop.hbase.client.Scan


    //Setting up region
    String method = this.getName();
    initHRegion(tableName, method, families);

    Scan scan = new Scan();
    scan.addFamily(fam2);
    boolean ok = false;
    try {
      region.getScanner(scan);
    } catch (Exception e) {
      ok = true;
View Full Code Here


    put.add(fam2, null, null);
    put.add(fam3, null, null);
    put.add(fam4, null, null);
    region.put(put);
   
    Scan scan = null;
    InternalScanner is = null;
   
    //Testing to see how many scanners that is produced by getScanner, starting
    //with known number, 2 - current = 1
    scan = new Scan();
    scan.addFamily(fam2);
    scan.addFamily(fam4);
    is = region.getScanner(scan);
    assertEquals(1, ((RegionScanner)is).getStoreHeap().getHeap().size());
   
    scan = new Scan();
    is = region.getScanner(scan);
    assertEquals(families.length -1,
        ((RegionScanner)is).getStoreHeap().getHeap().size());
  }
View Full Code Here

    put.add(fam2, null, ts, null);
    put.add(fam3, null, ts, null);
    put.add(fam4, null, ts, null);
    region.put(put);
   
    Scan scan = new Scan();
    scan.addFamily(fam2);
    scan.addFamily(fam4);
    InternalScanner is = region.getScanner(scan);
   
    List<KeyValue> res = null;
   
    //Result 1
View Full Code Here

    //Expected
    List<KeyValue> expected = new ArrayList<KeyValue>();
    expected.add(kv13);
    expected.add(kv12);
   
    Scan scan = new Scan(row1);
    scan.addColumn(fam1, qf1);
    scan.setMaxVersions(MAX_VERSIONS);
    List<KeyValue> actual = new ArrayList<KeyValue>();
    InternalScanner scanner = region.getScanner(scan);
   
    boolean hasNext = scanner.next(actual);
    assertEquals(false, hasNext);
View Full Code Here

    expected.add(kv13);
    expected.add(kv12);
    expected.add(kv23);
    expected.add(kv22);
   
    Scan scan = new Scan(row1);
    scan.addColumn(fam1, qf1);
    scan.addColumn(fam1, qf2);
    scan.setMaxVersions(MAX_VERSIONS);
    List<KeyValue> actual = new ArrayList<KeyValue>();
    InternalScanner scanner = region.getScanner(scan);
   
    boolean hasNext = scanner.next(actual);
    assertEquals(false, hasNext);
View Full Code Here

    expected.add(kv12);
    expected.add(kv24);
    expected.add(kv23);
    expected.add(kv22);
   
    Scan scan = new Scan(row1);
    scan.addColumn(fam1, qf1);
    scan.addColumn(fam1, qf2);
    int versions = 3;
    scan.setMaxVersions(versions);
    List<KeyValue> actual = new ArrayList<KeyValue>();
    InternalScanner scanner = region.getScanner(scan);
   
    boolean hasNext = scanner.next(actual);
    assertEquals(false, hasNext);
View Full Code Here

    HFile.Writer writer = null;
    try {
    if (majorCompaction) {
      InternalScanner scanner = null;
      try {
        Scan scan = new Scan();
        scan.setMaxVersions(family.getMaxVersions());
        scanner = new StoreScanner(this, scan, scanners);
        // since scanner.next() can return 'false' but still be delivering data,
        // we have to use a do/while loop.
        ArrayList<KeyValue> kvs = new ArrayList<KeyValue>();
        boolean more = true;
View Full Code Here

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

    Set<MetaRegion> regions = regionManager.getMetaRegionsForTable(tableName);
    byte [] firstRowInTable = Bytes.toBytes(Bytes.toString(tableName) + ",,");
    for (MetaRegion m: regions) {
      byte [] metaRegionName = m.getRegionName();
      HRegionInterface srvr = connection.getHRegionConnection(m.getServer());
      Scan scan = new Scan(firstRowInTable);
      scan.addColumn(CATALOG_FAMILY, REGIONINFO_QUALIFIER);
      scan.addColumn(CATALOG_FAMILY, SERVER_QUALIFIER);
      long scannerid = srvr.openScanner(metaRegionName, scan);
      try {
        while (true) {
          Result data = srvr.next(scannerid);
          if (data == null || data.size() <= 0)
View Full Code Here

    Set<MetaRegion> regions = regionManager.getMetaRegionsForTable(tableName);
    for (MetaRegion m: regions) {
      byte [] firstRowInTable = Bytes.toBytes(Bytes.toString(tableName) + ",,");
      byte [] metaRegionName = m.getRegionName();
      HRegionInterface srvr = connection.getHRegionConnection(m.getServer());
      Scan scan = new Scan(firstRowInTable);
      scan.addColumn(CATALOG_FAMILY, REGIONINFO_QUALIFIER);
      scan.addColumn(CATALOG_FAMILY, SERVER_QUALIFIER);
      long scannerid = srvr.openScanner(metaRegionName, scan);
      try {
        while (true) {
          Result data = srvr.next(scannerid);
          if (data == null || data.size() <= 0)
View Full Code Here

TOP

Related Classes of org.apache.hadoop.hbase.client.Scan

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.