mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-07-28 19:35:36 +02:00
[385097] [dstore] DataStore spirit mechanism is not enabled
This commit is contained in:
parent
fd5ede85f4
commit
b577a57441
3 changed files with 29 additions and 14 deletions
|
@ -42,6 +42,7 @@
|
||||||
* David McKnight (IBM) - [367096] [dstore] DataElement.isSpirit() may return true for newly created DStore objects
|
* 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) - [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) - [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;
|
package org.eclipse.dstore.core.model;
|
||||||
|
@ -161,6 +162,8 @@ public final class DataStore
|
||||||
private RandomAccessFile _traceFile;
|
private RandomAccessFile _traceFile;
|
||||||
private boolean _tracingOn;
|
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 _spiritModeOn = false;
|
||||||
private boolean _spiritCommandReceived = false;
|
private boolean _spiritCommandReceived = false;
|
||||||
private File _memLoggingFileHandle;
|
private File _memLoggingFileHandle;
|
||||||
|
@ -2295,17 +2298,26 @@ public final class DataStore
|
||||||
return synchronizedCommand(cmd, _dummy);
|
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()
|
public boolean queryServerSpiritState()
|
||||||
{
|
{
|
||||||
DataElement spirittype = findObjectDescriptor(IDataStoreConstants.DATASTORE_SPIRIT_DESCRIPTOR);
|
if (!_queriedSpiritState){
|
||||||
if (spirittype == null) return false;
|
DataElement spirittype = findObjectDescriptor(IDataStoreConstants.DATASTORE_SPIRIT_DESCRIPTOR);
|
||||||
DataElement cmd = localDescriptorQuery(spirittype, IDataStoreConstants.C_START_SPIRIT, 2);
|
if (spirittype != null){
|
||||||
if (cmd == null) return false;
|
DataElement cmd = localDescriptorQuery(spirittype, IDataStoreConstants.C_START_SPIRIT, 2);
|
||||||
|
|
||||||
DataElement status = synchronizedCommand(cmd, _dummy);
|
if (cmd != null){
|
||||||
if ((status != null) && status.getName().equals(DataStoreResources.model_done))
|
command(cmd, _dummy); // start
|
||||||
return true;
|
_queriedSpiritState = true;
|
||||||
else return false;
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return _queriedSpiritState;
|
||||||
}
|
}
|
||||||
|
|
||||||
public DataElement queryHostJVM()
|
public DataElement queryHostJVM()
|
||||||
|
|
|
@ -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
|
* 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
|
* of the Eclipse Public License v1.0 which accompanies this distribution, and is
|
||||||
* available at http://www.eclipse.org/legal/epl-v10.html
|
* available at http://www.eclipse.org/legal/epl-v10.html
|
||||||
|
@ -12,6 +12,7 @@
|
||||||
*
|
*
|
||||||
* Contributors:
|
* Contributors:
|
||||||
* David McKnight (IBM) - [226561] [apidoc] Add API markup to RSE Javadocs where extend / implement is allowed
|
* 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;
|
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, "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$
|
_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
|
// both ends have this base schema, so mark each descriptor as updated
|
||||||
for (int i = 0; i < schemaRoot.getNestedSize(); i++)
|
for (int i = 0; i < schemaRoot.getNestedSize(); i++)
|
||||||
|
|
|
@ -19,6 +19,7 @@
|
||||||
* David McKnight (IBM) - [331922] [dstore] enable DataElement recycling
|
* 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) - [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) - [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;
|
package org.eclipse.dstore.internal.core.util;
|
||||||
|
@ -60,9 +61,6 @@ public class DataElementRemover extends Handler
|
||||||
_queue = new LinkedList();
|
_queue = new LinkedList();
|
||||||
getTimes();
|
getTimes();
|
||||||
setWaitTime(_intervalTime);
|
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()
|
protected void getTimes()
|
||||||
|
|
Loading…
Add table
Reference in a new issue