## org.apache.cassandra.tools
Class SSTableImport

    java.lang.Object
      org.apache.cassandra.tools.SSTableImport

    public class SSTableImport

extends java.lang.Object

Create SSTables from JSON input

Constructor Summary
`SSTableImport()`

Method Summary
`static void` `importJson(java.lang.String jsonFile, java.lang.String keyspace, java.lang.String cf, java.lang.String ssTablePath)` Convert a JSON formatted file to an SSTable.
`static int` `importSorted(java.lang.String jsonFile, ColumnFamily columnFamily, java.lang.String ssTablePath, IPartitioner<?> partitioner)`
`static void` `main(java.lang.String[] args)` Converts JSON to an SSTable file.
`static void` `setKeyCountToImport(java.lang.Integer keyCount)` Used by test framework to set key count

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### SSTableImport

    public SSTableImport()

Method Detail

### importJson

    public static void importJson(java.lang.String jsonFile,
                                  java.lang.String keyspace,
                                  java.lang.String cf,
                                  java.lang.String ssTablePath)
                           throws java.io.IOException

  Convert a JSON formatted file to an SSTable.

  Parameters:
    `jsonFile` - the file containing JSON formatted data
    `keyspace` - keyspace the data belongs to
    `cf` - column family the data belongs to
    `ssTablePath` - file to write the SSTable to
  Throws:
    `java.io.IOException` - for errors reading/writing input/output

### importSorted

    public static int importSorted(java.lang.String jsonFile,
                                   ColumnFamily columnFamily,
                                   java.lang.String ssTablePath,
                                   IPartitioner<?> partitioner)
                            throws java.io.IOException

  Throws:
    `java.io.IOException`

### main

    public static void main(java.lang.String[] args)
                     throws java.io.IOException,
                            org.apache.commons.cli.ParseException,
                            ConfigurationException

  Converts JSON to an SSTable file. JSON input can either be a file specified using an optional command line argument, or supplied on standard in.

  Parameters:
    `args` - command line arguments
  Throws:
    `java.io.IOException` - on failure to open/read/write files or output streams
    `org.apache.commons.cli.ParseException` - on failure to parse JSON input
    `ConfigurationException` - on configuration error.

### setKeyCountToImport

    public static void setKeyCountToImport(java.lang.Integer keyCount)

  Used by test framework to set key count

  Parameters:
    `keyCount` - numbers of keys to import

Copyright © 2012 The Apache Software Foundation