1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-07-04 15:45:25 +02:00

[385097] [dstore] DataStore spirit mechanism is not enabled

This commit is contained in:
David McKnight 2012-07-16 20:40:04 +00:00
parent fd5ede85f4
commit b577a57441
3 changed files with 29 additions and 14 deletions

View file

@ -42,6 +42,7 @@
* David McKnight (IBM) - [367096] [dstore] DataElement.isSpirit() may return true for newly created DStore objects
* David McKnight (IBM) - [370260] [dstore] log the RSE version in server traces
* David McKnight (IBM) - [373507] [dstore][multithread] reduce heap memory on disconnect for server
* David McKnight (IBM) - [385097] [dstore] DataStore spirit mechanism is not enabled
*******************************************************************************/
package org.eclipse.dstore.core.model;
@ -161,6 +162,8 @@ public final class DataStore
private RandomAccessFile _traceFile;
private boolean _tracingOn;
private boolean _queriedSpiritState = false; // for the client - so we don't keep sending down the same query
private boolean _spiritModeOn = false;
private boolean _spiritCommandReceived = false;
private File _memLoggingFileHandle;
@ -2295,17 +2298,26 @@ public final class DataStore
return synchronizedCommand(cmd, _dummy);
}
/**
* Client calls this to start the spiriting mechanism on the server. The return value shouldn't be reliable here.
* Originally this was a synchronized command but that can slow connect time. Since no one should use the return value here,
*
* @return whether the server spirit state has been queried
*/
public boolean queryServerSpiritState()
{
DataElement spirittype = findObjectDescriptor(IDataStoreConstants.DATASTORE_SPIRIT_DESCRIPTOR);
if (spirittype == null) return false;
DataElement cmd = localDescriptorQuery(spirittype, IDataStoreConstants.C_START_SPIRIT, 2);
if (cmd == null) return false;
DataElement status = synchronizedCommand(cmd, _dummy);
if ((status != null) && status.getName().equals(DataStoreResources.model_done))
return true;
else return false;
if (!_queriedSpiritState){
DataElement spirittype = findObjectDescriptor(IDataStoreConstants.DATASTORE_SPIRIT_DESCRIPTOR);
if (spirittype != null){
DataElement cmd = localDescriptorQuery(spirittype, IDataStoreConstants.C_START_SPIRIT, 2);
if (cmd != null){
command(cmd, _dummy); // start
_queriedSpiritState = true;
}
}
}
return _queriedSpiritState;
}
public DataElement queryHostJVM()

View file

@ -1,5 +1,5 @@
/********************************************************************************
* Copyright (c) 2002, 2008 IBM Corporation. All rights reserved.
* Copyright (c) 2002, 2012 IBM Corporation. All rights reserved.
* This program and the accompanying materials are made available under the terms
* of the Eclipse Public License v1.0 which accompanies this distribution, and is
* available at http://www.eclipse.org/legal/epl-v10.html
@ -12,6 +12,7 @@
*
* Contributors:
* David McKnight (IBM) - [226561] [apidoc] Add API markup to RSE Javadocs where extend / implement is allowed
* David McKnight (IBM) - [385097] [dstore] DataStore spirit mechanism is not enabled
********************************************************************************/
package org.eclipse.dstore.core.model;
@ -332,7 +333,11 @@ public class DataStoreSchema
_dataStore.createCommandDescriptor(rootD, "Notification", "*", C_NOTIFICATION, false); //$NON-NLS-1$ //$NON-NLS-2$
_dataStore.createCommandDescriptor(rootD, "Send Input", "*", C_SEND_INPUT, false); //$NON-NLS-1$ //$NON-NLS-2$
// spirit stuff
DataElement spiritnode = _dataStore.createObjectDescriptor(_dataStore.getDescriptorRoot(), IDataStoreConstants.DATASTORE_SPIRIT_DESCRIPTOR);
_dataStore.createCommandDescriptor(spiritnode, "StartSpirit", "DataElementRemover", IDataStoreConstants.C_START_SPIRIT); //$NON-NLS-1$ //$NON-NLS-2$
// both ends have this base schema, so mark each descriptor as updated
for (int i = 0; i < schemaRoot.getNestedSize(); i++)

View file

@ -19,6 +19,7 @@
* David McKnight (IBM) - [331922] [dstore] enable DataElement recycling
* David McKnight (IBM) - [371401] [dstore][multithread] avoid use of static variables - causes memory leak after disconnect
* David McKnight (IBM) - [373507] [dstore][multithread] reduce heap memory on disconnect for server
* David McKnight (IBM) - [385097] [dstore] DataStore spirit mechanism is not enabled
*******************************************************************************/
package org.eclipse.dstore.internal.core.util;
@ -60,9 +61,6 @@ public class DataElementRemover extends Handler
_queue = new LinkedList();
getTimes();
setWaitTime(_intervalTime);
DataElement spiritnode = _dataStore.createObjectDescriptor(_dataStore.getDescriptorRoot(), IDataStoreConstants.DATASTORE_SPIRIT_DESCRIPTOR);
_dataStore.createCommandDescriptor(spiritnode, "StartSpirit", "DataElementRemover", IDataStoreConstants.C_START_SPIRIT); //$NON-NLS-1$ //$NON-NLS-2$
_dataStore.refresh(_dataStore.getDescriptorRoot());
}
protected void getTimes()