Examples of onChange()


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.instance.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

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

            Range<Token> range = ss.getPrimaryRangeForEndpoint(bootstrapSource);
            Token token = StorageService.getPartitioner().midpoint(range.left, range.right);
            assert range.contains(token);
            Gossiper.instance.injectApplicationState(bootstrapAddrs[i], ApplicationState.TOKENS, ss.valueFactory.tokens(Collections.singleton(token)));
            ss.onChange(bootstrapAddrs[i],
                        ApplicationState.STATUS,
                        StorageService.instance.valueFactory.bootstrapping(Collections.<Token>singleton(token)));
        }

        // any further attempt to bootsrtap should fail since every node in the cluster is splitting.
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<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.sling.api.servlets.HtmlResponse.onChange()

                    case MODIFY : htmlResponse.onModified(change.getSource()); break;
                    case DELETE : htmlResponse.onDeleted(change.getSource()); break;
                    case MOVE :   htmlResponse.onMoved(change.getSource(), change.getDestination()); break;
                    case COPY :   htmlResponse.onCopied(change.getSource(), change.getDestination()); break;
                    case CREATE : htmlResponse.onCreated(change.getSource()); break;
                    case ORDER : htmlResponse.onChange("ordered", change.getSource(), change.getDestination()); break;
                }
            }
           
            if (session.hasPendingChanges()) {
                session.save();
View Full Code Here

Examples of org.apache.sling.api.servlets.HtmlResponse.onChange()

                    case MODIFY : htmlResponse.onModified(change.getSource()); break;
                    case DELETE : htmlResponse.onDeleted(change.getSource()); break;
                    case MOVE :   htmlResponse.onMoved(change.getSource(), change.getDestination()); break;
                    case COPY :   htmlResponse.onCopied(change.getSource(), change.getDestination()); break;
                    case CREATE : htmlResponse.onCreated(change.getSource()); break;
                    case ORDER : htmlResponse.onChange("ordered", change.getSource(), change.getDestination()); break;
                }
            }
           
            if (session.hasPendingChanges()) {
                session.save();
View Full Code Here

Examples of org.apache.sling.servlets.post.AbstractPostResponse.onChange()

                        break;
                    case CREATE:
                        response.onCreated(change.getSource());
                        break;
                    case ORDER:
                        response.onChange("ordered", change.getSource(),
                            change.getDestination());
                        break;
                }
            }
View Full Code Here

Examples of org.apache.sling.servlets.post.AbstractPostResponse.onChange()

                    case MODIFY : response.onModified(change.getSource()); break;
                    case DELETE : response.onDeleted(change.getSource()); break;
                    case MOVE :   response.onMoved(change.getSource(), change.getDestination()); break;
                    case COPY :   response.onCopied(change.getSource(), change.getDestination()); break;
                    case CREATE : response.onCreated(change.getSource()); break;
                    case ORDER : response.onChange("ordered", change.getSource(), change.getDestination()); break;
        default:
          break;
                }
            }
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.