You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@jena.apache.org by Paolo Castagna <ca...@googlemail.com> on 2011/10/27 11:33:58 UTC

CmdIndexBuild.java: .sync() but not .close()... why?

Hi,
I have been using CmdIndexBuild.java a lot recently always without problems.
CmdIndexBuild uses BPlusTreeRewriter to build a BPlusTree.
By the way, great peace of code, very useful and fast: thanks Andy!.

CmdIndexBuild calls .sync() on the BPlusTree object, but not .close().

Should we call .close() just to be sure or .sync() it's fine?

(I am trying to nail down a sort of "intermittent" problem and I spotted
this while I was investigating possible causes).

I do not think this is a problem, but double checking and/or calling .close()
is not a bad idea.

Cheers,
Paolo

  [1] 
http://svn.apache.org/repos/asf/incubator/jena/Jena2/TDB/trunk/src/main/java/com/hp/hpl/jena/tdb/store/bulkloader2/CmdIndexBuild.java

Re: CmdIndexBuild.java: .sync() but not .close()... why?

Posted by Paolo Castagna <ca...@googlemail.com>.
Andy Seaborne wrote:
> On 27/10/11 10:33, Paolo Castagna wrote:
>> Hi,
>> I have been using CmdIndexBuild.java a lot recently always without
>> problems.
>> CmdIndexBuild uses BPlusTreeRewriter to build a BPlusTree.
>> By the way, great peace of code, very useful and fast: thanks Andy!.
>>
>> CmdIndexBuild calls .sync() on the BPlusTree object, but not .close().
>>
>> Should we call .close() just to be sure or .sync() it's fine?
>>
>> (I am trying to nail down a sort of "intermittent" problem and I spotted
>> this while I was investigating possible causes).
>>
>> I do not think this is a problem, but double checking and/or calling
>> .close()
>> is not a bad idea.
> 
> And does it change your intermittent problem or not?

As I said it wasn't probably that.

> 
>>
>> Cheers,
>> Paolo
>>
>> [1]
>> http://svn.apache.org/repos/asf/incubator/jena/Jena2/TDB/trunk/src/main/java/com/hp/hpl/jena/tdb/store/bulkloader2/CmdIndexBuild.java 
>>
>>
> 
> .sync does the important part (i.e. cache to disk if any).  Close is 
> only going to sort out intern
> 
> And the program exits immediately afterwards so file handles are closed 
> anyway.
> 
> (and the .sync prob isn't necessary because the block mgrs got sync'ed 
> anyway)

Ok.

Paolo

> 
>     Andy


Re: CmdIndexBuild.java: .sync() but not .close()... why?

Posted by Andy Seaborne <an...@apache.org>.
On 27/10/11 10:33, Paolo Castagna wrote:
> Hi,
> I have been using CmdIndexBuild.java a lot recently always without
> problems.
> CmdIndexBuild uses BPlusTreeRewriter to build a BPlusTree.
> By the way, great peace of code, very useful and fast: thanks Andy!.
>
> CmdIndexBuild calls .sync() on the BPlusTree object, but not .close().
>
> Should we call .close() just to be sure or .sync() it's fine?
>
> (I am trying to nail down a sort of "intermittent" problem and I spotted
> this while I was investigating possible causes).
>
> I do not think this is a problem, but double checking and/or calling
> .close()
> is not a bad idea.

And does it change your intermittent problem or not?

>
> Cheers,
> Paolo
>
> [1]
> http://svn.apache.org/repos/asf/incubator/jena/Jena2/TDB/trunk/src/main/java/com/hp/hpl/jena/tdb/store/bulkloader2/CmdIndexBuild.java
>

.sync does the important part (i.e. cache to disk if any).  Close is 
only going to sort out intern

And the program exits immediately afterwards so file handles are closed 
anyway.

(and the .sync prob isn't necessary because the block mgrs got sync'ed 
anyway)

	Andy