Author: toad
Date: 2008-09-26 18:39:46 +0000 (Fri, 26 Sep 2008)
New Revision: 22849
Modified:
branches/db4o/freenet/src/freenet/client/ArchiveHandlerImpl.java
branches/db4o/freenet/src/freenet/client/FECQueue.java
branches/db4o/freenet/src/freenet/client/async/BackgroundBlockEncoder.java
branches/db4o/freenet/src/freenet/client/async/BaseSingleFileFetcher.java
branches/db4o/freenet/src/freenet/client/async/ClientGetter.java
branches/db4o/freenet/src/freenet/client/async/ClientPutter.java
branches/db4o/freenet/src/freenet/client/async/ClientRequestScheduler.java
branches/db4o/freenet/src/freenet/client/async/ClientRequestSchedulerBase.java
branches/db4o/freenet/src/freenet/client/async/ClientRequestSchedulerCore.java
branches/db4o/freenet/src/freenet/client/async/ClientRequester.java
branches/db4o/freenet/src/freenet/client/async/DatastoreChecker.java
branches/db4o/freenet/src/freenet/client/async/InsertCompressor.java
branches/db4o/freenet/src/freenet/client/async/MultiPutCompletionCallback.java
branches/db4o/freenet/src/freenet/client/async/PersistentCooldownQueue.java
branches/db4o/freenet/src/freenet/client/async/PersistentSendableRequestSet.java
branches/db4o/freenet/src/freenet/client/async/SimpleManifestPutter.java
branches/db4o/freenet/src/freenet/client/async/SingleBlockInserter.java
branches/db4o/freenet/src/freenet/client/async/SingleFileFetcher.java
branches/db4o/freenet/src/freenet/client/async/SingleFileInserter.java
branches/db4o/freenet/src/freenet/client/async/SplitFileFetcher.java
branches/db4o/freenet/src/freenet/client/async/SplitFileFetcherSegment.java
branches/db4o/freenet/src/freenet/client/async/SplitFileFetcherSubSegment.java
branches/db4o/freenet/src/freenet/client/async/SplitFileInserter.java
branches/db4o/freenet/src/freenet/client/async/SplitFileInserterSegment.java
branches/db4o/freenet/src/freenet/client/async/USKFetcherTag.java
branches/db4o/freenet/src/freenet/node/NodeCrypto.java
branches/db4o/freenet/src/freenet/node/SendableRequest.java
branches/db4o/freenet/src/freenet/node/fcp/ClientGet.java
branches/db4o/freenet/src/freenet/node/fcp/ClientPut.java
branches/db4o/freenet/src/freenet/node/fcp/ClientPutBase.java
branches/db4o/freenet/src/freenet/node/fcp/ClientPutDir.java
branches/db4o/freenet/src/freenet/node/fcp/ClientRequest.java
branches/db4o/freenet/src/freenet/node/fcp/FCPConnectionHandler.java
branches/db4o/freenet/src/freenet/node/fcp/FCPPersistentRoot.java
branches/db4o/freenet/src/freenet/support/RandomGrabArray.java
branches/db4o/freenet/src/freenet/support/SectoredRandomGrabArray.java
branches/db4o/freenet/src/freenet/support/SimpleReadOnlyArrayBucket.java
branches/db4o/freenet/src/freenet/support/SortedVectorByNumber.java
branches/db4o/freenet/src/freenet/support/io/ArrayBucket.java
branches/db4o/freenet/src/freenet/support/io/BucketChainBucket.java
branches/db4o/freenet/src/freenet/support/io/DelayedFreeBucket.java
branches/db4o/freenet/src/freenet/support/io/FileBucket.java
branches/db4o/freenet/src/freenet/support/io/MultiReaderBucket.java
branches/db4o/freenet/src/freenet/support/io/NullBucket.java
branches/db4o/freenet/src/freenet/support/io/PaddedEphemerallyEncryptedBucket.java
branches/db4o/freenet/src/freenet/support/io/ReadOnlyFileSliceBucket.java
branches/db4o/freenet/src/freenet/support/io/TempBucketFactory.java
branches/db4o/freenet/src/freenet/support/io/TempFileBucket.java
Log:
container.set() -> container.store()
Modified: branches/db4o/freenet/src/freenet/client/ArchiveHandlerImpl.java
===================================================================
--- branches/db4o/freenet/src/freenet/client/ArchiveHandlerImpl.java
2008-09-26 18:24:36 UTC (rev 22848)
+++ branches/db4o/freenet/src/freenet/client/ArchiveHandlerImpl.java
2008-09-26 18:39:46 UTC (rev 22849)
@@ -93,7 +93,7 @@
assert(element != null); // no callback would be called...
final ArchiveManager manager = context.archiveManager;
final ArchiveExtractTag tag = new ArchiveExtractTag(this,
bucket, actx, element, callback, context.nodeDBHandle);
- container.set(tag);
+ container.store(tag);
runPersistentOffThread(tag, context, manager,
context.persistentBucketFactory);
}
Modified: branches/db4o/freenet/src/freenet/client/FECQueue.java
===================================================================
--- branches/db4o/freenet/src/freenet/client/FECQueue.java 2008-09-26
18:24:36 UTC (rev 22848)
+++ branches/db4o/freenet/src/freenet/client/FECQueue.java 2008-09-26
18:39:46 UTC (rev 22849)
@@ -60,7 +60,7 @@
return queue;
} else {
FECQueue queue = new FECQueue(nodeDBHandle);
- container.set(queue);
+ container.store(queue);
return queue;
}
}
@@ -99,7 +99,7 @@
int maxThreads = getMaxRunningFECThreads();
if(job.persistent) {
job.activateForExecution(container);
- container.set(job);
+ container.store(job);
}
synchronized(this) {
if(!job.persistent) {
Modified:
branches/db4o/freenet/src/freenet/client/async/BackgroundBlockEncoder.java
===================================================================
--- branches/db4o/freenet/src/freenet/client/async/BackgroundBlockEncoder.java
2008-09-26 18:24:36 UTC (rev 22848)
+++ branches/db4o/freenet/src/freenet/client/async/BackgroundBlockEncoder.java
2008-09-26 18:39:46 UTC (rev 22849)
@@ -79,7 +79,7 @@
private void queuePersistent(SingleBlockInserter sbi, ObjectContainer
container, ClientContext context) {
BackgroundBlockEncoderTag tag = new
BackgroundBlockEncoderTag(sbi, sbi.getPriorityClass(container), context);
- container.set(tag);
+ container.store(tag);
}
public void run() {
Modified:
branches/db4o/freenet/src/freenet/client/async/BaseSingleFileFetcher.java
===================================================================
--- branches/db4o/freenet/src/freenet/client/async/BaseSingleFileFetcher.java
2008-09-26 18:24:36 UTC (rev 22848)
+++ branches/db4o/freenet/src/freenet/client/async/BaseSingleFileFetcher.java
2008-09-26 18:39:46 UTC (rev 22849)
@@ -64,7 +64,7 @@
if(chosen) return null;
chosen = true;
if(persistent)
- container.set(this);
+ container.store(this);
return keys[0];
}
@@ -103,7 +103,7 @@
// We want 0, 1, ... maxRetries i.e. maxRetries+1 attempts
(maxRetries=0 => try once, no retries, maxRetries=1 = original try + 1 retry)
if((retryCount <= maxRetries) || (maxRetries == -1)) {
if(persistent)
- container.set(this);
+ container.store(this);
if(retryCount % RequestScheduler.COOLDOWN_RETRIES == 0)
{
// Add to cooldown queue. Don't reschedule yet.
long now = System.currentTimeMillis();
@@ -152,7 +152,7 @@
cancelled = true;
}
if(persistent) {
- container.set(this);
+ container.store(this);
container.activate(key, 5);
}
@@ -211,7 +211,7 @@
}
finished = true;
if(persistent)
- container.set(this);
+ container.store(this);
if(isCancelled(container)) return;
if(key == null)
throw new NullPointerException();
@@ -250,7 +250,7 @@
public synchronized void resetCooldownTimes(ObjectContainer container) {
cooldownWakeupTime = -1;
if(persistent)
- container.set(this);
+ container.store(this);
}
@Override
Modified: branches/db4o/freenet/src/freenet/client/async/ClientGetter.java
===================================================================
--- branches/db4o/freenet/src/freenet/client/async/ClientGetter.java
2008-09-26 18:24:36 UTC (rev 22848)
+++ branches/db4o/freenet/src/freenet/client/async/ClientGetter.java
2008-09-26 18:39:46 UTC (rev 22849)
@@ -104,7 +104,7 @@
if(cancelled) cancel();
// schedule() may deactivate stuff, so store it now.
if(persistent())
- container.set(currentState);
+ container.store(currentState);
if(currentState != null && !finished) {
if(binaryBlobBucket != null) {
try {
@@ -113,7 +113,7 @@
} catch (IOException e) {
onFailure(new
FetchException(FetchException.BUCKET_ERROR, "Failed to open binary blob
bucket", e), null, container, context);
if(persistent())
- container.set(this);
+ container.store(this);
return false;
}
}
@@ -126,7 +126,7 @@
onFailure(e.getFetchException(), currentState,
container, context);
}
if(persistent()) {
- container.set(this);
+ container.store(this);
container.deactivate(currentState, 1);
}
return true;
@@ -170,7 +170,7 @@
}
FetchResult res = result;
if(persistent())
- container.set(this);
+ container.store(this);
clientCallback.onSuccess(res, ClientGetter.this, container);
}
@@ -210,7 +210,7 @@
Logger.minor(this, "onFailure("+e+", "+state+") on
"+this+" for "+uri, e);
final FetchException e1 = e;
if(persistent())
- container.set(this);
+ container.store(this);
clientCallback.onFailure(e1, ClientGetter.this,
container);
return;
}
@@ -225,7 +225,7 @@
s = currentState;
}
if(persistent())
- container.set(this);
+ container.store(this);
if(s != null) {
if(logMINOR) Logger.minor(this, "Cancelling
"+currentState);
if(persistent())
@@ -270,7 +270,7 @@
Logger.minor(this, "Ignoring transition:
"+oldState+" -> "+newState+" because current = "+currentState);
}
if(persistent())
- container.set(this);
+ container.store(this);
}
public boolean canRestart() {
@@ -362,20 +362,20 @@
if(finalizedMetadata) return;
expectedMIME = mime;
if(persistent())
- container.set(this);
+ container.store(this);
}
public void onExpectedSize(long size, ObjectContainer container) {
if(finalizedMetadata) return;
expectedSize = size;
if(persistent())
- container.set(this);
+ container.store(this);
}
public void onFinalizedMetadata(ObjectContainer container) {
finalizedMetadata = true;
if(persistent())
- container.set(this);
+ container.store(this);
}
public boolean finalizedMetadata() {
Modified: branches/db4o/freenet/src/freenet/client/async/ClientPutter.java
===================================================================
--- branches/db4o/freenet/src/freenet/client/async/ClientPutter.java
2008-09-26 18:24:36 UTC (rev 22848)
+++ branches/db4o/freenet/src/freenet/client/async/ClientPutter.java
2008-09-26 18:39:46 UTC (rev 22849)
@@ -120,7 +120,7 @@
onFailure(new
InsertException(InsertException.CANCELLED), null, container, context);
oldProgress = null;
if(persistent())
- container.set(this);
+ container.store(this);
return false;
}
if(Logger.shouldLog(Logger.MINOR, this))
@@ -134,7 +134,7 @@
cancel = cancelled;
}
if(persistent()) {
- container.set(this);
+ container.store(this);
// It has scheduled, we can safely deactivate
it now, so it won't hang around in memory.
container.deactivate(currentState, 1);
}
@@ -150,7 +150,7 @@
currentState = null;
}
if(persistent())
- container.set(this);
+ container.store(this);
// notify the client that the insert could not even be
started
if (this.client!=null) {
this.client.onFailure(e, this, container);
@@ -163,7 +163,7 @@
currentState = null;
}
if(persistent())
- container.set(this);
+ container.store(this);
// notify the client that the insert could not even be
started
if (this.client!=null) {
this.client.onFailure(new
InsertException(InsertException.BUCKET_ERROR, e, null), this, container);
@@ -176,7 +176,7 @@
currentState = null;
}
if(persistent())
- container.set(this);
+ container.store(this);
// notify the client that the insert could not even be
started
if (this.client!=null) {
this.client.onFailure(new
InsertException(InsertException.BINARY_BLOB_FORMAT_ERROR, e, null), this,
container);
@@ -201,7 +201,7 @@
new Exception("debug"));
}
if(persistent())
- container.set(this);
+ container.store(this);
client.onSuccess(this, container);
}
@@ -214,7 +214,7 @@
oldProgress = null;
}
if(persistent())
- container.set(this);
+ container.store(this);
client.onFailure(e, this, container);
}
@@ -234,7 +234,7 @@
uri = uri.pushMetaString(targetFilename);
}
if(persistent())
- container.set(this);
+ container.store(this);
client.onGeneratedURI(uri, this, container);
}
@@ -251,7 +251,7 @@
startedStarting = true;
}
if(persistent()) {
- container.set(this);
+ container.store(this);
if(oldState != null)
container.activate(oldState, 1);
}
@@ -274,7 +274,7 @@
if(currentState == oldState) {
currentState = newState;
if(persistent())
- container.set(this);
+ container.store(this);
} else
Logger.error(this, "onTransition: cur="+currentState+",
old="+oldState+", new="+newState, new Exception("debug"));
}
Modified:
branches/db4o/freenet/src/freenet/client/async/ClientRequestScheduler.java
===================================================================
--- branches/db4o/freenet/src/freenet/client/async/ClientRequestScheduler.java
2008-09-26 18:24:36 UTC (rev 22848)
+++ branches/db4o/freenet/src/freenet/client/async/ClientRequestScheduler.java
2008-09-26 18:39:46 UTC (rev 22849)
@@ -173,7 +173,7 @@
if(!queueFull)
bootID = this.node.bootID;
final RegisterMe regme = new
RegisterMe(req, req.getPriorityClass(container), schedCore, null, bootID);
- container.set(regme);
+ container.store(regme);
if(logMINOR)
Logger.minor(this, "Added
insert RegisterMe: "+regme);
if(!queueFull) {
@@ -296,7 +296,7 @@
if(hasListener != null) {
listener = hasListener.makeKeyListener(container,
clientContext);
schedCore.addPendingKeys(listener);
- container.set(hasListener);
+ container.store(hasListener);
} else
listener = null;
@@ -304,7 +304,7 @@
if(getters != null) {
for(SendableGet getter : getters) {
container.activate(getter, 1);
- container.set(getter);
+ container.store(getter);
}
}
Modified:
branches/db4o/freenet/src/freenet/client/async/ClientRequestSchedulerBase.java
===================================================================
---
branches/db4o/freenet/src/freenet/client/async/ClientRequestSchedulerBase.java
2008-09-26 18:24:36 UTC (rev 22848)
+++
branches/db4o/freenet/src/freenet/client/async/ClientRequestSchedulerBase.java
2008-09-26 18:39:46 UTC (rev 22849)
@@ -120,7 +120,7 @@
prio = new SortedVectorByNumber(persistent());
priorities[priorityClass] = prio;
if(persistent())
- container.set(this);
+ container.store(this);
}
// Client
SectoredRandomGrabArrayWithInt clientGrabber =
(SectoredRandomGrabArrayWithInt) prio.get(rc, container);
Modified:
branches/db4o/freenet/src/freenet/client/async/ClientRequestSchedulerCore.java
===================================================================
---
branches/db4o/freenet/src/freenet/client/async/ClientRequestSchedulerCore.java
2008-09-26 18:24:36 UTC (rev 22848)
+++
branches/db4o/freenet/src/freenet/client/async/ClientRequestSchedulerCore.java
2008-09-26 18:39:46 UTC (rev 22849)
@@ -85,7 +85,7 @@
if(core.isSSKScheduler != forSSKs) throw new
IllegalStateException("Wrong forSSKs");
} else {
core = new ClientRequestSchedulerCore(node, forInserts,
forSSKs, selectorContainer, cooldownTime);
- selectorContainer.set(core);
+ selectorContainer.store(core);
System.err.println("Created new core...");
}
logMINOR = Logger.shouldLog(Logger.MINOR,
ClientRequestSchedulerCore.class);
Modified: branches/db4o/freenet/src/freenet/client/async/ClientRequester.java
===================================================================
--- branches/db4o/freenet/src/freenet/client/async/ClientRequester.java
2008-09-26 18:24:36 UTC (rev 22848)
+++ branches/db4o/freenet/src/freenet/client/async/ClientRequester.java
2008-09-26 18:39:46 UTC (rev 22849)
@@ -82,7 +82,7 @@
if(Logger.shouldLog(Logger.MINOR, this))
Logger.minor(this, "Finalized set of blocks for "+this,
new Exception("debug"));
if(persistent())
- container.set(this);
+ container.store(this);
notifyClients(container, context);
}
@@ -94,7 +94,7 @@
Logger.error(this, "addBlock() but set
finalized! on "+this, new Exception("error"));
totalBlocks++;
if(Logger.shouldLog(Logger.MINOR, this)) Logger.minor(this,
"addBlock(): total="+totalBlocks+" successful="+successfulBlocks+"
failed="+failedBlocks+" required="+minSuccessBlocks);
- if(persistent()) container.set(this);
+ if(persistent()) container.store(this);
}
public synchronized void addBlocks(int num, ObjectContainer container) {
@@ -105,7 +105,7 @@
Logger.error(this, "addBlocks() but set
finalized! on "+this, new Exception("error"));
totalBlocks+=num;
if(Logger.shouldLog(Logger.MINOR, this)) Logger.minor(this,
"addBlocks("+num+"): total="+totalBlocks+" successful="+successfulBlocks+"
failed="+failedBlocks+" required="+minSuccessBlocks);
- if(persistent()) container.set(this);
+ if(persistent()) container.store(this);
}
public void completedBlock(boolean dontNotify, ObjectContainer
container, ClientContext context) {
@@ -115,7 +115,7 @@
if(cancelled) return;
successfulBlocks++;
}
- if(persistent()) container.set(this);
+ if(persistent()) container.store(this);
if(dontNotify) return;
notifyClients(container, context);
}
@@ -124,7 +124,7 @@
synchronized(this) {
failedBlocks++;
}
- if(persistent()) container.set(this);
+ if(persistent()) container.store(this);
notifyClients(container, context);
}
@@ -132,13 +132,13 @@
synchronized(this) {
fatallyFailedBlocks++;
}
- if(persistent()) container.set(this);
+ if(persistent()) container.store(this);
notifyClients(container, context);
}
public synchronized void addMustSucceedBlocks(int blocks,
ObjectContainer container) {
minSuccessBlocks += blocks;
- if(persistent()) container.set(this);
+ if(persistent()) container.store(this);
if(Logger.shouldLog(Logger.MINOR, this)) Logger.minor(this,
"addMustSucceedBlocks("+blocks+"): total="+totalBlocks+"
successful="+successfulBlocks+" failed="+failedBlocks+"
required="+minSuccessBlocks);
}
@@ -155,7 +155,7 @@
ctx.getChkInsertScheduler().reregisterAll(this, container);
ctx.getSskFetchScheduler().reregisterAll(this, container);
ctx.getSskInsertScheduler().reregisterAll(this, container);
- if(persistent()) container.set(this);
+ if(persistent()) container.store(this);
}
public boolean persistent() {
Modified: branches/db4o/freenet/src/freenet/client/async/DatastoreChecker.java
===================================================================
--- branches/db4o/freenet/src/freenet/client/async/DatastoreChecker.java
2008-09-26 18:24:36 UTC (rev 22848)
+++ branches/db4o/freenet/src/freenet/client/async/DatastoreChecker.java
2008-09-26 18:39:46 UTC (rev 22849)
@@ -123,7 +123,7 @@
Key[] keys = getter.listKeys(container);
// FIXME check the store bloom filter using
store.probablyInStore().
item.chosenBy = context.bootID;
- container.set(item);
+ container.store(item);
synchronized(this) {
if(persistentGetters[prio].contains(getter)) continue;
ArrayList<Key> finalKeysToCheck = new
ArrayList<Key>();
@@ -176,7 +176,7 @@
persistentKeys[i].remove(idx);
persistentBlockSets[i].remove(idx);
item.chosenBy = 0;
- container.set(item);
+ container.store(item);
}
}
return true;
@@ -199,7 +199,7 @@
Key[] keys =
persistentKeys[i].remove(idx);
persistentBlockSets[i].remove(idx);
item.chosenBy = 0;
- container.set(item);
+ container.store(item);
if(postQueueSize + preQueueSize
- keys.length < MAX_PERSISTENT_KEYS) {
return false;
}
@@ -240,7 +240,7 @@
boolean dontCache = getter.dontCache();
ClientRequestScheduler sched = getter.getScheduler(context);
DatastoreCheckerItem item = new DatastoreCheckerItem(getter,
context.nodeDBHandle, prio, blocks);
- container.set(item);
+ container.store(item);
container.activate(blocks, 5);
synchronized(this) {
// FIXME only add if queue not full.
@@ -253,7 +253,7 @@
}
if(queueSize > MAX_PERSISTENT_KEYS) return;
item.chosenBy = context.bootID;
- container.set(item);
+ container.store(item);
// FIXME check using store.probablyInStore
ArrayList<Key> finalKeysToCheck = new ArrayList<Key>();
for(Key key : checkKeys) {
Modified: branches/db4o/freenet/src/freenet/client/async/InsertCompressor.java
===================================================================
--- branches/db4o/freenet/src/freenet/client/async/InsertCompressor.java
2008-09-26 18:24:36 UTC (rev 22848)
+++ branches/db4o/freenet/src/freenet/client/async/InsertCompressor.java
2008-09-26 18:39:46 UTC (rev 22849)
@@ -230,7 +230,7 @@
Bucket origData, int minSize, BucketFactory bf, boolean
persistent) {
InsertCompressor compressor = new
InsertCompressor(context.nodeDBHandle, inserter, origData, minSize, bf,
persistent);
if(persistent)
- container.set(compressor);
+ container.store(compressor);
compressor.init(container, context);
return compressor;
}
Modified:
branches/db4o/freenet/src/freenet/client/async/MultiPutCompletionCallback.java
===================================================================
---
branches/db4o/freenet/src/freenet/client/async/MultiPutCompletionCallback.java
2008-09-26 18:24:36 UTC (rev 22848)
+++
branches/db4o/freenet/src/freenet/client/async/MultiPutCompletionCallback.java
2008-09-26 18:39:46 UTC (rev 22849)
@@ -69,9 +69,9 @@
}
}
if(persistent) {
- container.set(waitingFor);
- container.set(waitingForBlockSet);
- container.set(waitingForFetchable);
+ container.store(waitingFor);
+ container.store(waitingForBlockSet);
+ container.store(waitingForFetchable);
}
complete(e, container, context);
}
@@ -87,7 +87,7 @@
if(e == null) e = this.e;
}
if(persistent) {
- container.set(this);
+ container.store(this);
container.activate(cb, 1);
}
if(e != null)
@@ -100,7 +100,7 @@
add(ps, container);
generator = ps;
if(persistent)
- container.set(this);
+ container.store(this);
}
public synchronized void add(ClientPutState ps, ObjectContainer
container) {
@@ -109,9 +109,9 @@
waitingForBlockSet.add(ps);
waitingForFetchable.add(ps);
if(persistent) {
- container.set(waitingFor);
- container.set(waitingForBlockSet);
- container.set(waitingForFetchable);
+ container.store(waitingFor);
+ container.store(waitingForBlockSet);
+ container.store(waitingForFetchable);
}
}
@@ -124,7 +124,7 @@
allGotBlocks = waitingForBlockSet.isEmpty();
}
if(persistent) {
- container.set(this);
+ container.store(this);
container.activate(cb, 1);
}
if(allGotBlocks) {
@@ -167,19 +167,19 @@
for(int i=0;i<waitingFor.size();i++) {
if(waitingFor.get(i) == oldState) {
waitingFor.set(i, newState);
- container.set(waitingFor);
+ container.store(waitingFor);
}
}
for(int i=0;i<waitingFor.size();i++) {
if(waitingForBlockSet.get(i) == oldState) {
waitingForBlockSet.set(i, newState);
- container.set(waitingFor);
+ container.store(waitingFor);
}
}
for(int i=0;i<waitingFor.size();i++) {
if(waitingForFetchable.get(i) == oldState) {
waitingForFetchable.set(i, newState);
- container.set(waitingFor);
+ container.store(waitingFor);
}
}
}
@@ -198,7 +198,7 @@
synchronized(this) {
this.waitingForBlockSet.remove(state);
if(persistent)
- container.set(waitingForBlockSet);
+ container.store(waitingForBlockSet);
if(!started) return;
if(!waitingForBlockSet.isEmpty()) return;
}
@@ -223,7 +223,7 @@
synchronized(this) {
this.waitingForFetchable.remove(state);
if(persistent)
- container.set(waitingForFetchable);
+ container.store(waitingForFetchable);
if(!started) return;
if(!waitingForFetchable.isEmpty()) return;
}
Modified:
branches/db4o/freenet/src/freenet/client/async/PersistentCooldownQueue.java
===================================================================
--- branches/db4o/freenet/src/freenet/client/async/PersistentCooldownQueue.java
2008-09-26 18:24:36 UTC (rev 22848)
+++ branches/db4o/freenet/src/freenet/client/async/PersistentCooldownQueue.java
2008-09-26 18:39:46 UTC (rev 22849)
@@ -36,7 +36,7 @@
assert(cooldownTime != 0);
long removeTime = System.currentTimeMillis() + cooldownTime;
PersistentCooldownQueueItem persistentCooldownQueueItem = new
PersistentCooldownQueueItem(client, key, removeTime, this);
- container.set(persistentCooldownQueueItem);
+ container.store(persistentCooldownQueueItem);
return removeTime;
}
Modified:
branches/db4o/freenet/src/freenet/client/async/PersistentSendableRequestSet.java
===================================================================
---
branches/db4o/freenet/src/freenet/client/async/PersistentSendableRequestSet.java
2008-09-26 18:24:36 UTC (rev 22848)
+++
branches/db4o/freenet/src/freenet/client/async/PersistentSendableRequestSet.java
2008-09-26 18:39:46 UTC (rev 22849)
@@ -29,7 +29,7 @@
int idx = find(req);
if(idx == -1) {
list.add(req);
- container.set(list);
+ container.store(list);
return true;
} else return false;
}
@@ -50,7 +50,7 @@
int idx = find(req);
if(idx == -1) return false;
list.remove(idx);
- container.set(list);
+ container.store(list);
return true;
}
Modified:
branches/db4o/freenet/src/freenet/client/async/SimpleManifestPutter.java
===================================================================
--- branches/db4o/freenet/src/freenet/client/async/SimpleManifestPutter.java
2008-09-26 18:24:36 UTC (rev 22848)
+++ branches/db4o/freenet/src/freenet/client/async/SimpleManifestPutter.java
2008-09-26 18:39:46 UTC (rev 22849)
@@ -87,7 +87,7 @@
origSFI.start(null, container, context);
origSFI = null;
if(persistent)
- container.set(this);
+ container.store(this);
}
public void cancel(ObjectContainer container, ClientContext
context) {
@@ -119,7 +119,7 @@
}
}
if(persistent)
- container.set(runningPutHandlers);
+ container.store(runningPutHandlers);
insertedAllFiles(container);
}
@@ -165,8 +165,8 @@
if(!putHandlersWaitingForMetadata.isEmpty())
return;
}
if(persistent) {
- container.set(putHandlersWaitingForMetadata);
- container.set(this);
+ container.store(putHandlersWaitingForMetadata);
+ container.store(this);
container.activate(SimpleManifestPutter.this,
1);
}
gotAllMetadata(container, context);
@@ -229,7 +229,7 @@
if(!waitingForBlockSets.isEmpty()) return;
}
if(persistent)
- container.set(waitingForBlockSets);
+ container.store(waitingForBlockSets);
SimpleManifestPutter.this.blockSetFinalized(container,
context);
}
@@ -338,7 +338,8 @@
if (running.length == 0) {
insertedAllFiles = true;
if(persistent())
- container.set(this);
+ container.store(this);
+ container.store(this);
gotAllMetadata(container, context);
}
} catch (InsertException e) {
@@ -439,7 +440,7 @@
baseMetadata =
Metadata.mkRedirectionManifestWithMetadata(namesToByteArrays);
if(persistent()) {
- container.set(baseMetadata);
+ container.store(baseMetadata);
}
resolveAndStartBase(container, context);
@@ -546,8 +547,10 @@
metadataPuttersUnfetchable.put(baseMetadata,
metadataInserter);
metadataInserter.start(null, container, context);
if(persistent()) {
- container.set(metadataPuttersByMetadata);
- container.set(metadataPuttersUnfetchable);
+ container.store(metadataPuttersByMetadata);
+ container.store(metadataPuttersByMetadata);
+ container.store(metadataPuttersUnfetchable);
+ container.store(metadataPuttersUnfetchable);
}
} catch (InsertException e) {
fail(e, container);
@@ -582,7 +585,7 @@
}
}
if(persistent())
- container.set(metadataPuttersByMetadata);
+ container.store(metadataPuttersByMetadata);
return mustWait;
}
@@ -619,7 +622,7 @@
finished = true;
}
if(persistent())
- container.set(this);
+ container.store(this);
complete(container);
}
@@ -651,7 +654,7 @@
finished = true;
}
if(persistent())
- container.set(this);
+ container.store(this);
for(int i=0;i<running.length;i++) {
running[i].cancel();
@@ -662,7 +665,7 @@
public void cancel(ObjectContainer container, ClientContext context) {
super.cancel();
if(persistent())
- container.set(this);
+ container.store(this);
fail(new InsertException(InsertException.CANCELLED), container);
}
@@ -690,8 +693,8 @@
finished = true;
}
if(persistent()) {
- container.set(metadataPuttersByMetadata);
- container.set(this);
+ container.store(metadataPuttersByMetadata);
+ container.store(this);
}
complete(container);
}
@@ -709,7 +712,7 @@
container.activate(cb, 1);
cb.onGeneratedURI(finalURI, this, container);
if(persistent())
- container.set(this);
+ container.store(this);
} else {
// It's a sub-Metadata
Metadata m = (Metadata) state.getToken();
@@ -745,7 +748,7 @@
}
this.blockSetFinalized(container, context);
if(persistent())
- container.set(this);
+ container.store(this);
}
@Override
@@ -756,7 +759,7 @@
}
super.blockSetFinalized(container, context);
if(persistent())
- container.set(this);
+ container.store(this);
}
/**
@@ -867,8 +870,8 @@
fetchable = true;
}
if(persistent()) {
- container.set(putHandlersWaitingForMetadata);
- container.set(this);
+ container.store(putHandlersWaitingForMetadata);
+ container.store(this);
}
cb.onFetchable(this, container);
}
@@ -889,8 +892,8 @@
fetchable = true;
}
if(persistent()) {
- container.set(metadataPuttersUnfetchable);
- container.set(this);
+ container.store(metadataPuttersUnfetchable);
+ container.store(this);
}
cb.onFetchable(this, container);
}
Modified:
branches/db4o/freenet/src/freenet/client/async/SingleBlockInserter.java
===================================================================
--- branches/db4o/freenet/src/freenet/client/async/SingleBlockInserter.java
2008-09-26 18:24:36 UTC (rev 22848)
+++ branches/db4o/freenet/src/freenet/client/async/SingleBlockInserter.java
2008-09-26 18:39:46 UTC (rev 22849)
@@ -139,7 +139,8 @@
if(shouldSend && !dontSendEncoded)
cb.onEncode(block.getClientKey(), this, container,
context);
if(shouldSend && persistent)
- container.set(this);
+ container.store(this);
+ container.store(this);
if(persistent && !calledByCB)
container.deactivate(cb, 1);
return block;
@@ -201,7 +202,8 @@
return;
}
if(persistent)
- container.set(this);
+ container.store(this);
+ container.store(this);
getScheduler(context).registerInsert(this, persistent, false,
true, container);
}
@@ -215,7 +217,8 @@
finished = true;
}
if(persistent)
- container.set(this);
+ container.store(this);
+ container.store(this);
if(e.isFatal() || forceFatal)
parent.fatallyFailedBlock(container, context);
else
@@ -231,7 +234,8 @@
if(finished) return null;
}
if(persistent)
- container.set(this);
+ container.store(this);
+ container.store(this);
return encode(container, context, calledByCB);
} catch (InsertException e) {
if(persistent)
@@ -268,7 +272,8 @@
cb.onSuccess(this, container, context);
finished = true;
if(persistent)
- container.set(this);
+ container.store(this);
+ container.store(this);
} else {
getScheduler(context).registerInsert(this, persistent,
true, true, container);
}
@@ -313,7 +318,8 @@
}
if(persistent) {
container.activate(cb, 1);
- container.set(this);
+ container.store(this);
+ container.store(this);
}
parent.completedBlock(false, container, context);
cb.onSuccess(this, container, context);
@@ -329,7 +335,8 @@
finished = true;
}
if(persistent) {
- container.set(this);
+ container.store(this);
+ container.store(this);
container.activate(cb, 1);
}
super.unregister(container, context);
Modified: branches/db4o/freenet/src/freenet/client/async/SingleFileFetcher.java
===================================================================
--- branches/db4o/freenet/src/freenet/client/async/SingleFileFetcher.java
2008-09-26 18:24:36 UTC (rev 22848)
+++ branches/db4o/freenet/src/freenet/client/async/SingleFileFetcher.java
2008-09-26 18:39:46 UTC (rev 22849)
@@ -171,7 +171,8 @@
try {
metadata = Metadata.construct(data);
if(persistent)
- container.set(this);
+ container.store(this);
+ container.store(this);
} catch (MetadataParseException e) {
onFailure(new FetchException(e), false,
container, context);
return;
@@ -219,8 +220,10 @@
}
result = new FetchResult(result, data);
if(persistent) {
- container.set(this);
- container.set(decompressors);
+ container.store(this);
+ container.store(this);
+ container.store(decompressors);
+ container.store(decompressors);
}
}
if((!ctx.ignoreTooManyPathComponents) &&
(!metaStrings.isEmpty()) && isFinal) {
@@ -288,8 +291,10 @@
if(name == null) {
metadata =
metadata.getDefaultDocument();
if(persistent) {
- container.set(this);
- container.set(metaStrings);
+ container.store(this);
+ container.store(this);
+ container.store(metaStrings);
+ container.store(metaStrings);
}
if(metadata == null)
throw new
FetchException(FetchException.NOT_ENOUGH_PATH_COMPONENTS, -1, false, null,
uri.addMetaStrings(new String[] { "" }));
@@ -297,9 +302,12 @@
metadata = metadata.getDocument(name);
thisKey = thisKey.pushMetaString(name);
if(persistent) {
- container.set(this);
- container.set(metaStrings);
- container.set(thisKey);
+ container.store(this);
+ container.store(this);
+ container.store(metaStrings);
+ container.store(metaStrings);
+ container.store(thisKey);
+ container.store(thisKey);
}
if(metadata == null)
throw new
FetchException(FetchException.NOT_IN_ARCHIVE);
@@ -310,7 +318,8 @@
if(metaStrings.isEmpty() &&
ctx.returnZIPManifests) {
// Just return the archive, whole.
metadata.setSimpleRedirect();
- if(persistent) container.set(metadata);
+ if(persistent)
container.store(metadata);
+ if(persistent)
container.store(metadata);
continue;
}
// First we need the archive metadata.
@@ -331,7 +340,8 @@
// Bucket error?
throw new
FetchException(FetchException.BUCKET_ERROR, e);
}
- if(persistent) container.set(this);
+ if(persistent) container.store(this);
+ if(persistent) container.store(this);
} else {
final boolean persistent =
this.persistent;
fetchArchive(false, archiveMetadata,
ArchiveManager.METADATA_NAME, new ArchiveExtractCallback() {
@@ -375,14 +385,16 @@
container.deactivate(SingleFileFetcher.this, 1);
}
}, container, context); // will result
in this function being called again
- if(persistent) container.set(this);
+ if(persistent) container.store(this);
+ if(persistent) container.store(this);
return;
}
continue;
} else if(metadata.isArchiveInternalRedirect()) {
if(logMINOR) Logger.minor(this, "Is
archive-internal redirect");
clientMetadata.mergeNoOverwrite(metadata.getClientMetadata());
- if(persistent) container.set(clientMetadata);
+ if(persistent) container.store(clientMetadata);
+ if(persistent) container.store(clientMetadata);
String mime = clientMetadata.getMIMEType();
if(mime != null) rcb.onExpectedMIME(mime,
container);
if(metaStrings.isEmpty() && isFinal &&
clientMetadata.getMIMETypeNoParams() != null && ctx.allowedMIMETypes != null &&
@@ -478,15 +490,18 @@
final SingleFileFetcher f = new
SingleFileFetcher(this, metadata, new MultiLevelMetadataCallback(), ctx,
container, context);
// Clear our own metadata so it can be garbage
collected, it will be replaced by whatever is fetched.
this.metadata = null;
- if(persistent) container.set(this);
- if(persistent) container.set(f);
+ if(persistent) container.store(this);
+ if(persistent) container.store(this);
+ if(persistent) container.store(f);
+ if(persistent) container.store(f);
f.wrapHandleMetadata(true, container, context);
if(persistent) container.deactivate(f, 1);
return;
} else if(metadata.isSingleFileRedirect()) {
if(logMINOR) Logger.minor(this, "Is single-file
redirect");
clientMetadata.mergeNoOverwrite(metadata.getClientMetadata()); // even
splitfiles can have mime types!
- if(persistent) container.set(clientMetadata);
+ if(persistent) container.store(clientMetadata);
+ if(persistent) container.store(clientMetadata);
String mime = clientMetadata.getMIMEType();
if(mime != null) rcb.onExpectedMIME(mime,
container);
@@ -494,10 +509,12 @@
if(mimeType != null &&
ArchiveManager.isUsableArchiveType(mimeType) && metaStrings.size() > 0) {
// Looks like an implicit archive,
handle as such
metadata.setArchiveManifest();
- if(persistent) container.set(metadata);
+ if(persistent)
container.store(metadata);
+ if(persistent)
container.store(metadata);
// Pick up MIME type from inside archive
clientMetadata.clear();
- if(persistent)
container.set(clientMetadata);
+ if(persistent)
container.store(clientMetadata);
+ if(persistent)
container.store(clientMetadata);
if(logMINOR) Logger.minor(this,
"Handling implicit container... (redirect)");
continue;
}
@@ -544,9 +561,12 @@
}
parent.onTransition(this, f, container);
if(persistent) {
- container.set(metaStrings);
- container.set(f); // Store *before*
scheduling to avoid activation problems.
- container.set(this);
+ container.store(metaStrings);
+ container.store(metaStrings);
+ container.store(f); // Store *before*
scheduling to avoid activation problems.
+ container.store(f); // Store *before*
scheduling to avoid activation problems.
+ container.store(this);
+ container.store(this);
}
f.schedule(container, context);
// All done! No longer our problem!
@@ -556,7 +576,8 @@
if(logMINOR) Logger.minor(this, "Fetching
splitfile");
clientMetadata.mergeNoOverwrite(metadata.getClientMetadata()); // even
splitfiles can have mime types!
- if(persistent) container.set(clientMetadata);
+ if(persistent) container.store(clientMetadata);
+ if(persistent) container.store(clientMetadata);
String mime = clientMetadata.getMIMEType();
if(mime != null) rcb.onExpectedMIME(mime,
container);
@@ -567,8 +588,10 @@
// Pick up MIME type from inside archive
clientMetadata.clear();
if(persistent) {
- container.set(metadata);
- container.set(clientMetadata);
+ container.store(metadata);
+ container.store(metadata);
+ container.store(clientMetadata);
+ container.store(clientMetadata);
}
if(logMINOR) Logger.minor(this,
"Handling implicit container... (splitfile)");
continue;
@@ -588,7 +611,8 @@
Compressor codec =
Compressor.getCompressionAlgorithmByMetadataID(metadata.getCompressionCodec());
addDecompressor(codec);
if(persistent)
- container.set(decompressors);
+ container.store(decompressors);
+ container.store(decompressors);
}
if(isFinal && !ctx.ignoreTooManyPathComponents)
{
@@ -629,7 +653,8 @@
SplitFileFetcher sf = new
SplitFileFetcher(metadata, rcb, parent, ctx,
decompressors, clientMetadata,
actx, recursionLevel, returnBucket, token, container, context);
if(persistent)
- container.set(sf); // Avoid problems
caused by storing a deactivated sf
+ container.store(sf); // Avoid problems
caused by storing a deactivated sf
+ container.store(sf); // Avoid problems
caused by storing a deactivated sf
parent.onTransition(this, sf, container);
try {
sf.schedule(container, context);
@@ -647,7 +672,8 @@
// SplitFile will now run.
// Then it will return data to rcd.
// We are now out of the loop. Yay!
- if(persistent) container.set(this);
+ if(persistent) container.store(this);
+ if(persistent) container.store(this);
return;
} else {
Logger.error(this, "Don't know what to do with
metadata: "+metadata);
@@ -680,7 +706,8 @@
newMeta.setSimpleRedirect();
final SingleFileFetcher f;
f = new SingleFileFetcher(this, newMeta, new
ArchiveFetcherCallback(forData, element, callback), new FetchContext(ctx,
FetchContext.SET_RETURN_ARCHIVES, true), container, context);
- if(persistent) container.set(f);
+ if(persistent) container.store(f);
+ if(persistent) container.store(f);
if(logMINOR) Logger.minor(this, "fetchArchive(): "+f);
// Fetch the archive. The archive fetcher callback will unpack
it, and either call the element
// callback, or just go back around handleMetadata() on this,
which will see that the data is now
@@ -846,7 +873,8 @@
metadata = meta;
}
if(persistent)
- container.set(SingleFileFetcher.this);
+ container.store(SingleFileFetcher.this);
+ container.store(SingleFileFetcher.this);
wrapHandleMetadata(true, container, context);
} catch (MetadataParseException e) {
SingleFileFetcher.this.onFailure(new
FetchException(FetchException.INVALID_METADATA, e), false, container, context);
Modified: branches/db4o/freenet/src/freenet/client/async/SingleFileInserter.java
===================================================================
--- branches/db4o/freenet/src/freenet/client/async/SingleFileInserter.java
2008-09-26 18:24:36 UTC (rev 22848)
+++ branches/db4o/freenet/src/freenet/client/async/SingleFileInserter.java
2008-09-26 18:39:46 UTC (rev 22849)
@@ -208,7 +208,8 @@
cb.onBlockSetFinished(this, container, context);
started = true;
if(persistent) {
- container.set(this);
+ container.store(this);
+ container.store(this);
container.deactivate(cb, 1);
container.deactivate(parent, 1);
}
@@ -254,7 +255,8 @@
}
started = true;
if(persistent) {
- container.set(this);
+ container.store(this);
+ container.store(this);
container.deactivate(cb, 1);
container.deactivate(parent, 1);
}
@@ -275,14 +277,16 @@
SplitFileInserter sfi = new SplitFileInserter(parent,
sh, data, bestCodec, origSize, block.clientMetadata, ctx, getCHKOnly, metadata,
token, insertAsArchiveManifest, freeData, persistent, container, context);
sh.sfi = sfi;
if(persistent)
- container.set(sh);
+ container.store(sh);
+ container.store(sh);
cb.onTransition(this, sh, container);
sfi.start(container, context);
if(earlyEncode) sfi.forceEncode(container, context);
}
started = true;
if(persistent) {
- container.set(this);
+ container.store(this);
+ container.store(this);
container.deactivate(cb, 1);
container.deactivate(parent, 1);
}
@@ -421,7 +425,8 @@
metadataPutter = newMetaPutter;
}
if(persistent)
- container.set(this);
+ container.store(this);
+ container.store(this);
}
public SplitHandler() {
@@ -438,7 +443,8 @@
if(oldState == metadataPutter)
metadataPutter = newState;
if(persistent)
- container.set(this);
+ container.store(this);
+ container.store(this);
}
public void onSuccess(ClientPutState state, ObjectContainer
container, ClientContext context) {
@@ -453,7 +459,8 @@
if(freeData) {
block.free(container);
if(persistent)
- container.set(this);
+ container.store(this);
+ container.store(this);
}
return;
}
@@ -477,7 +484,8 @@
}
}
if(persistent)
- container.set(this);
+ container.store(this);
+ container.store(this);
if(lateStart)
startMetadata(container, context);
else if(finished) {
@@ -530,7 +538,8 @@
}
if(reportMetadataOnly) {
if(persistent)
- container.set(this);
+ container.store(this);
+ container.store(this);
cb.onMetadata(meta, this, container, context);
return;
}
@@ -590,7 +599,8 @@
if(logMINOR)
Logger.minor(this, "Created
metadata putter for "+this+" : "+metadataPutter+" bucket "+metadataBucket+"
size "+metadataBucket.size());
if(persistent)
- container.set(this);
+ container.store(this);
+ container.store(this);
if(!(earlyEncode ||
splitInsertSuccess)) return;
}
if(logMINOR) Logger.minor(this, "Putting
metadata on "+metadataPutter+" from "+sfi+"
("+((SplitFileInserter)sfi).getLength()+ ')');
@@ -627,7 +637,8 @@
finished = true;
cb.onFailure(e, this, container, context);
if(persistent)
- container.set(this);
+ container.store(this);
+ container.store(this);
}
public BaseClientPutter getParent() {
@@ -653,7 +664,8 @@
oldMetadataPutter = metadataPutter;
}
if(persistent) {
- container.set(this);
+ container.store(this);
+ container.store(this);
if(oldSFI != null)
container.activate(oldSFI, 1);
if(oldMetadataPutter != null)
@@ -678,7 +690,8 @@
else if (state == metadataPutter)
metaInsertSetBlocks = true;
if(persistent)
- container.set(this);
+ container.store(this);
+ container.store(this);
if(!(splitInsertSetBlocks &&
metaInsertSetBlocks))
return;
}
@@ -734,14 +747,16 @@
if(metaFetchable) return;
metaFetchable = true;
if(persistent)
- container.set(this);
+ container.store(this);
+ container.store(this);
} else {
if(state != sfi) {
Logger.error(this, "onFetchable
for unknown state "+state);
return;
}
if(persistent)
- container.set(this);
+ container.store(this);
+ container.store(this);
if(logMINOR) Logger.minor(this, "Data
fetchable");
if(metaInsertStarted) return;
}
@@ -772,7 +787,8 @@
splitInserter = sfi;
}
if(persistent)
- container.set(this);
+ container.store(this);
+ container.store(this);
if(putter != null) {
if(logMINOR) Logger.minor(this,
"Starting metadata inserter: "+putter+" for "+this);
putter.schedule(container, context);
@@ -806,7 +822,8 @@
if(freeData)
block.free(container);
if(persistent)
- container.set(this);
+ container.store(this);
+ container.store(this);
}
public void schedule(ObjectContainer container, ClientContext context)
throws InsertException {
Modified: branches/db4o/freenet/src/freenet/client/async/SplitFileFetcher.java
===================================================================
--- branches/db4o/freenet/src/freenet/client/async/SplitFileFetcher.java
2008-09-26 18:24:36 UTC (rev 22848)
+++ branches/db4o/freenet/src/freenet/client/async/SplitFileFetcher.java
2008-09-26 18:39:46 UTC (rev 22849)
@@ -255,7 +255,8 @@
}
if(persistent)
- container.set(this);
+ container.store(this);
+ container.store(this);
if(segmentCount == 1) {
// splitfile* will be overwritten, this is bad
@@ -276,7 +277,8 @@
tempListener.addKey(newSplitfileCheckBlocks[i].getNodeKey(), 0, context);
}
if(persistent) {
- container.set(segments[0]);
+ container.store(segments[0]);
+ container.store(segments[0]);
segments[0].deactivateKeys(container);
container.deactivate(segments[0], 1);
}
@@ -300,7 +302,8 @@
for(int j=0;j<checkBlocks.length;j++)
tempListener.addKey(checkBlocks[j].getNodeKey(), i, context);
if(persistent) {
- container.set(segments[i]);
+ container.store(segments[i]);
+ container.store(segments[i]);
segments[i].deactivateKeys(container);
container.deactivate(segments[i], 1);
for(int
x=dataBlocksPtr;x<dataBlocksPtr+copyDataBlocks;x++)
@@ -422,7 +425,8 @@
}
notifyAll();
}
- if(persistent) container.set(this);
+ if(persistent) container.store(this);
+ if(persistent) container.store(this);
if(finish) finish(container, context);
}
@@ -444,7 +448,8 @@
Bucket data = finalStatus(container, context);
// Decompress
if(persistent) {
- container.set(this);
+ container.store(this);
+ container.store(this);
container.activate(decompressors, 5);
container.activate(returnBucket, 5);
cbWasActive = container.ext().isActive(cb);
@@ -571,7 +576,8 @@
try {
mainBloomFile =
context.fg.makeRandomFile();
altBloomFile =
context.fg.makeRandomFile();
- container.set(this);
+ container.store(this);
+ container.store(this);
} catch (IOException e1) {
throw new
KeyListenerConstructionException(new
FetchException(FetchException.BUCKET_ERROR, "Unable to create Bloom filter
files in reconstruction", e1));
}
@@ -602,7 +608,8 @@
void setKeyCount(int keyCount2, ObjectContainer container) {
this.keyCount = keyCount2;
if(persistent)
- container.set(this);
+ container.store(this);
+ container.store(this);
}
public void onFailed(KeyListenerConstructionException e,
ObjectContainer container, ClientContext context) {
Modified:
branches/db4o/freenet/src/freenet/client/async/SplitFileFetcherSegment.java
===================================================================
--- branches/db4o/freenet/src/freenet/client/async/SplitFileFetcherSegment.java
2008-09-26 18:24:36 UTC (rev 22848)
+++ branches/db4o/freenet/src/freenet/client/async/SplitFileFetcherSegment.java
2008-09-26 18:39:46 UTC (rev 22849)
@@ -239,7 +239,8 @@
container.activate(dataBuckets[blockNo], 1);
dataBuckets[blockNo].setData(data);
if(persistent)
- container.set(dataBuckets[blockNo]);
+ container.store(dataBuckets[blockNo]);
+ container.store(dataBuckets[blockNo]);
} else if(blockNo < checkKeys.length + dataKeys.length)
{
blockNo -= dataKeys.length;
if(checkKeys[blockNo] == null) {
@@ -256,7 +257,8 @@
container.activate(checkBuckets[blockNo], 1);
checkBuckets[blockNo].setData(data);
if(persistent)
- container.set(checkBuckets[blockNo]);
+ container.store(checkBuckets[blockNo]);
+ container.store(checkBuckets[blockNo]);
} else
Logger.error(this, "Unrecognized block number:
"+blockNo, new Exception("error"));
if(startedDecode) {
@@ -273,7 +275,8 @@
dontNotify = !scheduled;
}
if(persistent) {
- container.set(this);
+ container.store(this);
+ container.store(this);
container.activate(parent, 1);
}
parent.completedBlock(dontNotify, container, context);
@@ -300,7 +303,8 @@
if(codec == null)
codec = FECCodec.getCodec(splitfileType, dataKeys.length,
checkKeys.length, context.mainExecutor);
if(persistent)
- container.set(this);
+ container.store(this);
+ container.store(this);
// Activate buckets
if(persistent) {
@@ -357,7 +361,8 @@
for(int i=0;i<dataBuckets.length;i++) {
// The FECCodec won't set them.
// But they should be active.
- container.set(dataBuckets[i]);
+ container.store(dataBuckets[i]);
+ container.store(dataBuckets[i]);
}
}
if(isCollectingBinaryBlob(parent)) {
@@ -393,7 +398,8 @@
finished = true;
if(codec == null || !isCollectingBinaryBlob(parent))
parentFetcher.segmentFinished(SplitFileFetcherSegment.this, container, context);
- if(persistent) container.set(this);
+ if(persistent) container.store(this);
+ if(persistent) container.store(this);
// Leave active before queueing
} catch (IOException e) {
Logger.normal(this, "Caught bucket error?: "+e, e);
@@ -401,7 +407,8 @@
finished = true;
failureException = new
FetchException(FetchException.BUCKET_ERROR);
}
- if(persistent) container.set(this);
+ if(persistent) container.store(this);
+ if(persistent) container.store(this);
parentFetcher.segmentFinished(SplitFileFetcherSegment.this, container, context);
return;
}
@@ -493,7 +500,8 @@
}
}
if(persistent) {
- container.set(this);
+ container.store(this);
+ container.store(this);
}
// Defer the completion until we have generated healing blocks
if we are collecting binary blobs.
if(isCollectingBinaryBlob(parent)) {
@@ -576,7 +584,8 @@
allFailed = failedBlocks + fatallyFailedBlocks >
(dataKeys.length + checkKeys.length - minFetched);
}
if(persistent)
- container.set(this);
+ container.store(this);
+ container.store(this);
if(allFailed)
fail(new FetchException(FetchException.SPLITFILE_ERROR,
errors), container, context, false);
else if(seg != null)
@@ -694,7 +703,8 @@
Logger.minor(this, "Retrying block "+blockNo+"
on "+this+" : tries="+tries+"/"+maxTries+" : "+sub);
}
if(persistent) {
- container.set(this);
+ container.store(this);
+ container.store(this);
container.deactivate(key, 5);
}
if(mustSchedule)
@@ -732,7 +742,8 @@
subSegments.add(sub);
}
if(persistent)
- container.set(subSegments);
+ container.store(subSegments);
+ container.store(subSegments);
return sub;
}
@@ -768,7 +779,8 @@
}
removeSubSegments(container, context);
if(persistent) {
- container.set(this);
+ container.store(this);
+ container.store(this);
container.activate(parentFetcher, 1);
}
parentFetcher.removeMyPendingKeys(this, container, context);
@@ -794,7 +806,8 @@
scheduled = true;
}
if(persistent)
- container.set(this);
+ container.store(this);
+ container.store(this);
if(persistent)
container.deactivate(seg, 1);
return seg;
@@ -871,7 +884,8 @@
}
}
if(persistent)
- container.set(subSegments);
+ container.store(subSegments);
+ container.store(subSegments);
return true;
}
@@ -884,7 +898,8 @@
subSegments.clear();
}
if(persistent && deadSegs.length > 0)
- container.set(this);
+ container.store(this);
+ container.store(this);
for(int i=0;i<deadSegs.length;i++) {
if(persistent)
container.activate(deadSegs[i], 1);
@@ -894,8 +909,10 @@
container.deactivate(deadSegs[i], 1);
}
if(persistent) {
- container.set(this);
- container.set(subSegments);
+ container.store(this);
+ container.store(this);
+ container.store(subSegments);
+ container.store(subSegments);
}
}
Modified:
branches/db4o/freenet/src/freenet/client/async/SplitFileFetcherSubSegment.java
===================================================================
---
branches/db4o/freenet/src/freenet/client/async/SplitFileFetcherSubSegment.java
2008-09-26 18:24:36 UTC (rev 22848)
+++
branches/db4o/freenet/src/freenet/client/async/SplitFileFetcherSubSegment.java
2008-09-26 18:39:46 UTC (rev 22849)
@@ -186,7 +186,8 @@
if(logMINOR)
Logger.minor(this, "Removing block
"+x+" of "+(blockNums.size()+1)+ " : "+ret+ " on "+this);
if(persistent)
- container.set(blockNums);
+ container.store(blockNums);
+ container.store(blockNums);
return ret;
}
return null;
@@ -221,7 +222,8 @@
blockNums.remove(x);
if(persistent && !hasSet) {
hasSet = true;
- container.set(blockNums);
+ container.store(blockNums);
+ container.store(blockNums);
}
continue;
}
@@ -258,7 +260,8 @@
removeBlockNum(((Integer)items[i].token).intValue(),
container, true);
}
if(persistent) {
- container.set(blockNums);
+ container.store(blockNums);
+ container.store(blockNums);
container.deactivate(blockNums, 2);
container.activate(segment, 1);
container.activate(parent, 1);
@@ -395,7 +398,8 @@
}
}
if(persistent && removed)
- container.set(blockNums);
+ container.store(blockNums);
+ container.store(blockNums);
}
if(!block.isMetadata()) {
onSuccess(data, fromStore, (Integer)token,
((Integer)token).intValue(), block, container, context);
@@ -558,7 +562,8 @@
}
}
if(persistent)
- container.set(blockNums);
+ container.store(blockNums);
+ container.store(blockNums);
if(schedule) {
// Only need to register once for all the blocks.
try {
@@ -614,7 +619,8 @@
}
}
if(persistent)
- container.set(blockNums);
+ container.store(blockNums);
+ container.store(blockNums);
if(schedule) {
if(dontSchedule) return true;
try {
@@ -716,9 +722,11 @@
if(!dontDeactivateSeg)
container.deactivate(segment, 1);
if(container.ext().isStored(this))
- container.set(this);
+ container.store(this);
+ container.store(this);
if(container.ext().isStored(blockNums))
- container.set(blockNums);
+ container.store(blockNums);
+ container.store(blockNums);
container.deactivate(blockNums, 1);
}
}
@@ -807,7 +815,8 @@
}
}
if(persistent && !callerActivatesAndSets) {
- container.set(blockNums);
+ container.store(blockNums);
+ container.store(blockNums);
container.deactivate(blockNums, 2);
}
return found;
@@ -820,7 +829,8 @@
for(int i=0;i<blockNos.length;i++)
store |= removeBlockNum(blockNos[i], container, true);
if(persistent) {
- if(store) container.set(blockNums);
+ if(store) container.store(blockNums);
+ if(store) container.store(blockNums);
container.deactivate(blockNums, 2);
}
}
Modified: branches/db4o/freenet/src/freenet/client/async/SplitFileInserter.java
===================================================================
--- branches/db4o/freenet/src/freenet/client/async/SplitFileInserter.java
2008-09-26 18:24:36 UTC (rev 22848)
+++ branches/db4o/freenet/src/freenet/client/async/SplitFileInserter.java
2008-09-26 18:39:46 UTC (rev 22849)
@@ -120,7 +120,8 @@
// Deactivate all buckets, and let dataBuckets be GC'ed
for(int i=0;i<dataBuckets.length;i++) {
// If we don't set them now, they will be set
when the segment is set, which means they will be set deactivated, and cause
NPEs.
- container.set(dataBuckets[i]);
+ container.store(dataBuckets[i]);
+ container.store(dataBuckets[i]);
container.deactivate(dataBuckets[i], 1);
if(dataBuckets.length > segmentSize) //
Otherwise we are nulling out within the segment
dataBuckets[i] = null;
@@ -135,7 +136,8 @@
parent.onMajorProgress(container);
if(persistent) {
for(int i=0;i<segments.length;i++) {
- container.set(segments[i]);
+ container.store(segments[i]);
+ container.store(segments[i]);
container.deactivate(segments[i], 1);
}
}
@@ -404,7 +406,8 @@
finished = true;
}
if(persistent) {
- container.set(this);
+ container.store(this);
+ container.store(this);
container.activate(cb, 1);
}
cb.onFailure(e, this, container, context);
@@ -520,7 +523,8 @@
finished = true;
}
if(persistent)
- container.set(this);
+ container.store(this);
+ container.store(this);
onAllFinished(container, context);
}
@@ -547,7 +551,8 @@
}
if(persistent) {
container.activate(cb, 1);
- container.set(this);
+ container.store(this);
+ container.store(this);
}
cb.onFetchable(this, container);
}
@@ -589,7 +594,8 @@
finished = true;
}
if(persistent)
- container.set(this);
+ container.store(this);
+ container.store(this);
for(int i=0;i<segments.length;i++) {
if(persistent)
container.activate(segments[i], 1);
Modified:
branches/db4o/freenet/src/freenet/client/async/SplitFileInserterSegment.java
===================================================================
---
branches/db4o/freenet/src/freenet/client/async/SplitFileInserterSegment.java
2008-09-26 18:24:36 UTC (rev 22848)
+++
branches/db4o/freenet/src/freenet/client/async/SplitFileInserterSegment.java
2008-09-26 18:39:46 UTC (rev 22849)
@@ -488,7 +488,8 @@
fetchable = (blocksCompleted > dataBlocks.length);
}
if(persistent)
- container.set(this);
+ container.store(this);
+ container.store(this);
if (fetchable)
parent.segmentFetchable(this, container);
if (fin)
@@ -545,7 +546,8 @@
}
if(persistent)
- container.set(this);
+ container.store(this);
+ container.store(this);
// Tell parent only after have started the inserts.
// Because of the counting.
@@ -562,7 +564,8 @@
}
if(persistent) {
- container.set(this);
+ container.store(this);
+ container.store(this);
container.deactivate(parent, 1);
}
}
@@ -584,7 +587,8 @@
toThrow = ex;
}
if(persistent) {
- container.set(this);
+ container.store(this);
+ container.store(this);
}
parent.segmentFinished(this, container, context);
}
@@ -605,7 +609,8 @@
toThrow = InsertException.construct(errors);
}
if(persistent) {
- container.set(this);
+ container.store(this);
+ container.store(this);
container.deactivate(errors, 5);
}
parent.segmentFinished(this, container, context);
@@ -631,7 +636,8 @@
}
blocksGotURI++;
if(persistent)
- container.set(this);
+ container.store(this);
+ container.store(this);
if (blocksGotURI != dataBlocks.length +
checkBlocks.length)
return;
// Double check
@@ -651,7 +657,8 @@
}
if(persistent) {
container.activate(parent, 1);
- container.set(this);
+ container.store(this);
+ container.store(this);
}
parent.segmentHasURIs(this, container, context);
if(persistent)
@@ -709,7 +716,8 @@
if (total != dataBlockInserters.length +
checkBlockInserters.length)
return;
if(persistent)
- container.set(this);
+ container.store(this);
+ container.store(this);
finish(container, context, parent);
}
@@ -757,7 +765,8 @@
}
blocksCompleted++;
if(persistent)
- container.set(this);
+ container.store(this);
+ container.store(this);
return blocksCompleted;
}
@@ -834,7 +843,8 @@
}
}
if(persistent) {
- container.set(this);
+ container.store(this);
+ container.store(this);
container.activate(parent, 1);
}
parent.segmentFinished(this, container, context);
Modified: branches/db4o/freenet/src/freenet/client/async/USKFetcherTag.java
===================================================================
--- branches/db4o/freenet/src/freenet/client/async/USKFetcherTag.java
2008-09-26 18:24:36 UTC (rev 22848)
+++ branches/db4o/freenet/src/freenet/client/async/USKFetcherTag.java
2008-09-26 18:39:46 UTC (rev 22849)
@@ -67,13 +67,15 @@
public static USKFetcherTag create(USK usk, USKFetcherCallback
callback, long nodeDBHandle, boolean persistent,
ObjectContainer container, FetchContext ctx, boolean
keepLast, int token) {
USKFetcherTag tag = new USKFetcherTag(usk, callback,
nodeDBHandle, persistent, container, ctx, keepLast, token);
- if(persistent) container.set(tag);
+ if(persistent) container.store(tag);
+ if(persistent) container.store(tag);
return tag;
}
synchronized void updatedEdition(long ed, ObjectContainer container) {
if(edition < ed) edition = ed;
- if(persistent) container.set(this); // Update
+ if(persistent) container.store(this); // Update
+ if(persistent) container.store(this); // Update
}
private static final RequestClient client = new RequestClient() {
@@ -107,7 +109,8 @@
context.jobRunner.queue(new DBJob() {
public void run(ObjectContainer container,
ClientContext context) {
- container.set(USKFetcherTag.this);
+ container.store(USKFetcherTag.this);
+ container.store(USKFetcherTag.this);
}
}, NativeThread.HIGH_PRIORITY, false);
@@ -132,7 +135,8 @@
public void run(ObjectContainer container,
ClientContext context) {
container.activate(callback, 1);
callback.onCancelled(container,
context);
- container.set(this);
+ container.store(this);
+ container.store(this);
container.deactivate(callback, 1);
}
@@ -152,7 +156,8 @@
public void run(ObjectContainer container,
ClientContext context) {
container.activate(callback, 1);
callback.onFailure(container, context);
- container.set(this);
+ container.store(this);
+ container.store(this);
container.deactivate(callback, 1);
}
@@ -184,7 +189,8 @@
public void run(ObjectContainer container,
ClientContext context) {
container.activate(callback, 1);
callback.onFoundEdition(l, key,
container, context, metadata, codec, data);
- container.set(this);
+ container.store(this);
+ container.store(this);
container.deactivate(callback, 1);
}
Modified: branches/db4o/freenet/src/freenet/node/NodeCrypto.java
===================================================================
--- branches/db4o/freenet/src/freenet/node/NodeCrypto.java 2008-09-26
18:24:36 UTC (rev 22848)
+++ branches/db4o/freenet/src/freenet/node/NodeCrypto.java 2008-09-26
18:39:46 UTC (rev 22849)
@@ -554,7 +554,7 @@
continue;
}
tuple.portNumber = portNumber;
- setupContainer.set(tuple);
+ setupContainer.store(tuple);
setupContainer.commit();
if(Logger.shouldLog(Logger.MINOR, this))
Logger.minor(this, "COMMITTED");
System.err.println("Generated and stored
database handle for node on port "+portNumber+": "+handle);
Modified: branches/db4o/freenet/src/freenet/node/SendableRequest.java
===================================================================
--- branches/db4o/freenet/src/freenet/node/SendableRequest.java 2008-09-26
18:24:36 UTC (rev 22848)
+++ branches/db4o/freenet/src/freenet/node/SendableRequest.java 2008-09-26
18:39:46 UTC (rev 22849)
@@ -94,7 +94,8 @@
public synchronized void setParentGrabArray(RandomGrabArray parent,
ObjectContainer container) {
parentGrabArray = parent;
if(persistent())
- container.set(this);
+ container.store(this);
+ container.store(this);
}
public void unregister(ObjectContainer container, ClientContext
context) {
Modified: branches/db4o/freenet/src/freenet/node/fcp/ClientGet.java
===================================================================
--- branches/db4o/freenet/src/freenet/node/fcp/ClientGet.java 2008-09-26
18:24:36 UTC (rev 22848)
+++ branches/db4o/freenet/src/freenet/node/fcp/ClientGet.java 2008-09-26
18:39:46 UTC (rev 22849)
@@ -331,7 +331,8 @@
onFailure(new
FetchException(FetchException.INTERNAL_ERROR, t), null, container);
}
if(persistenceType == PERSIST_FOREVER)
- container.set(this); // Update
+ container.store(this); // Update
+ container.store(this); // Update
}
@Override
@@ -424,7 +425,8 @@
data.free();
if(persistenceType == PERSIST_FOREVER) {
returnBucket.storeTo(container);
- container.set(this);
+ container.store(this);
+ container.store(this);
}
finish(container);
client.notifySuccess(this, container);
@@ -465,7 +467,8 @@
if(persistenceType != ClientRequest.PERSIST_CONNECTION) {
allDataPending = msg;
if(persistenceType == ClientRequest.PERSIST_FOREVER)
- container.set(this);
+ container.store(this);
+ container.store(this);
} else {
if(persistenceType == PERSIST_FOREVER)
container.activate(client, 1);
@@ -477,7 +480,8 @@
if(persistenceType != ClientRequest.PERSIST_CONNECTION) {
progressPending = msg;
if(persistenceType == ClientRequest.PERSIST_FOREVER)
- container.set(this);
+ container.store(this);
+ container.store(this);
}
if(persistenceType == PERSIST_FOREVER)
container.activate(client, 1);
@@ -542,7 +546,8 @@
trySendDataFoundOrGetFailed(null, container);
if(persistenceType == PERSIST_FOREVER) {
container.activate(client, 1);
- container.set(this);
+ container.store(this);
+ container.store(this);
}
finish(container);
client.notifyFailure(this, container);
@@ -882,7 +887,8 @@
started = true;
}
if(persistenceType == PERSIST_FOREVER)
- container.set(this);
+ container.store(this);
+ container.store(this);
}
return true;
} catch (FetchException e) {
Modified: branches/db4o/freenet/src/freenet/node/fcp/ClientPut.java
===================================================================
--- branches/db4o/freenet/src/freenet/node/fcp/ClientPut.java 2008-09-26
18:24:36 UTC (rev 22848)
+++ branches/db4o/freenet/src/freenet/node/fcp/ClientPut.java 2008-09-26
18:39:46 UTC (rev 22849)
@@ -372,7 +372,8 @@
started = true;
}
if(persistenceType == PERSIST_FOREVER)
- container.set(this); // Update
+ container.store(this); // Update
+ container.store(this); // Update
} catch (InsertException e) {
synchronized(this) {
started = true;
@@ -510,7 +511,8 @@
}
}
if(persistenceType == PERSIST_FOREVER)
- container.set(this);
+ container.store(this);
+ container.store(this);
return true;
} catch (InsertException e) {
onFailure(e, null, container);
Modified: branches/db4o/freenet/src/freenet/node/fcp/ClientPutBase.java
===================================================================
--- branches/db4o/freenet/src/freenet/node/fcp/ClientPutBase.java
2008-09-26 18:24:36 UTC (rev 22848)
+++ branches/db4o/freenet/src/freenet/node/fcp/ClientPutBase.java
2008-09-26 18:39:46 UTC (rev 22849)
@@ -170,7 +170,8 @@
generatedURI = uri;
}
if(persistenceType == PERSIST_FOREVER)
- container.set(this);
+ container.store(this);
+ container.store(this);
trySendGeneratedURIMessage(null, container);
}
@@ -308,7 +309,8 @@
if(persistenceType !=
PERSIST_CONNECTION)
progressMessage = msg;
}
- container.set(this);
+ container.store(this);
+ container.store(this);
} else {
context.jobRunner.queue(new DBJob() {
@@ -503,6 +505,7 @@
pfm.removeFrom(container);
progress.removeFrom(container);
if(persistenceType == PERSIST_FOREVER)
- container.set(this);
+ container.store(this);
+ container.store(this);
}
}
Modified: branches/db4o/freenet/src/freenet/node/fcp/ClientPutDir.java
===================================================================
--- branches/db4o/freenet/src/freenet/node/fcp/ClientPutDir.java
2008-09-26 18:24:36 UTC (rev 22848)
+++ branches/db4o/freenet/src/freenet/node/fcp/ClientPutDir.java
2008-09-26 18:39:46 UTC (rev 22849)
@@ -231,7 +231,8 @@
client.queueClientRequestMessage(msg, 0,
container);
}
if(persistenceType == PERSIST_FOREVER)
- container.set(this); // Update
+ container.store(this); // Update
+ container.store(this); // Update
} catch (InsertException e) {
started = true;
onFailure(e, null, container);
Modified: branches/db4o/freenet/src/freenet/node/fcp/ClientRequest.java
===================================================================
--- branches/db4o/freenet/src/freenet/node/fcp/ClientRequest.java
2008-09-26 18:24:36 UTC (rev 22848)
+++ branches/db4o/freenet/src/freenet/node/fcp/ClientRequest.java
2008-09-26 18:39:46 UTC (rev 22849)
@@ -217,7 +217,8 @@
if(cr != null) cr.cancel(container, context);
freeData(container);
if(persistenceType == PERSIST_FOREVER)
- container.set(this);
+ container.store(this);
+ container.store(this);
}
public boolean isPersistentForever() {
@@ -261,7 +262,8 @@
origHandler.finishedClientRequest(this);
client.finishedClientRequest(this, container);
if(persistenceType == ClientRequest.PERSIST_FOREVER)
- container.set(this);
+ container.store(this);
+ container.store(this);
}
/**
@@ -352,7 +354,8 @@
}
if(persistenceType == PERSIST_FOREVER) {
- container.set(this);
+ container.store(this);
+ container.store(this);
container.commit(); // commit before we send the message
if(Logger.shouldLog(Logger.MINOR, this))
Logger.minor(this, "COMMITTED");
}
Modified: branches/db4o/freenet/src/freenet/node/fcp/FCPConnectionHandler.java
===================================================================
--- branches/db4o/freenet/src/freenet/node/fcp/FCPConnectionHandler.java
2008-09-26 18:24:36 UTC (rev 22848)
+++ branches/db4o/freenet/src/freenet/node/fcp/FCPConnectionHandler.java
2008-09-26 18:39:46 UTC (rev 22849)
@@ -248,7 +248,8 @@
public void
run(ObjectContainer container, ClientContext context) {
try {
getter.register(container, false, false);
-
container.set(getter);
+
container.store(getter);
+
container.store(getter);
} catch
(IdentifierCollisionException e) {
Logger.normal(this, "Identifier collision on "+this);
FCPMessage msg = new IdentifierCollisionMessage(id, global);
@@ -316,7 +317,8 @@
public void run(ObjectContainer
container, ClientContext context) {
try {
putter.register(container, false, false);
-
container.set(putter);
+
container.store(putter);
+
container.store(putter);
} catch
(IdentifierCollisionException e) {
Logger.normal(this, "Identifier collision on "+this);
FCPMessage msg
= new IdentifierCollisionMessage(id, global);
@@ -382,7 +384,8 @@
public void run(ObjectContainer
container, ClientContext context) {
try {
putter.register(container, false, false);
- container.set(putter);
+ container.store(putter);
+ container.store(putter);
} catch
(IdentifierCollisionException e) {
Logger.normal(this,
"Identifier collision on "+this);
FCPMessage msg = new
IdentifierCollisionMessage(id, global);
Modified: branches/db4o/freenet/src/freenet/node/fcp/FCPPersistentRoot.java
===================================================================
--- branches/db4o/freenet/src/freenet/node/fcp/FCPPersistentRoot.java
2008-09-26 18:24:36 UTC (rev 22848)
+++ branches/db4o/freenet/src/freenet/node/fcp/FCPPersistentRoot.java
2008-09-26 18:39:46 UTC (rev 22849)
@@ -41,7 +41,8 @@
return root;
}
FCPPersistentRoot root = new FCPPersistentRoot(nodeDBHandle,
container);
- container.set(root);
+ container.store(root);
+ container.store(root);
System.err.println("Created FCP persistent root.");
return root;
}
@@ -77,7 +78,8 @@
return client;
}
FCPClient client = new FCPClient(name, handler, false, null,
ClientRequest.PERSIST_FOREVER, this, container);
- container.set(client);
+ container.store(client);
+ container.store(client);
return client;
}
Modified: branches/db4o/freenet/src/freenet/support/RandomGrabArray.java
===================================================================
--- branches/db4o/freenet/src/freenet/support/RandomGrabArray.java
2008-09-26 18:24:36 UTC (rev 22848)
+++ branches/db4o/freenet/src/freenet/support/RandomGrabArray.java
2008-09-26 18:39:46 UTC (rev 22849)
@@ -51,7 +51,8 @@
reqs[index++] = req;
if(logMINOR) Logger.minor(this, "Added: "+req+" to
"+this+" size now "+index);
if(persistent) {
- container.set(this);
+ container.store(this);
+ container.store(this);
}
}
}
@@ -146,18 +147,21 @@
}
if(logMINOR)
Logger.minor(this, "Chosen random item "+ret+" out of "+valid);
if(persistent &&
changedMe)
-
container.set(this);
+
container.store(this);
+
container.store(this);
return ret;
}
if(valid == 0 && exclude == 0) {
index = 0;
if(persistent)
-
container.set(this);
+
container.store(this);
+
container.store(this);
if(logMINOR)
Logger.minor(this, "No valid or excluded items");
return null;
} else if(valid == 0) {
if(persistent &&
changedMe)
-
container.set(this);
+
container.store(this);
+
container.store(this);
if(logMINOR)
Logger.minor(this, "No valid items, "+exclude+" excluded items");
return null;
} else if(valid == 1) {
@@ -175,7 +179,8 @@
if(logMINOR)
Logger.minor(this, "No valid or excluded items apart from "+ret);
}
if(persistent &&
changedMe)
-
container.set(this);
+
container.store(this);
+
container.store(this);
return ret;
} else {
random =
context.fastWeakRandom.nextInt(valid);
@@ -211,7 +216,8 @@
if(excluded > MAX_EXCLUDED) {
Logger.normal(this, "Remove
random returning null because "+excluded+" excluded items, length = "+index,
new Exception("error"));
if(persistent && changedMe)
- container.set(this);
+ container.store(this);
+ container.store(this);
return null;
}
continue;
@@ -219,7 +225,8 @@
if(ret != null && !ret.canRemove(container)) {
if(logMINOR) Logger.minor(this,
"Returning (cannot remove): "+ret+" of "+index);
if(persistent && changedMe)
- container.set(this);
+ container.store(this);
+ container.store(this);
return ret;
}
// Remove an element.
@@ -247,7 +254,8 @@
if(logMINOR) Logger.minor(this, "Returning "+ret+" of "+index);
ret.setParentGrabArray(null, container);
if(persistent)
- container.set(this);
+ container.store(this);
+ container.store(this);
return ret;
}
@@ -264,7 +272,8 @@
}
it.setParentGrabArray(null, container);
if(persistent) {
- container.set(this);
+ container.store(this);
+ container.store(this);
}
}
Modified: branches/db4o/freenet/src/freenet/support/SectoredRandomGrabArray.java
===================================================================
--- branches/db4o/freenet/src/freenet/support/SectoredRandomGrabArray.java
2008-09-26 18:24:36 UTC (rev 22848)
+++ branches/db4o/freenet/src/freenet/support/SectoredRandomGrabArray.java
2008-09-26 18:39:46 UTC (rev 22849)
@@ -52,8 +52,10 @@
rga = new RandomGrabArrayWithClient(client, persistent,
container);
addElement(client, rga);
if(persistent) {
- container.set(rga);
- container.set(this);
+ container.store(rga);
+ container.store(rga);
+ container.store(this);
+ container.store(this);
}
} else {
rga = (RandomGrabArrayWithClient)
grabArrays[clientIndex];
@@ -110,7 +112,8 @@
throw new IllegalArgumentException("Client not equal to
RemoveRandomWithObject's client: client="+client+" rr="+requestGrabber+" his
object="+requestGrabber.getObject());
addElement(client, requestGrabber);
if(persistent) {
- container.set(this);
+ container.store(this);
+ container.store(this);
}
}
@@ -136,7 +139,8 @@
grabArrays = new
RemoveRandomWithObject[0];
grabClients = new Object[0];
if(persistent)
- container.set(this);
+ container.store(this);
+ container.store(this);
}
if(logMINOR)
Logger.minor(this, "Returning (one item
only) "+item+" for "+rga);
@@ -174,7 +178,8 @@
grabArrays = new
RemoveRandomWithObject[0];
grabClients = new Object[0];
if(persistent)
- container.set(this);
+ container.store(this);
+ container.store(this);
} else if(firstRGA.isEmpty()) {
if(persistent) {
container.activate(firstRGA, 1);
@@ -182,7 +187,8 @@
grabArrays = new
RemoveRandomWithObject[] { rga };
grabClients = new Object[] {
grabClients[x] };
if(persistent)
- container.set(this);
+ container.store(this);
+ container.store(this);
}
if(persistent) {
container.deactivate(rga, 1);
@@ -218,7 +224,8 @@
Object client = rga.getObject();
removeElement(x);
if(persistent)
- container.set(this);
+ container.store(this);
+ container.store(this);
}
if(item == null) {
if(!rga.isEmpty()) {
Modified:
branches/db4o/freenet/src/freenet/support/SimpleReadOnlyArrayBucket.java
===================================================================
--- branches/db4o/freenet/src/freenet/support/SimpleReadOnlyArrayBucket.java
2008-09-26 18:24:36 UTC (rev 22848)
+++ branches/db4o/freenet/src/freenet/support/SimpleReadOnlyArrayBucket.java
2008-09-26 18:39:46 UTC (rev 22849)
@@ -60,7 +60,8 @@
}
public void storeTo(ObjectContainer container) {
- container.set(this);
+ container.store(this);
+ container.store(this);
}
public void removeFrom(ObjectContainer container) {
Modified: branches/db4o/freenet/src/freenet/support/SortedVectorByNumber.java
===================================================================
--- branches/db4o/freenet/src/freenet/support/SortedVectorByNumber.java
2008-09-26 18:24:36 UTC (rev 22848)
+++ branches/db4o/freenet/src/freenet/support/SortedVectorByNumber.java
2008-09-26 18:39:46 UTC (rev 22849)
@@ -61,7 +61,8 @@
System.arraycopy(data, 0, newData, 0, length);
data = newData;
}
- if(persistent) container.set(this);
+ if(persistent) container.store(this);
+ if(persistent) container.store(this);
verify(container);
}
@@ -137,7 +138,8 @@
data[x] = grabber;
length++;
if(persistent)
- container.set(this);
+ container.store(this);
+ container.store(this);
verify(container);
}
Modified: branches/db4o/freenet/src/freenet/support/io/ArrayBucket.java
===================================================================
--- branches/db4o/freenet/src/freenet/support/io/ArrayBucket.java
2008-09-26 18:24:36 UTC (rev 22848)
+++ branches/db4o/freenet/src/freenet/support/io/ArrayBucket.java
2008-09-26 18:39:46 UTC (rev 22849)
@@ -196,8 +196,10 @@
}
public void storeTo(ObjectContainer container) {
- container.set(data);
- container.set(this);
+ container.store(data);
+ container.store(data);
+ container.store(this);
+ container.store(this);
}
public void removeFrom(ObjectContainer container) {
Modified: branches/db4o/freenet/src/freenet/support/io/BucketChainBucket.java
===================================================================
--- branches/db4o/freenet/src/freenet/support/io/BucketChainBucket.java
2008-09-26 18:24:36 UTC (rev 22848)
+++ branches/db4o/freenet/src/freenet/support/io/BucketChainBucket.java
2008-09-26 18:39:46 UTC (rev 22849)
@@ -297,8 +297,10 @@
public void storeTo(ObjectContainer container) {
for(int i=0;i<buckets.size();i++)
((Bucket) buckets.get(i)).storeTo(container);
- container.set(buckets);
- container.set(this);
+ container.store(buckets);
+ container.store(buckets);
+ container.store(this);
+ container.store(this);
}
public void removeFrom(ObjectContainer container) {
Modified: branches/db4o/freenet/src/freenet/support/io/DelayedFreeBucket.java
===================================================================
--- branches/db4o/freenet/src/freenet/support/io/DelayedFreeBucket.java
2008-09-26 18:24:36 UTC (rev 22848)
+++ branches/db4o/freenet/src/freenet/support/io/DelayedFreeBucket.java
2008-09-26 18:39:46 UTC (rev 22849)
@@ -93,7 +93,8 @@
public void storeTo(ObjectContainer container) {
bucket.storeTo(container);
- container.set(this);
+ container.store(this);
+ container.store(this);
}
public void removeFrom(ObjectContainer container) {
Modified: branches/db4o/freenet/src/freenet/support/io/FileBucket.java
===================================================================
--- branches/db4o/freenet/src/freenet/support/io/FileBucket.java
2008-09-26 18:24:36 UTC (rev 22848)
+++ branches/db4o/freenet/src/freenet/support/io/FileBucket.java
2008-09-26 18:39:46 UTC (rev 22849)
@@ -110,7 +110,8 @@
}
public void storeTo(ObjectContainer container) {
- container.set(this);
+ container.store(this);
+ container.store(this);
}
public void removeFrom(ObjectContainer container) {
Modified: branches/db4o/freenet/src/freenet/support/io/MultiReaderBucket.java
===================================================================
--- branches/db4o/freenet/src/freenet/support/io/MultiReaderBucket.java
2008-09-26 18:24:36 UTC (rev 22848)
+++ branches/db4o/freenet/src/freenet/support/io/MultiReaderBucket.java
2008-09-26 18:39:46 UTC (rev 22849)
@@ -132,7 +132,8 @@
}
public void storeTo(ObjectContainer container) {
- container.set(this);
+ container.store(this);
+ container.store(this);
}
public void removeFrom(ObjectContainer container) {
Modified: branches/db4o/freenet/src/freenet/support/io/NullBucket.java
===================================================================
--- branches/db4o/freenet/src/freenet/support/io/NullBucket.java
2008-09-26 18:24:36 UTC (rev 22848)
+++ branches/db4o/freenet/src/freenet/support/io/NullBucket.java
2008-09-26 18:39:46 UTC (rev 22849)
@@ -75,7 +75,8 @@
}
public void storeTo(ObjectContainer container) {
- container.set(this);
+ container.store(this);
+ container.store(this);
}
public void removeFrom(ObjectContainer container) {
Modified:
branches/db4o/freenet/src/freenet/support/io/PaddedEphemerallyEncryptedBucket.java
===================================================================
---
branches/db4o/freenet/src/freenet/support/io/PaddedEphemerallyEncryptedBucket.java
2008-09-26 18:24:36 UTC (rev 22848)
+++
branches/db4o/freenet/src/freenet/support/io/PaddedEphemerallyEncryptedBucket.java
2008-09-26 18:39:46 UTC (rev 22849)
@@ -399,8 +399,10 @@
}
public void storeTo(ObjectContainer container) {
- container.set(bucket);
- container.set(this);
+ container.store(bucket);
+ container.store(bucket);
+ container.store(this);
+ container.store(this);
}
public void removeFrom(ObjectContainer container) {
Modified:
branches/db4o/freenet/src/freenet/support/io/ReadOnlyFileSliceBucket.java
===================================================================
--- branches/db4o/freenet/src/freenet/support/io/ReadOnlyFileSliceBucket.java
2008-09-26 18:24:36 UTC (rev 22848)
+++ branches/db4o/freenet/src/freenet/support/io/ReadOnlyFileSliceBucket.java
2008-09-26 18:39:46 UTC (rev 22849)
@@ -152,7 +152,8 @@
}
public void storeTo(ObjectContainer container) {
- container.set(this);
+ container.store(this);
+ container.store(this);
}
public void removeFrom(ObjectContainer container) {
Modified: branches/db4o/freenet/src/freenet/support/io/TempBucketFactory.java
===================================================================
--- branches/db4o/freenet/src/freenet/support/io/TempBucketFactory.java
2008-09-26 18:24:36 UTC (rev 22848)
+++ branches/db4o/freenet/src/freenet/support/io/TempBucketFactory.java
2008-09-26 18:39:46 UTC (rev 22849)
@@ -344,7 +344,8 @@
public void storeTo(ObjectContainer container) {
currentBucket.storeTo(container);
- container.set(this);
+ container.store(this);
+ container.store(this);
}
}
Modified: branches/db4o/freenet/src/freenet/support/io/TempFileBucket.java
===================================================================
--- branches/db4o/freenet/src/freenet/support/io/TempFileBucket.java
2008-09-26 18:24:36 UTC (rev 22848)
+++ branches/db4o/freenet/src/freenet/support/io/TempFileBucket.java
2008-09-26 18:39:46 UTC (rev 22849)
@@ -93,8 +93,10 @@
}
public void storeTo(ObjectContainer container) {
- container.set(generator);
- container.set(this);
+ container.store(generator);
+ container.store(generator);
+ container.store(this);
+ container.store(this);
}
public void removeFrom(ObjectContainer container) {