Examples of Callable


Examples of java.util.concurrent.Callable

    putToChannel(in, badEvent);

    // run the sink
    sink.start();
    assertThrows("Should fail", EventDeliveryException.class,
        new Callable() {
          @Override
          public Object call() throws EventDeliveryException {
            sink.process();
            return null;
          }
View Full Code Here

Examples of java.util.concurrent.Callable

    // Copy-pasted from the thrift CassandraServer, using the factory methods to create exceptions.
    // helper method to apply migration on the migration stage. typical migration failures will throw an
    // InvalidRequestException. atypical failures will throw a RuntimeException.
    private static void applyMigrationOnStage(final Migration m) throws InvalidRequestException
    {
        Future f = StageManager.getStage(Stage.MIGRATION).submit(new Callable()
        {
            public Object call() throws Exception
            {
                m.apply();
                m.announce();
View Full Code Here

Examples of java.util.concurrent.Callable

   
    // helper method to apply migration on the migration stage. typical migration failures will throw an
    // InvalidRequestException. atypical failures will throw a RuntimeException.
    private static void applyMigrationOnStage(final Migration m)
    {
        Future f = StageManager.getStage(Stage.MIGRATION).submit(new Callable()
        {
            public Object call() throws Exception
            {
                m.apply();
                m.announce();
View Full Code Here

Examples of java.util.concurrent.Callable

        segments.add(new CommitLogSegment(cfSize));
       
        if (DatabaseDescriptor.getCommitLogSync() == DatabaseDescriptor.CommitLogSync.periodic)
        {
            executor = new PeriodicCommitLogExecutorService();
            final Callable syncer = new Callable()
            {
                public Object call() throws Exception
                {
                    sync();
                    return null;
View Full Code Here

Examples of java.util.concurrent.Callable

     * The bit flag associated with this column family is set in the
     * header and this is used to decide if the log file can be deleted.
    */
    public void discardCompletedSegments(final String tableName, final String cf, final CommitLogSegment.CommitLogContext context) throws IOException
    {
        Callable task = new Callable()
        {
            public Object call() throws IOException
            {
                int id = Table.open(tableName).getColumnFamilyId(cf);
                discardCompletedSegmentsInternal(context, id);
View Full Code Here

Examples of java.util.concurrent.Callable

        currentSegment().sync();
    }
   
    public void forceNewSegment()
    {
        Callable task = new Callable()
        {
            public Object call() throws Exception
            {
                sync();
                segments.add(new CommitLogSegment(currentSegment().getHeader().getColumnFamilyCount()));
View Full Code Here

Examples of java.util.concurrent.Callable

     * @param cfId    the column family ID that was flushed
     * @param context the replay position of the flush
     */
    public void discardCompletedSegments(final Integer cfId, final ReplayPosition context) throws IOException
    {
        Callable task = new Callable()
        {
            public Object call() throws IOException
            {
                logger.debug("discard completed log segments for {}, column family {}", context, cfId);

View Full Code Here

Examples of java.util.concurrent.Callable

     */
    public void forceNewSegment() throws ExecutionException, InterruptedException
    {
        logger.debug("Forcing new segment creation");

        Callable<?> task = new Callable()
        {
            public Object call() throws IOException
            {
                if (activeSegment.position() > 0)
                    activateNextSegment();
View Full Code Here

Examples of java.util.concurrent.Callable

   
    // helper method to apply migration on the migration stage. typical migration failures will throw an
    // InvalidRequestException. atypical failures will throw a RuntimeException.
    private static void applyMigrationOnStage(final Migration m)
    {
        Future f = StageManager.getStage(Stage.MIGRATION).submit(new Callable()
        {
            public Object call() throws Exception
            {
                m.apply();
                m.announce();
View Full Code Here

Examples of java.util.concurrent.Callable

     * @param cfId    the column family ID that was flushed
     * @param context the replay position of the flush
     */
    public void discardCompletedSegments(final UUID cfId, final ReplayPosition context)
    {
        Callable task = new Callable()
        {
            public Object call()
            {
                logger.debug("discard completed log segments for {}, column family {}", context, cfId);

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.