Examples of KsDef


Examples of org.apache.cassandra.db.migration.avro.KsDef

            for (IColumn column : columns)
            {
                if (column.name().equals(DEFINITION_SCHEMA_COLUMN_NAME))
                    continue;
                KsDef ks = deserializeAvro(schema, column.value(), new KsDef());
                keyspaces.add(Avro.ksFromAvro(ks));
            }

            // store deserialized keyspaces into new place
            dumpToStorage(keyspaces);
View Full Code Here

Examples of org.apache.cassandra.db.migration.avro.KsDef

            for (IColumn column : columns)
            {
                if (column.name().equals(DEFINITION_SCHEMA_COLUMN_NAME))
                    continue;
                KsDef ks = deserializeAvro(schema, column.value(), new KsDef());
                keyspaces.add(Avro.ksFromAvro(ks));
            }

            // store deserialized keyspaces into new place
            dumpToStorage(keyspaces);
View Full Code Here

Examples of org.apache.cassandra.db.migration.avro.KsDef

            for (IColumn column : columns)
            {
                if (column.name().equals(DEFINITION_SCHEMA_COLUMN_NAME))
                    continue;
                KsDef ks = deserializeAvro(schema, column.value(), new KsDef());
                keyspaces.add(Avro.ksFromAvro(ks));
            }

            // store deserialized keyspaces into new place
            save(keyspaces);
View Full Code Here

Examples of org.apache.cassandra.thrift.KsDef

   */

  public void addKeyspace(String keyspace) throws Exception {

    List<CfDef> cfDefList = new ArrayList<CfDef>();
    KsDef ksDef = new KsDef(keyspace,
        "org.apache.cassandra.locator.SimpleStrategy", cfDefList);
    ksDef.putToStrategy_options("replication_factor", "1");
    server.system_add_keyspace(ksDef);
  }
View Full Code Here

Examples of org.apache.cassandra.thrift.KsDef

  public void addKeyspace(String keyspace, String locatorStrategy,
      String replicationFactor) throws Exception {

    List<CfDef> cfDefList = new ArrayList<CfDef>();
    KsDef ksDef = new KsDef(keyspace, locatorStrategy, cfDefList);
    ksDef.putToStrategy_options("replication_factor", replicationFactor);
    tr = new TFramedTransport(new TSocket(cassandraHost, cassandraPort));
    proto = new TBinaryProtocol(tr);
    client = new Cassandra.Client(proto);

    tr.open();
View Full Code Here

Examples of org.apache.cassandra.thrift.KsDef

      ModelMap model) throws Exception {
   
    Client client = clientProvider.getThriftClient();
   
    // Extracting list of column families
    KsDef ksDef = client.describe_keyspace(keyspaceName);
    model.put("columnFamilies", ksDef.getCf_defs());
   
    // setting names
    model.addAttribute("keyspaceName", keyspaceName);
    model.addAttribute("columnFamilyName", columnFamilyName);
    if (cassandraService.isSystemKeyspace(keyspaceName)) {
View Full Code Here

Examples of org.apache.cassandra.thrift.KsDef

        //Collections.sort(keyspaceSet);
        model.addAttribute("keyspaces", client.describe_keyspaces());
       
        // Get list of column families from active keyspace.
        if (activeKeyspace.length() > 0) {
          KsDef ksdef = client.describe_keyspace(activeKeyspace);
          List<CfDef> cfList = new ArrayList<CfDef>(ksdef.getCf_defs());
          Collections.sort(cfList);
          model.addAttribute("columnFamilies", cfList);
        }
       
      } else {
View Full Code Here

Examples of org.apache.cassandra.thrift.KsDef

      ModelMap model) throws Exception {
   
    Client client = clientProvider.getThriftClient();
   
    // Getting keyspace information
    KsDef ksDef = client.describe_keyspace(keyspaceName);
    model.put("keyspace", ksDef);
    model.put("keyspaceName", keyspaceName);
   
    // Check the system keyspace
    boolean isSystem = cassandraService.isSystemKeyspace(keyspaceName);
View Full Code Here

Examples of org.apache.cassandra.thrift.KsDef

      strategyClass = "org.apache.cassandra.locator NetworkTopologyStrategy";
    } else if (strategy.equals("OldNetworkTopology")) {
      strategyClass = "org.apache.cassandra.locator.OldNetworkTopologyStrategy";
    }
   
    KsDef ksDef = new KsDef(name, strategyClass, new ArrayList<CfDef>());
    Map<String, String> strategyOptions = new HashMap<String, String>();
    strategyOptions.put("replication_factor", String.valueOf(replicationFactor));
    ksDef.setStrategy_options(strategyOptions);
    client.system_add_keyspace(ksDef);
   
    model.clear();
    return "redirect:/keyspace/" + name + "/";
  }
View Full Code Here

Examples of org.apache.cassandra.thrift.KsDef

        }
    }

    public Migration getMigration() throws InvalidRequestException, ConfigurationException, IOException
    {
        KsDef ksd = new KsDef(name, strategyClass, Collections.<CfDef>emptyList());
        ksd.setStrategy_options(strategyOptions);
        ThriftValidation.validateKsDef(ksd);
        ThriftValidation.validateKeyspaceNotYetExisting(name);
        return new AddKeyspace(KSMetaData.fromThrift(ksd));
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.