Package org.apache.cassandra.thrift

Examples of org.apache.cassandra.thrift.SuperColumn$SuperColumnTupleSchemeFactory


          List<ColumnOrSuperColumn> cosc = cassandra.get_slice(key, clp, sp,
              getThriftCl(OperationType.READ));
          if (cosc == null || cosc.isEmpty()) {
            return null;
          }
          return new SuperColumn(ByteBuffer.wrap(columnPath.getSuper_column()), getColumnList(cosc));
        } catch (Exception e) {
          throw xtrans.translate(e);
        }
      }
    };
View Full Code Here


            }
            return result;
          } else {
            Map<ByteBuffer, List<SuperColumn>> result = new HashMap<ByteBuffer, List<SuperColumn>>();
            for (Map.Entry<ByteBuffer, List<ColumnOrSuperColumn>> entry : cfmap.entrySet()) {
              SuperColumn spc = new SuperColumn(ByteBuffer.wrap(columnParent.getSuper_column()),
                  getColumnList(entry.getValue()));
              ArrayList<SuperColumn> spclist = new ArrayList<SuperColumn>(1);
              spclist.add(spc);
              result.put(entry.getKey(), spclist);
            }
View Full Code Here

          @Override
          public HSuperColumn<SN, N, V> doInKeyspace(KeyspaceService ks) throws HectorException {
            try {
              ColumnPath cpath = ThriftFactory.createSuperColumnPath(columnFamilyName, superName, (N) null,
                  sNameSerializer, columnNameSerializer);
              SuperColumn thriftSuperColumn = ks.getSuperColumn(keySerializer.toByteBuffer(key), cpath);
              if (thriftSuperColumn == null) {
                return null;
              }
              return new HSuperColumnImpl<SN, N, V>(thriftSuperColumn, sNameSerializer, columnNameSerializer,
                  valueSerializer);
View Full Code Here

  public SuperColumn toThrift() {
    if (superName == null || columns == null) {
      return null;
    }
    return new SuperColumn(superNameSerializer.toByteBuffer(superName), toThriftColumn());
  }
View Full Code Here

            @Override
            public Column<C> next() {
                ColumnOrSuperColumn column = base.next();
                if (column.isSetSuper_column()) {
                    SuperColumn sc = column.getSuper_column();
                    return new ThriftSuperColumnImpl<C>(colSer.fromBytes(sc.getName()), sc);
                }
                else if (column.isSetCounter_column()) {
                    CounterColumn cc = column.getCounter_column();
                    return new ThriftCounterColumnImpl<C>(colSer.fromBytes(cc.getName()), cc);
                }
View Full Code Here

        if (column == null) {
            // TODO: throw an exception
            return null;
        }
        else if (column.isSetSuper_column()) {
            SuperColumn sc = column.getSuper_column();
            return new ThriftSuperColumnImpl<C2>(colSer.fromBytes(sc.getName()), sc);
        }
        else if (column.isSetCounter_super_column()) {
            CounterSuperColumn sc = column.getCounter_super_column();
            return new ThriftCounterSuperColumnImpl<C2>(colSer.fromBytes(sc.getName()), sc);
        }
        throw new UnsupportedOperationException("\'" + columnName + "\' is not a composite column");
    }
View Full Code Here

        if (column == null) {
            // TODO: throw an exception
            return null;
        }
        else if (column.isSetSuper_column()) {
            SuperColumn sc = column.getSuper_column();
            return new ThriftSuperColumnImpl<C2>(colSer.fromBytes(sc.getName()), sc);
        }
        else if (column.isSetCounter_super_column()) {
            CounterSuperColumn sc = column.getCounter_super_column();
            return new ThriftCounterSuperColumnImpl<C2>(colSer.fromBytes(sc.getName()), sc);
        }
        throw new UnsupportedOperationException("\'" + idx + "\' is not a super column");
    }
View Full Code Here

            @Override
            public Column<C> next() {
                ColumnOrSuperColumn column = base.next();
                if (column.isSetSuper_column()) {
                    SuperColumn sc = column.getSuper_column();
                    return new ThriftSuperColumnImpl<C>(colSer.fromBytes(sc.getName()), sc);
                }
                else if (column.isSetCounter_column()) {
                    CounterColumn cc = column.getCounter_column();
                    return new ThriftCounterColumnImpl<C>(colSer.fromBytes(cc.getName()), cc);
                }
View Full Code Here

                                            c.getName()), c);
                                }
                                else if (cosc.isSetSuper_column()) {
                                    // TODO: Super columns
                                    // should be deprecated
                                    SuperColumn sc = cosc.getSuper_column();
                                    return new ThriftSuperColumnImpl<C>(columnFamily.getColumnSerializer().fromBytes(
                                            sc.getName()), sc);
                                }
                                else if (cosc.isSetCounter_column()) {
                                    org.apache.cassandra.thrift.CounterColumn c = cosc.getCounter_column();
                                    return new ThriftCounterColumnImpl<C>(columnFamily.getColumnSerializer().fromBytes(
                                            c.getName()), c);
                                }
                                else if (cosc.isSetCounter_super_column()) {
                                    // TODO: Super columns
                                    // should be deprecated
                                    CounterSuperColumn sc = cosc.getCounter_super_column();
                                    return new ThriftCounterSuperColumnImpl<C>(columnFamily.getColumnSerializer()
                                            .fromBytes(sc.getName()), sc);
                                }
                                else {
                                    throw new RuntimeException("Unknown column type in response");
                                }
                            }
View Full Code Here

    }

    private void addMutation(Column column) {
        // 2. Create the super column mutation if this is the first call
        if (superColumn == null) {
            superColumn = new SuperColumn().setName(path.get(0));

            Mutation mutation = new Mutation();
            mutation.setColumn_or_supercolumn(new ColumnOrSuperColumn().setSuper_column(superColumn));
            mutationList.add(mutation);
        }
View Full Code Here

TOP

Related Classes of org.apache.cassandra.thrift.SuperColumn$SuperColumnTupleSchemeFactory

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.