Package org.apache.cassandra.db

Examples of org.apache.cassandra.db.Table


        HTMLFormatter formatter = new HTMLFormatter();
        formatter.appendLine("<BR><fieldset><legend>Query the cluster</legend>");
        formatter.appendLine("<FORM action=\"" + StorageService.getHostUrl() + "/home?" + QUERY + "=T\" method=\"post\">");

        // get the list of column families
        Table table = Table.open("Mailbox");
        Set<String> columnFamilyComboBoxSet = table.getColumnFamilies();

        formatter.append("select from ");
        formatter.addCombobox(columnFamilyComboBoxSet, "columnfamily", 0);
        formatter.append(" : <INPUT name=columnName>");
        formatter.appendLine(" where key = <INPUT name=key>");
View Full Code Here


        HTMLFormatter formatter = new HTMLFormatter();
        formatter.appendLine("<BR><fieldset>\n<legend>Insert data into the cluster</legend>\n");
        formatter.appendLine("<FORM action=\"" + StorageService.getHostUrl() + "/home?" + INSERT + "=T\" method=\"post\">");

        // get the list of column families
        Table table = Table.open("Mailbox");
        Set<String> columnFamilyComboBoxSet = table.getColumnFamilies();

        formatter.append("insert into ");
        formatter.addCombobox(columnFamilyComboBoxSet, "columnfamily", 0);
        formatter.append(" : <INPUT name=columnName>");
        formatter.append(" data = <INPUT name=data>");
View Full Code Here

      StringBuilder sb = new StringBuilder();
      ColumnFamilyFormatter cformatter = new ColumnFamilyFormatter(sb);

        try
        {
        Table table = Table.open(sTableName);
        String queryFor = sColumnFamily;
        if(sColumn != null && !"*".equals(sColumn))
        {
          queryFor += ":" + sColumn;
        }
          ColumnFamily cf = table.get(sKey, queryFor);

          if (cf == null)
          {
              sRetVal = "Key [" + sKey + "], column family [" + sColumnFamily + "] not found.";
          }
View Full Code Here

        return "Loading...";
    }

    private String handleCompactMe()
    {
        Table table = Table.open(DatabaseDescriptor.getTables().get(0));
        table.forceCompaction();
        return "Compacting ...";
    }
View Full Code Here

        return response.row();
    }

    static void touch_local(String tablename, String key, boolean fData ) throws IOException
    {
    Table table = Table.open( tablename );
    table.touch(key, fData);
    }
View Full Code Here

        List<EndPoint> endpoints = StorageService.instance().getNLiveStorageEndPoint(command.key);
        /* Remove the local storage endpoint from the list. */
        endpoints.remove(StorageService.getLocalStorageEndPoint());
        // TODO: throw a thrift exception if we do not have N nodes

        Table table = Table.open(DatabaseDescriptor.getTables().get(0));
        Row row = command.getRow(table);

        /*
           * Do the consistency checks in the background and return the
           * non NULL row.
View Full Code Here

         * (3) Handoff the data.
        */
        List<String> tables = DatabaseDescriptor.getTables();
        for ( String tName : tables )
        {
            Table table = Table.open(tName);
            logger_.debug("Flushing memtables ...");
            table.flush(false);
            logger_.debug("Forcing compaction ...");
            /* Get the counting bloom filter for each endpoint and the list of files that need to be streamed */
            List<String> fileList = new ArrayList<String>();
            boolean bVal = table.forceCompaction(ranges, target, fileList);               
            doHandoff(target, fileList);
        }
    }
View Full Code Here

    {
        /* Create a local sstable for each remote sstable */
        Descriptor remotedesc = remote.desc;

        // new local sstable
        Table table = Table.open(remotedesc.ksname);
        ColumnFamilyStore cfStore = table.getColumnFamilyStore(remotedesc.cfname);
        Descriptor localdesc = Descriptor.fromFilename(cfStore.getFlushPath(remote.size, remote.desc.version));

        return new PendingFile(localdesc, remote);
     }
View Full Code Here

        logger.info("Beginning transfer to {}", target);
        logger.debug("Ranges are {}", StringUtils.join(ranges, ","));

        try
        {
            Table table = flushSSTable(tableName);
            // send the matching portion of every sstable in the keyspace
            transferSSTables(session, table.getAllSSTables(), ranges);
        }
        catch (IOException e)
        {
            throw new IOError(e);
        }
View Full Code Here

     * (2) determine the minimal file sections we need to send for the given ranges
     * (3) transfer the data.
     */
    private static Table flushSSTable(String tableName) throws IOException
    {
        Table table = Table.open(tableName);
        logger.info("Flushing memtables for {}...", tableName);
        for (Future f : table.flush())
        {
            try
            {
                f.get();
            }
View Full Code Here

TOP

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

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.