Examples of onChange()


Examples of org.apache.cassandra.service.StorageService.onChange()

        }

        // indicate that one of the nodes is done. see if the node it was bootstrapping from is still available.
        Range<Token> range = ss.getPrimaryRangeForEndpoint(addrs[2]);
        Token token = StorageService.getPartitioner().midpoint(range.left, range.right);
        ss.onChange(bootstrapAddrs[2],
                    ApplicationState.STATUS,
                    StorageService.instance.valueFactory.normal(Collections.singleton(token)));
        load.put(bootstrapAddrs[2], 0d);
        InetAddress addr = BootStrapper.getBootstrapSource(ss.getTokenMetadata(), load);
        assert addr != null && addr.equals(addrs[2]);
View Full Code Here

Examples of org.apache.cassandra.service.StorageService.onChange()

        InetAddress myEndpoint = InetAddress.getByName("127.0.0.1");
        Range<Token> range5 = ss.getPrimaryRangeForEndpoint(five);
        Token fakeToken = StorageService.getPartitioner().midpoint(range5.left, range5.right);
        assert range5.contains(fakeToken);
        Gossiper.instance.injectApplicationState(myEndpoint, ApplicationState.TOKENS, ss.valueFactory.tokens(Collections.singleton(fakeToken)));
        ss.onChange(myEndpoint,
                    ApplicationState.STATUS,
                    StorageService.instance.valueFactory.bootstrapping(Collections.<Token>singleton(fakeToken)));
        tmd = ss.getTokenMetadata();

        InetAddress source4 = BootStrapper.getBootstrapSource(tmd, load);
View Full Code Here

Examples of org.apache.cassandra.service.StorageService.onChange()

            assert !ss.getTokenMetadata().getBootstrapTokens().containsValue(bootstrapSource);
           
            Range range = ss.getPrimaryRangeForEndpoint(bootstrapSource);
            Token token = StorageService.getPartitioner().midpoint(range.left, range.right);
            assert range.contains(token);
            ss.onChange(bootstrapAddrs[i], StorageService.MOVE_STATE, new ApplicationState(StorageService.STATE_BOOTSTRAPPING + StorageService.Delimiter + StorageService.getPartitioner().getTokenFactory().toString(token)));
        }
       
        // any further attempt to bootsrtap should fail since every node in the cluster is splitting.
        try
        {
View Full Code Here

Examples of org.apache.cassandra.service.StorageService.onChange()

        }
       
        // indicate that one of the nodes is done. see if the node it was bootstrapping from is still available.
        Range range = ss.getPrimaryRangeForEndpoint(addrs[2]);
        Token token = StorageService.getPartitioner().midpoint(range.left, range.right);
        ss.onChange(bootstrapAddrs[2], StorageService.MOVE_STATE, new ApplicationState(StorageService.STATE_NORMAL + StorageService.Delimiter + StorageService.getPartitioner().getTokenFactory().toString(token)));
        load.put(bootstrapAddrs[2], 0d);
        InetAddress addr = BootStrapper.getBootstrapSource(ss.getTokenMetadata(), load);
        assert addr != null && addr.equals(addrs[2]);
    }
View Full Code Here

Examples of org.apache.cassandra.service.StorageService.onChange()

        InetAddress myEndpoint = InetAddress.getByName("127.0.0.1");
        Range range5 = ss.getPrimaryRangeForEndpoint(five);
        Token fakeToken = ((IPartitioner)StorageService.getPartitioner()).midpoint(range5.left, range5.right);
        assert range5.contains(fakeToken);
        ss.onChange(myEndpoint, StorageService.MOVE_STATE, new ApplicationState(StorageService.STATE_BOOTSTRAPPING + StorageService.Delimiter + ss.getPartitioner().getTokenFactory().toString(fakeToken)));
        tmd = ss.getTokenMetadata();

        InetAddress source4 = BootStrapper.getBootstrapSource(tmd, load);
        assert four.equals(source4) : four + " != " + source4;
    }
View Full Code Here

Examples of org.apache.cassandra.service.StorageService.onChange()

            assert !ss.getTokenMetadata().getBootstrapTokens().containsValue(bootstrapSource);
           
            Range range = ss.getPrimaryRangeForEndpoint(bootstrapSource);
            Token token = StorageService.getPartitioner().midpoint(range.left, range.right);
            assert range.contains(token);
            ss.onChange(bootstrapAddrs[i], ApplicationState.STATUS, StorageService.valueFactory.bootstrapping(token));
        }
       
        // any further attempt to bootsrtap should fail since every node in the cluster is splitting.
        try
        {
View Full Code Here

Examples of org.apache.cassandra.service.StorageService.onChange()

        }
       
        // indicate that one of the nodes is done. see if the node it was bootstrapping from is still available.
        Range range = ss.getPrimaryRangeForEndpoint(addrs[2]);
        Token token = StorageService.getPartitioner().midpoint(range.left, range.right);
        ss.onChange(bootstrapAddrs[2], ApplicationState.STATUS, StorageService.valueFactory.normal(token));
        load.put(bootstrapAddrs[2], 0d);
        InetAddress addr = BootStrapper.getBootstrapSource(ss.getTokenMetadata(), load);
        assert addr != null && addr.equals(addrs[2]);
    }
View Full Code Here

Examples of org.apache.cassandra.service.StorageService.onChange()

        InetAddress myEndpoint = InetAddress.getByName("127.0.0.1");
        Range range5 = ss.getPrimaryRangeForEndpoint(five);
        Token fakeToken = StorageService.getPartitioner().midpoint(range5.left, range5.right);
        assert range5.contains(fakeToken);
        ss.onChange(myEndpoint, ApplicationState.STATUS, StorageService.valueFactory.bootstrapping(fakeToken));
        tmd = ss.getTokenMetadata();

        InetAddress source4 = BootStrapper.getBootstrapSource(tmd, load);
        assert four.equals(source4) : four + " != " + source4;
    }
View Full Code Here

Examples of org.apache.cassandra.service.StorageService.onChange()

            assert !ss.getTokenMetadata().getBootstrapTokens().containsValue(bootstrapSource);
           
            Range range = ss.getPrimaryRangeForEndpoint(bootstrapSource);
            Token token = StorageService.getPartitioner().midpoint(range.left, range.right);
            assert range.contains(token);
            ss.onChange(bootstrapAddrs[i], ApplicationState.STATUS, StorageService.instance.valueFactory.bootstrapping(token));
        }
       
        // any further attempt to bootsrtap should fail since every node in the cluster is splitting.
        try
        {
View Full Code Here

Examples of org.apache.cassandra.service.StorageService.onChange()

        }
       
        // indicate that one of the nodes is done. see if the node it was bootstrapping from is still available.
        Range range = ss.getPrimaryRangeForEndpoint(addrs[2]);
        Token token = StorageService.getPartitioner().midpoint(range.left, range.right);
        ss.onChange(bootstrapAddrs[2], ApplicationState.STATUS, StorageService.instance.valueFactory.normal(token));
        load.put(bootstrapAddrs[2], 0d);
        InetAddress addr = BootStrapper.getBootstrapSource(ss.getTokenMetadata(), load);
        assert addr != null && addr.equals(addrs[2]);
    }
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.