Package org.apache.hadoop.hbase.filter

Examples of org.apache.hadoop.hbase.filter.FilterList


            }

            if (maxMessagesPerPoll > 0) {
                filters.add(new PageFilter(maxMessagesPerPoll));
            }
            Filter compoundFilter = new FilterList(filters);
            scan.setFilter(compoundFilter);

            if (rowModel != null && rowModel.getCells() != null) {
                Set<HBaseCell> cellModels = rowModel.getCells();
                for (HBaseCell cellModel : cellModels) {
View Full Code Here


            query.getACLStrategy() ? AccessControlFilter.Strategy.CHECK_CELL_FIRST :
              AccessControlFilter.Strategy.CHECK_TABLE_AND_CF_ONLY,
            cfVsMaxVersions);
          // wrap any existing filter
          if (filter != null) {
            ourFilter = new FilterList(FilterList.Operator.MUST_PASS_ALL,
              Lists.newArrayList(ourFilter, filter));
          }
          authResult.setAllowed(true);;
          authResult.setReason("Access allowed with filter");
          switch (opType) {
          case GET:
          case EXISTS:
            ((Get)query).setFilter(ourFilter);
            break;
          case SCAN:
            ((Scan)query).setFilter(ourFilter);
            break;
          default:
            throw new RuntimeException("Unhandled operation " + opType);
          }
        }
      } else {
        // New behavior: Any access we might be granted is more fine-grained
        // than whole table or CF. Simply inject a filter and return what is
        // allowed. We will not throw an AccessDeniedException. This is a
        // behavioral change since 0.96.
        Filter ourFilter = new AccessControlFilter(authManager, user, table,
          query.getACLStrategy() ? AccessControlFilter.Strategy.CHECK_CELL_FIRST :
            AccessControlFilter.Strategy.CHECK_CELL_DEFAULT,
          cfVsMaxVersions);
        // wrap any existing filter
        if (filter != null) {
          ourFilter = new FilterList(FilterList.Operator.MUST_PASS_ALL,
            Lists.newArrayList(ourFilter, filter));
        }
        authResult.setAllowed(true);;
        authResult.setReason("Access allowed with filter");
        switch (opType) {
View Full Code Here

    }

    @Override
    void testRow(final int i) throws IOException {
      Scan scan = new Scan(getRandomRow(this.rand, opts.totalRows));
      FilterList list = new FilterList();
      scan.addColumn(FAMILY_NAME, QUALIFIER_NAME);
      if (opts.filterAll) {
        list.addFilter(new FilterAllFilter());
      }
      list.addFilter(new WhileMatchFilter(new PageFilter(120)));
      scan.setFilter(list);
      ResultScanner s = this.table.getScanner(scan);
      for (Result rr; (rr = s.next()) != null;) ;
      s.close();
    }
View Full Code Here

        if (scanner != null) scanner.close();
      }
    }

    protected Scan constructScan(byte[] valuePrefix) throws IOException {
      FilterList list = new FilterList();
      Filter filter = new SingleColumnValueFilter(
          FAMILY_NAME, QUALIFIER_NAME, CompareFilter.CompareOp.EQUAL,
          new BinaryComparator(valuePrefix)
      );
      list.addFilter(filter);
      if(opts.filterAll) {
        list.addFilter(new FilterAllFilter());
      }
      Scan scan = new Scan();
      scan.addColumn(FAMILY_NAME, QUALIFIER_NAME);
      scan.setFilter(list);
      return scan;
View Full Code Here

          + " rows ");
    }
    scan.addFamily(FConstants.CATALOG_FAMILY);
    scan.setCaching(rows);
    if (tableName == null || tableName.length == 0) {
      FilterList allFilters = new FilterList();
      allFilters.addFilter(new PrefixFilter(tableName));
      scan.setFilter(allFilters);
    }
    int processedRows = 0;
    try {
      ResultScanner scanner = fmetaTable.getScanner(scan);
View Full Code Here

    Scan scan = new Scan(FConstants.TABLEROW_PREFIX);
    scan.addFamily(FConstants.CATALOG_FAMILY);
    int rows = getConf().getInt(HConstants.HBASE_META_SCANNER_CACHING,
        HConstants.DEFAULT_HBASE_META_SCANNER_CACHING);
    scan.setCaching(rows);
    FilterList allFilters = new FilterList();
    allFilters.addFilter(new PrefixFilter(FConstants.TABLEROW_PREFIX));
    scan.setFilter(allFilters);
    HTableInterface htable = null;
    try {
      htable = getHTable();
      ResultScanner scanner = htable.getScanner(scan);
View Full Code Here

  @Override
  public List<EntityGroupInfo> getTableEntityGroups(final byte[] tableByte)
      throws MetaException {
    final List<EntityGroupInfo> entityGroupInfos = new LinkedList<EntityGroupInfo>();
    final byte[] startKey = tableByte;
    FilterList allFilters = new FilterList();
    allFilters.addFilter(new PrefixFilter(tableByte));

    FMetaVisitor visitor = new FMetaVisitor() {
      @Override
      public boolean visit(Result r) throws IOException {
        if (r == null || r.isEmpty()) {
View Full Code Here

  @Override
  public List<EntityGroupLocation> getEntityGroupLocations(
      final byte[] tableName) throws MetaException {
    final List<EntityGroupLocation> egLocations = new LinkedList<EntityGroupLocation>();
    final byte[] startKey = tableName;
    FilterList allFilters = new FilterList();
    allFilters.addFilter(new PrefixFilter(tableName));

    FMetaVisitor visitor = new FMetaVisitor() {
      @Override
      public boolean visit(Result r) throws IOException {
        if (r == null || r.isEmpty()) {
View Full Code Here

  @Override
  public List<Pair<EntityGroupInfo, ServerName>> getTableEntityGroupsAndLocations(
      final byte[] tableName, final boolean excludeOfflinedSplitParents)
      throws MetaException {
    byte[] startrow = tableName;
    FilterList allFilters = new FilterList();
    allFilters.addFilter(new PrefixFilter(tableName));

    final List<Pair<EntityGroupInfo, ServerName>> entityGroupInfos = new ArrayList<Pair<EntityGroupInfo, ServerName>>();
    FMetaVisitor visitor = new FMetaVisitor() {
      @Override
      public boolean visit(Result r) throws IOException {
View Full Code Here

        get.setMaxVersions(1);
        for (ColumnStruct col : this.action.getColumns()) {
          get.addColumn(Bytes.toBytes(col.getFamilyName()),
              Bytes.toBytes(col.getColumnName()));
        }
        FilterList filters =  new FilterList();
        for (ColumnStruct columnStruct : action.getNotIndexConditionColumns()) {
          Filter filter = new SingleColumnValueFilter(Bytes.toBytes(columnStruct.getFamilyName()),
              Bytes.toBytes(columnStruct.getColumnName()),
              ParserUtils.convertIntValueToCompareOp(columnStruct.getCompareOp()), columnStruct.getValue());
          filters.addFilter(filter);

          NavigableSet<byte[]> qualifierSet = get.getFamilyMap().get(
              Bytes.toBytes(columnStruct.getFamilyName()));
          if(qualifierSet !=null &&
              (!qualifierSet.contains(Bytes.toBytes(columnStruct.getColumnName()))) ){
View Full Code Here

TOP

Related Classes of org.apache.hadoop.hbase.filter.FilterList

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.