Package org.apache.cassandra.db

Examples of org.apache.cassandra.db.ColumnFamilyStore


    }

    /** load keyspace (table) definitions, but do not initialize the table instances. */
    public static void loadSchemas() throws IOException
    {
        ColumnFamilyStore schemaCFS = SystemTable.schemaCFS(SystemTable.SCHEMA_KEYSPACES_CF);

        // if table with definitions is empty try loading the old way
        if (schemaCFS.estimateKeys() == 0)
        {
            // we can load tables from local storage if a version is set in the system table and that actually maps to
            // real data in the definitions table.  If we do end up loading from xml, store the definitions so that we
            // don't load from xml anymore.
            UUID uuid = MigrationManager.getLastMigrationId();
View Full Code Here


            KSMetaData ksm = schema.getTableDefinition(name);

            // remove all cfs from the table instance.
            for (CFMetaData cfm : ksm.cfMetaData().values())
            {
                ColumnFamilyStore cfs = Table.open(ksm.name, schema).getColumnFamilyStore(cfm.cfName);
                schema.purge(cfm);
                if (!StorageService.instance.isClientMode())
                {
                    cfs.snapshot(snapshotName);
                    cfs.flushLock.lock();
                    try
                    {
                        Table.open(ksm.name, schema).dropCf(cfm.cfId);
                    }
View Full Code Here

        // transfer
        Streaming.transferSSTables(LOCAL, Arrays.asList(sstable), tablename);

        // confirm that the SSTable was transferred and registered
        ColumnFamilyStore cfstore = Table.open(tablename).getColumnFamilyStore(cfname);
        RangeReply rr = cfstore.getKeyRange("", "", 2);
        assert rr.keys.size() == 1;
        assert rr.keys.contains("key");
    }
View Full Code Here

    }

    /** load keyspace (table) definitions, but do not initialize the table instances. */
    public static void loadSchemas() throws IOException
    {
        ColumnFamilyStore schemaCFS = SystemTable.schemaCFS(SystemTable.SCHEMA_KEYSPACES_CF);

        // if table with definitions is empty try loading the old way
        if (schemaCFS.estimateKeys() == 0)
        {
            // we can load tables from local storage if a version is set in the system table and that actually maps to
            // real data in the definitions table.  If we do end up loading from xml, store the definitions so that we
            // don't load from xml anymore.
            UUID uuid = MigrationManager.getLastMigrationId();
View Full Code Here

            {
                TreeRequest remotereq = this.deserialize(buffer, message.getVersion());
                TreeRequest request = new TreeRequest(remotereq.sessionid, message.getFrom(), remotereq.range, remotereq.cf);

                // trigger readonly-compaction
                ColumnFamilyStore store = Table.open(request.cf.left).getColumnFamilyStore(request.cf.right);
                Validator validator = new Validator(request);
                logger.debug("Queueing validation compaction for " + request);
                CompactionManager.instance.submitValidation(store, validator);
            }
            catch (IOException e)
View Full Code Here

                {
                    SSTableReader sstable = future.get();
                    assert sstable.getTableName().equals(table);
                    if (sstable == null)
                        continue;
                    ColumnFamilyStore cfs = Table.open(sstable.getTableName()).getColumnFamilyStore(sstable.getColumnFamilyName());
                    cfs.addSSTable(sstable);
                    if (!cfstores.containsKey(cfs))
                        cfstores.put(cfs, new ArrayList<SSTableReader>());
                    cfstores.get(cfs).add(sstable);
                }
                catch (InterruptedException e)
View Full Code Here

        }
       
        public void prepare()
        {
            List<DecoratedKey> keys = new ArrayList<DecoratedKey>();
            ColumnFamilyStore cfs;
            try
            {
                cfs = Table.open(cf.left).getColumnFamilyStore(cf.right);
            }
            catch (IOException e)
            {
                throw new IOError(e);
            }
            if (cfs != null) // TODO test w/ valid CF definitions, this if{} shouldn't be necessary
            {
                for (SSTable.KeyPosition info: cfs.allIndexPositions())
                    keys.add(info.key);
            }

            if (keys.isEmpty())
            {
View Full Code Here

         * Streaming API.
         */
        void performStreamingRepair() throws IOException
        {
            logger.info("Performing streaming repair of " + differences.size() + " ranges to " + remote + " for " + cf);
            ColumnFamilyStore cfstore = Table.open(cf.left).getColumnFamilyStore(cf.right);
            try
            {
                List<Range> ranges = new ArrayList<Range>(differences);
                List<SSTableReader> sstables = CompactionManager.instance.submitAnticompaction(cfstore, ranges, remote).get();
                StreamOut.transferSSTables(remote, sstables, cf.left);
View Full Code Here

            String tableName;
            String[] pieces = FBUtilities.strip(distinctEntry, "-");
            tableName = pieces[0];
            Table table = Table.open( tableName );

            ColumnFamilyStore cfStore = table.getColumnFamilyStore(pieces[1]);
            if (logger.isDebugEnabled())
              logger.debug("Generating file name for " + distinctEntry + " ...");
            fileNames.put(distinctEntry, cfStore.getTempSSTableFileName());
        }

        return fileNames;
    }
View Full Code Here

         * that will be called out of band once the streams complete.
         */
        void performStreamingRepair() throws IOException
        {
            logger.info("Performing streaming repair of " + differences.size() + " ranges for " + request);
            ColumnFamilyStore cfstore = Table.open(request.cf.left).getColumnFamilyStore(request.cf.right);
            try
            {
                List<Range> ranges = new ArrayList<Range>(differences);
                Collection<SSTableReader> sstables = cfstore.getSSTables();
                Callback callback = new Callback();
                // send ranges to the remote node
                StreamOutSession outsession = StreamOutSession.create(request.cf.left, request.endpoint, callback);
                StreamOut.transferSSTables(outsession, sstables, ranges);
                // request ranges from the remote node
View Full Code Here

TOP

Related Classes of org.apache.cassandra.db.ColumnFamilyStore

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.