Package org.apache.hadoop.hbase.index

Examples of org.apache.hadoop.hbase.index.Column


      List<FilterColumnValueDetail> fcvds = new ArrayList<FilterColumnValueDetail>(colsSize);
      int i = 0;
      for (ColumnQualifier cq : index.getIndexColumns()) {
        FilterColumnValueDetail fcvd =
            leafNodes.get(
              new Column(cq.getColumnFamily(), cq.getQualifier(), cq.getValuePartition()))
                .getFilterColumnValueDetail();
        assert fcvd != null;
        fcvds.add(fcvd);
        i++;
        if (i == colsSize) {
View Full Code Here


  // in the passed cols list
  private boolean isIndexSuitable(IndexSpecification index, List<Column> cols,
      Map<Column, LeafFilterNode> leafNodes) {
    int matchedCols = 0;
    for (ColumnQualifier cq : index.getIndexColumns()) {
      Column column = new Column(cq.getColumnFamily(), cq.getQualifier(), cq.getValuePartition());
      if (cols.contains(column)) {
        matchedCols++;
        // leafNodes.get(column) will never be null.. Don't worry
        if (leafNodes.get(column).getFilterColumnValueDetail() instanceof FilterColumnValueRange) {
          // When the condition on the column is a range condition, we need to ensure in this index
View Full Code Here

    for (IndexSpecification index : indices) {
      Set<ColumnQualifier> indexColumns = index.getIndexColumns();
      // Don't worry . This Set is LinkedHashSet. So this will maintain the order.
      Iterator<ColumnQualifier> indexColumnsIterator = indexColumns.iterator();
      ColumnQualifier firstCQInIndex = indexColumnsIterator.next();
      Column firstColInIndex =
          new Column(firstCQInIndex.getColumnFamily(), firstCQInIndex.getQualifier(),
              firstCQInIndex.getValuePartition());
      if (firstColInIndex.equals(detail.column)) {
        possibleUseIndices.add(new Pair<IndexSpecification, Integer>(index, indexColumns.size()));
        // When we have condition on col1 and we have indices on col1&Col2 and col1&col3
        // which one we should select? We dont know the data related details of every index.
        // So select any one. May be the 1st come selected.
        // TODO later we can add more intelligence and then add index level data details
        if (indexColumns.size() < bestFitIndexColsSize) {
          bestFitIndex = index;
          bestFitIndexColsSize = indexColumns.size();
        }
        detail.maxValueLength = firstCQInIndex.getMaxValueLength();
        detail.valueType = firstCQInIndex.getType();
      }
      // This index might be useful at a topper level....
      // I will explain in detail
      // When the filter from customer is coming this way as shown below
      // &
      // ___|___
      // | |
      // c1=10 c2=5
      // Suppose we have an index on c2&c1 only on the table, when we check for c1=10 node
      // we will not find any index for that as index is not having c1 as the 1st column.
      // For c2=5 node, the index is a possible option. Now when we consider the & node,
      // the index seems perfect match. That is why even for the c1=10 node also, we can not
      // sat it is a NoIndexFilterNode, if there are any indices on the table which contain c1
      // as one column in the index columns.
      else {
        ColumnQualifier cq = null;
        Column column = null;
        while (indexColumnsIterator.hasNext()) {
          cq = indexColumnsIterator.next();
          column = new Column(cq.getColumnFamily(), cq.getQualifier(), cq.getValuePartition());
          if (column.equals(detail.column)) {
            possibleFutureUseIndices.add(new Pair<IndexSpecification, Integer>(index, indexColumns
                .size()));
            detail.maxValueLength = firstCQInIndex.getMaxValueLength();
            detail.valueType = firstCQInIndex.getType();
            break;
View Full Code Here

                + '.';
        LOG.error(message);
        IllegalArgumentException ie = new IllegalArgumentException(message);
        throw new IOException(ie);
      }
      Column column = new Column(cq.getColumnFamily(), cq.getQualifier(), cq.getValuePartition());
      ValueType type = cq.getType();
      int maxlength = cq.getMaxValueLength();
      Pair<ValueType, Integer> colDetail = indexColDetails.get(column);
      if (null != colDetail) {
        if (!colDetail.getFirst().equals(type) || colDetail.getSecond() != maxlength) {
View Full Code Here

    @Override
    public boolean equals(Object obj) {
      if (!(obj instanceof ColumnWithValue)) return false;
      ColumnWithValue that = (ColumnWithValue) obj;
      Column col = that.getColumn();
      boolean equals = this.column.equals(col);
      if (equals && Bytes.equals(this.value, that.getValue())) {
        return true;
      } else {
        return false;
View Full Code Here

TOP

Related Classes of org.apache.hadoop.hbase.index.Column

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.