src/java/org/apache/cassandra/service/StorageService.java
/**
     * Takes the snapshot for the given tables. A snapshot name must be specified.
     *
     * @param tag the tag given to the snapshot; may not be null or empty
     * @param tableNames the name of the tables to snapshot; empty means "all."
     */
Takes the snapshot for the given tables. A snapshot name must be specified.
@param tag the tag given to the snapshot; may not be null or empty
@param tableNames the name of the tables to snapshot; empty means "all."
Takes the snapshot for the given tables . A snapshot name must be specified . @param tag the tag given to the snapshot ; may not be null or empty @param tableNames the name of the tables to snapshot ; empty means " all . "
@Override
    public void takeSnapshot(String tag, String... tableNames) throws IOException
    {
        if (tag == null || tag.equals(""))
            throw new IOException("You must supply a snapshot name.");
        Iterable<Table> tables;
        if (tableNames.length == 0)
        {
            tables = Table.all();
        }
        else
        {
            ArrayList<Table> t = new ArrayList<Table>();
            for (String table : tableNames)
                t.add(getValidTable(table));
            tables = t;
        }
        for (Table table : tables)
            if (table.snapshotExists(tag))
                throw new IOException("Snapshot " + tag + " already exists.");
        for (Table table : tables)
            table.snapshot(tag);
    }
@ Override public void takeSnapshot ( String tag , String ... tableNames ) throws IOException { if ( tag == null || tag . equals ( "" ) ) throw new IOException ( "You must supply a snapshot name." ) ; Iterable < Table > tables ; if ( tableNames . length == 0 ) { tables = Table . all ( ) ; } else { ArrayList < Table > t = new ArrayList < Table > ( ) ; for ( String table : tableNames ) t . add ( getValidTable ( table ) ) ; tables = t ; } for ( Table table : tables ) if ( table . snapshotExists ( tag ) ) throw new IOException ( "Snapshot " + tag + " already exists." ) ; for ( Table table : tables ) table . snapshot ( tag ) ; }
Takes the snapshot for the given tables.
Takes the snapshot for the given tables .
// Do a check to see if this snapshot exists before we actually snapshot