Package org.apache.cassandra.io.sstable

Examples of org.apache.cassandra.io.sstable.SSTableLoader$Client


            {
                return Schema.instance.getCFMetaData(keyspace, cfName) != null;
            }
        };

        SSTableLoader loader = new SSTableLoader(dir, client, new OutputHandler.LogOutput());
        try
        {
            loader.stream().get();
        }
        catch (Exception e)
        {
            throw new RuntimeException(e);
        }
View Full Code Here


    {
        LoaderOptions options = LoaderOptions.parseArgs(args);
        try
        {
            OutputHandler handler = new OutputHandler.SystemOutput(options.verbose, options.debug);
            SSTableLoader loader = new SSTableLoader(options.directory, new ExternalClient(handler, options.hosts, options.rpcPort, options.user, options.passwd), handler);
            DatabaseDescriptor.setStreamThroughputOutboundMegabitsPerSec(options.throttle);
            SSTableLoader.LoaderFuture future = loader.stream(options.ignores);

            if (options.noProgress)
            {
                future.get();
            }
View Full Code Here

            externalClient = new ExternalClient(ConfigHelper.getOutputInitialAddress(conf),
                                                ConfigHelper.getOutputRpcPort(conf),
                                                username,
                                                password);

            this.loader = new SSTableLoader(outputdir, externalClient, new NullOutputHandler());
        }
    }
View Full Code Here

                    BytesType.instance,
                    subcomparator,
                    Integer.parseInt(conf.get(BUFFER_SIZE_IN_MB, "64")),
                    ConfigHelper.getOutputCompressionParamaters(conf));

            this.loader = new SSTableLoader(outputDir, new ExternalClient(conf), new NullOutputHandler());
        }
    }
View Full Code Here

    public static void main(String args[])
    {
        LoaderOptions options = LoaderOptions.parseArgs(args);
        OutputHandler handler = new OutputHandler.SystemOutput(options.verbose, options.debug);
        SSTableLoader loader = new SSTableLoader(options.directory, new ExternalClient(options.hosts,
                                                                                       options.rpcPort,
                                                                                       options.user,
                                                                                       options.passwd,
                                                                                       options.transportFactory,
                                                                                       options.storagePort,
                                                                                       options.sslStoragePort,
                                                                                       options.serverEncOptions), handler);
        DatabaseDescriptor.setStreamThroughputOutboundMegabitsPerSec(options.throttle);
        StreamResultFuture future = null;
        try
        {
            if (options.noProgress)
                future = loader.stream(options.ignores);
            else
                future = loader.stream(options.ignores, new ProgressIndicator());
        }
        catch (Exception e)
        {
            System.err.println(e.getMessage());
            if (e.getCause() != null)
                System.err.println(e.getCause());
            if (options.debug)
                e.printStackTrace(System.err);
            else
                System.err.println("Run with --debug to get full stack trace or --help to get help.");
            System.exit(1);
        }

        handler.output(String.format("Streaming session ID: %s", future.planId));

        try
        {
            future.get();
            System.exit(0); // We need that to stop non daemonized threads
        }
        catch (Exception e)
        {
            System.err.println("Streaming to the following hosts failed:");
            System.err.println(loader.getFailedHosts());
            System.err.println(e);
            if (options.debug)
                e.printStackTrace(System.err);
            System.exit(1);
        }
View Full Code Here

            {
                ExternalClient externalClient = new ExternalClient(conf);
               
                externalClient.addKnownCfs(keyspace, schema);

                this.loader = new SSTableLoader(outputDir, externalClient, new BulkRecordWriter.NullOutputHandler());
            }
        }
        catch (Exception e)
        {
            throw new IOException(e);
View Full Code Here

            {
                return Schema.instance.getCFMetaData(keyspace, cfName);
            }
        };

        SSTableLoader loader = new SSTableLoader(dir, client, new OutputHandler.LogOutput());
        return loader.stream();
    }
View Full Code Here

        {
            public void output(String msg) { logger_.info(msg); }
            public void debug(String msg) { logger_.debug(msg); }
        };

        SSTableLoader loader = new SSTableLoader(dir, client, oh);
        try
        {
            loader.stream().get();
        }
        catch (Exception e)
        {
            throw new RuntimeException(e);
        }
View Full Code Here

                    ConfigHelper.getOutputColumnFamily(conf),
                    BytesType.instance,
                    subcomparator,
                    Integer.valueOf(conf.get(BUFFER_SIZE_IN_MB, "64")),
                    ConfigHelper.getOutputCompressionParamaters(conf));
            this.loader = new SSTableLoader(outputdir, new ExternalClient(ConfigHelper.getOutputInitialAddress(conf), ConfigHelper.getOutputRpcPort(conf)), new NullOutputHandler());
        }
    }
View Full Code Here

    public static void main(String args[]) throws IOException
    {
        LoaderOptions options = LoaderOptions.parseArgs(args);
        try
        {
            SSTableLoader loader = new SSTableLoader(options.directory, new ExternalClient(options, options.hosts, options.rpcPort), options);
            DatabaseDescriptor.setStreamThroughputOutboundMegabitsPerSec(options.throttle);
            SSTableLoader.LoaderFuture future = loader.stream(options.ignores);

            if (options.noProgress)
            {
                future.get();
            }
View Full Code Here

TOP

Related Classes of org.apache.cassandra.io.sstable.SSTableLoader$Client

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.