Package org.apache.cassandra.db.filter

Examples of org.apache.cassandra.db.filter.NamesQueryFilter


        // add data
        rm = new Mutation("Keyspace1", dk.key);
        rm.add("Standard1", Util.cellname("Column1"), ByteBufferUtil.bytes("abcd"), 0);
        rm.apply();

        ReadCommand command = new SliceByNamesReadCommand("Keyspace1", dk.key, "Standard1", System.currentTimeMillis(), new NamesQueryFilter(FBUtilities.singleton(Util.cellname("Column1"), type)));
        Row row = command.getRow(keyspace);
        Cell col = row.cf.getColumn(Util.cellname("Column1"));
        assertEquals(col.value(), ByteBuffer.wrap("abcd".getBytes()));
    }
View Full Code Here


    public static NamesQueryFilter namesFilter(ColumnFamilyStore cfs, String... names)
    {
        SortedSet<CellName> s = new TreeSet<CellName>(cfs.getComparator());
        for (String str : names)
            s.add(cellname(str));
        return new NamesQueryFilter(s);
    }
View Full Code Here

          logger_.debug("Started scheduleAllDeliveries");

        ColumnFamilyStore hintStore = Table.open(Table.SYSTEM_TABLE).getColumnFamilyStore(HINTS_CF);
        IPartitioner p = StorageService.getPartitioner();
        Range range = new Range(p.getMinimumToken(), p.getMinimumToken(), p);
        IFilter filter = new NamesQueryFilter(ImmutableSortedSet.<ByteBuffer>of());
        List<Row> rows = hintStore.getRangeSlice(null, range, Integer.MAX_VALUE, filter);
        for (Row row : rows)
        {
            Token<?> token = StorageService.getPartitioner().getTokenFactory().fromByteArray(row.key.key);
            InetAddress target = StorageService.instance.getTokenMetadata().getEndpoint(token);
View Full Code Here

            // avoid changing the filter columns of the original filter
            // (reduceNameFilter removes columns that are known to be irrelevant)
            TreeSet<ByteBuffer> filterColumns = new TreeSet<ByteBuffer>(cfs.metadata.comparator);
            filterColumns.addAll(((NamesQueryFilter) filter.filter).columns);
            QueryFilter reducedFilter = new QueryFilter(filter.key, filter.path, new NamesQueryFilter(filterColumns));

            /* add the SSTables on disk */
            Collections.sort(view.sstables, SSTable.maxTimestampComparator);

            // read sorted sstables
View Full Code Here

                temp.clear();
            }

            // avoid changing the filter columns of the original filter
            // (reduceNameFilter removes columns that are known to be irrelevant)
            NamesQueryFilter namesFilter = (NamesQueryFilter) filter.filter;
            TreeSet<ByteBuffer> filterColumns = new TreeSet<ByteBuffer>(namesFilter.columns);
            QueryFilter reducedFilter = new QueryFilter(filter.key, filter.path, namesFilter.withUpdatedColumns(filterColumns));

            /* add the SSTables on disk */
            Collections.sort(view.sstables, SSTable.maxTimestampComparator);

            // read sorted sstables
View Full Code Here

        SliceRange sr = sp.slice_range;
        if (sr == null)
        {
            SortedSet<ByteBuffer> ss = new TreeSet<ByteBuffer>(comparator);
            ss.addAll(sp.column_names);
            return new NamesQueryFilter(ss);
        }
        else
        {
            return new SliceQueryFilter(sr.start, sr.finish, sr.reversed, sr.count);
        }
View Full Code Here

    public int countAllBatches()
    {
        int count = 0;

        for (Row row : getRangeSlice(new NamesQueryFilter(ImmutableSortedSet.<ByteBuffer>of())))
        {
            if (row.cf != null && !row.cf.isMarkedForDelete())
                count++;
        }
View Full Code Here

        try
        {
            logger.debug("Started replayAllFailedBatches");

            for (Row row : getRangeSlice(new NamesQueryFilter(WRITTEN_AT)))
            {
                if (row.cf == null || row.cf.isMarkedForDelete())
                    continue;

                IColumn writtenAt = row.cf.getColumn(WRITTEN_AT);
View Full Code Here

          logger_.debug("Started scheduleAllDeliveries");

        ColumnFamilyStore hintStore = Table.open(Table.SYSTEM_TABLE).getColumnFamilyStore(HINTS_CF);
        IPartitioner p = StorageService.getPartitioner();
        Range range = new Range(p.getMinimumToken(), p.getMinimumToken(), p);
        IFilter filter = new NamesQueryFilter(ImmutableSortedSet.<ByteBuffer>of());
        List<Row> rows = hintStore.getRangeSlice(null, range, Integer.MAX_VALUE, filter);
        for (Row row : rows)
        {
            Token<?> token = StorageService.getPartitioner().getTokenFactory().fromByteArray(row.key.key);
            InetAddress target = StorageService.instance.getTokenMetadata().getEndpoint(token);
View Full Code Here

            // avoid changing the filter columns of the original filter
            // (reduceNameFilter removes columns that are known to be irrelevant)
            TreeSet<ByteBuffer> filterColumns = new TreeSet<ByteBuffer>(cfs.metadata.comparator);
            filterColumns.addAll(((NamesQueryFilter) filter.filter).columns);
            QueryFilter reducedFilter = new QueryFilter(filter.key, filter.path, new NamesQueryFilter(filterColumns));

            /* add the SSTables on disk */
            Collections.sort(view.sstables, SSTable.maxTimestampComparator);

            // read sorted sstables
View Full Code Here

TOP

Related Classes of org.apache.cassandra.db.filter.NamesQueryFilter

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.