I think this code has had some changes since beta2.  Here is what it
looks like in trunk:

            if (DatabaseDescriptor.getNonSystemTables().size() > 0)
            {
                bootstrap(token);
                assert !isBootstrapMode; // bootstrap will block until finished
            }
            else
            {
                isBootstrapMode = false;
                SystemTable.setBootstrapped(true);
                tokenMetadata_.updateNormalToken(token,
FBUtilities.getLocalAddress());

Gossiper.instance.addLocalApplicationState(ApplicationState.STATUS,
valueFactory.normal(token));
                setMode("Normal", false);
            }

bootstrap means "stream over data from the other nodes that is
scheduled to become my responsibility."  so what the code you're
referring to is saying is, "if there are no keyspaces defined [in the
cluster we're joining, not yaml], just join the ring immediately."

On Tue, Oct 19, 2010 at 7:47 PM, Yang <teddyyyy...@gmail.com> wrote:
> from line 396 of StorageService.java from the 0.7.0-beta2 source, it
> looks that when I boot up a completely new node,
> if there is not any keyspace defined in its storage.yaml,  it would
> not even participate in the ring?
>
> in other words, let's say the cassandra instance currently has 10
> nodes, and hosts data for 4 keyspaces,  now the 11th node is added to
> the system,
> in order to shed load from the existing 10 nodes, I have to define a
> dummy keyspace for the new node to trigger the startBootstrap() code
> below?
>
>
> sorry for the newbie question, just starting out to dig into the code ....
>
> Thanks
> Yang
>
>
>            // don't bootstrap if there are no tables defined.
>            if (DatabaseDescriptor.getNonSystemTables().size() > 0)
>                startBootstrap(token);
>            else
>            {
>                isBootstrapMode = false;
>                SystemTable.setBootstrapped(true);
>                tokenMetadata_.updateNormalToken(token,
> FBUtilities.getLocalAddress());
>
> Gossiper.instance.addLocalApplicationState(ApplicationState.STATUS,
> valueFactory.normal(token));
>                setMode("Normal", false);
>            }
>



-- 
Jonathan Ellis
Project Chair, Apache Cassandra
co-founder of Riptano, the source for professional Cassandra support
http://riptano.com

Reply via email to