Hi,

I had a look at this and can not figure out why -1 is returned.

When running the kernel in normal (write) mode the return value of
number of ids in use will only be correct if all previous shutdowns
have executed cleanly. This is an optimization to reduce the time
spent in recovery rebuilding id generators after a crash/non clean
shutdown.

After a crash/non clean shutdown the number of ids in use will always
be the highest id in use + 1. To force a full rebuild of the id
generators on each startup (on a non clean shutdown) pass in the
following configuration:

   rebuild_idgenerators_fast=false

In read only mode the return value will always be the highest id in use + 1.

You could try to delete the neostore.nodestore.db.id and pass in
"rebuild_idgenerators_fast=false" as configuration when starting up
(this will take a long time if the node store file is large). If you
still get incorrect results send me a compressed version of the
neostore.nodestore.db.id file and I will have a look at it.

Regards,
-Johan

On Tue, Apr 6, 2010 at 3:38 PM, Tobias Ivarsson
<tobias.ivars...@neotechnology.com> wrote:
> Sorry, we have not had time to look into that yet. I'll let you know when we
> have.
>
> On Mon, Apr 5, 2010 at 12:31 PM, Laurent Laborde <kerdez...@gmail.com>wrote:
>
>> Any news ?
>>
>> --
>> Ker2x
>>
>> On Fri, Mar 26, 2010 at 12:05 PM, Tobias Ivarsson
>> <tobias.ivars...@neotechnology.com> wrote:
>> > Ok, thanks. We'll look into it.
>> >
>> > On Fri, Mar 26, 2010 at 11:49 AM, Laurent Laborde <kerdez...@gmail.com
>> >wrote:
>> >
>> >> something between 100 millions and 1 billions, i guess.
>> >> the DB contain the result of my "collatz" code from 1 to 100 millions.
>> >>
>> >> --
>> >> Ker2x
>> >>
>> >> On Fri, Mar 26, 2010 at 11:40 AM, Tobias Ivarsson
>> >> <tobias.ivars...@neotechnology.com> wrote:
>> >> > If you have a large number of nodes it could be a truncation error
>> from
>> >> long
>> >> > to int somewhere, how many nodes to you estimate that you have?
>> >> >
>> >> > It is a bug so we will fix it, but if we know the approximate
>> estimated
>> >> size
>> >> > it would help in finding the cause.
>> >> >
>> >> > /Tobias
>> >> >
>> >> > On Fri, Mar 26, 2010 at 7:59 AM, Laurent Laborde <kerdez...@gmail.com
>> >> >wrote:
>> >> >
>> >> >> my code do a :
>> >> >> System.out.println("Number of nodes : " +
>> >> >>
>> >> >>
>> >>
>> neo.getConfig().getNeoModule().getNodeManager().getNumberOfIdsInUse(Node.class));
>> >> >>
>> >> >> it print :
>> >> >> Number of nodes : -1
>> >> >>
>> >> >> why does it print -1 ?
>> >> >> how can i count node ?
>> >> >>
>> >> >> thank you :)
>> >> >>
_______________________________________________
Neo mailing list
User@lists.neo4j.org
https://lists.neo4j.org/mailman/listinfo/user

Reply via email to