public class StorageSystem extends java.lang.Object implements CheckpointListener
| Modifier and Type | Field and Description | 
|---|---|
| HashtableServer | myHashTableServer | 
| int | myId | 
| java.lang.String | myURL | 
| static java.util.HashMap<java.lang.Byte,java.lang.Class> | nodeClassMap | 
| static java.util.HashMap<java.lang.Byte,java.lang.String> | nodeClassNameMap | 
| static java.util.HashMap<java.lang.String,java.lang.Byte> | nodeClassNametoIDMap | 
| int | numServers | 
| int[] | partitionedGraphHostNodesTable | 
| boolean | recordStats | 
| static java.lang.String | RPC_MECHANISM | 
| java.util.concurrent.ConcurrentHashMap<java.lang.Integer,java.lang.String> | serverLocationMapping | 
| java.util.concurrent.ConcurrentHashMap<java.lang.Integer,HashtableServer> | servers | 
| Constructor and Description | 
|---|
| StorageSystem(java.util.Vector<java.lang.String> hostList,
             boolean writeThrough,
             Config configParams,
             java.util.HashMap<java.lang.Byte,java.lang.String> nodeClassNameMap,
             java.util.HashMap<java.lang.Byte,java.lang.Class> nodeClassMap) | 
| StorageSystem(java.util.Vector<java.lang.String> hostList,
             Config configParams)Constructor without reference to local hashtable server object, backwards compatible | 
| StorageSystem(java.util.Vector<java.lang.String> hostList,
             Config configParams,
             java.util.HashMap<java.lang.Byte,java.lang.String> nodeClassNameMap,
             java.util.HashMap<java.lang.Byte,java.lang.Class> nodeClassMap)Only called by BeehiveClientLoader class | 
| StorageSystem(java.util.Vector<java.lang.String> hostList,
             HashtableServer paramHashtableServer,
             boolean writeThrough,
             Config configParams,
             java.util.HashMap<java.lang.Byte,java.lang.String> nodeClassNameMap,
             java.util.HashMap<java.lang.Byte,java.lang.Class> nodeClassMap)Constructor for caching case | 
| StorageSystem(java.util.Vector<java.lang.String> hostList,
             HashtableServer paramHashtableServer,
             Config configParams,
             java.util.HashMap<java.lang.Byte,java.lang.String> nodeClassNameMap,
             java.util.HashMap<java.lang.Byte,java.lang.Class> nodeClassMap)Constructor with reference to local hashtable server object | 
| Modifier and Type | Method and Description | 
|---|---|
| boolean | acquireLocks(java.util.SortedSet<LockRequest> requests)Attempts to lock each request for validation and commit under a object-locking mechanism | 
| void | checkpoint() | 
| void | clearStatContainers() | 
| void | commitChanges(java.util.Set<Node> writeSet,
             java.util.Set<NodeData> writeNDSet,
             java.util.Map<java.lang.String,java.lang.Long> readSet) | 
| void | enableStats()Turn on stat recording | 
| NodeData | exec(NodeData n)Remotely executes the methods of a node. | 
| java.util.Vector<NodeData> | execParallel(java.util.Vector<NodeData> nodeDataVector) | 
| java.util.Vector<java.lang.String> | getAllKeys(java.lang.String url) | 
| java.util.Vector<Node> | getAllLocalNodes() | 
| java.util.Vector<Node> | getLocalNodes(java.util.Vector<java.lang.String> nodeIds)Gets all of the local nodes whose ids are passed in. | 
| java.util.Vector<Node> | getLocalNodes(java.util.Vector<java.lang.String> nodeIds,
             boolean withCaching)Gets all of the local nodes whose ids are passed in. | 
| java.util.Vector<NodeData> | getLocalNodesData(java.util.Vector<NodeData> nodeData,
                 java.util.Vector<NodeData> remoteVector)Deprecated.   | 
| java.lang.String | getLocation(java.lang.String nodeId) | 
| Node | getNode(java.lang.String nodeId) | 
| Node | getNode(java.lang.String nodeId,
       boolean withCaching)If  withCachingis true and caching is enabled through the configuration, then an attempt to
 get the node from the local cache will be made. | 
| NodeData | getNodeProperties(NodeData n)Gets specific properties of a node | 
| java.util.Vector<NodeData> | getNodePropertiesParallel(java.util.Vector<NodeData> nodeDatas)Gets the desired properties of several nodes in parallel. | 
| java.util.Vector<Node> | getNodesParallel(java.util.Vector<java.lang.String> nodeIds)Gets several Nodes whose ids are passed in; does so in a parallel fashion. | 
| java.util.Vector<Node> | getNodesParallel(java.util.Vector<java.lang.String> nodeIds,
                boolean withCaching)If  withCachingis true and | 
| int | getNumberOfServers() | 
| HashtableServer | getServer(java.lang.String nodeId) | 
| int | getServerID(java.lang.String nodeId) | 
| java.lang.String | getStats() | 
| java.lang.String | getStats(boolean includeHashtable)External API to get stats | 
| boolean | putNode(java.lang.String nodeId,
       Node node)Puts a node into the local server or a remote server based on the  nodeId | 
| void | putNodesParallel(java.util.Vector<Node> nodeList)Bulk call to putNode, called by the application
 Calls are bucketised to the respective servers | 
| boolean | relocate(java.lang.String nodeId) | 
| boolean | relocate(java.lang.String nodeId,
        boolean lock) | 
| boolean | updateNodeProperties(NodeData n)update Reflection API for the storage system | 
| void | updateNodePropertiesParallel(java.util.Vector<NodeData> nodeDataVector)updateNodeProperties for the bulk case | 
public java.util.concurrent.ConcurrentHashMap<java.lang.Integer,HashtableServer> servers
public java.util.concurrent.ConcurrentHashMap<java.lang.Integer,java.lang.String> serverLocationMapping
public java.lang.String myURL
public int myId
public HashtableServer myHashTableServer
public int numServers
public boolean recordStats
public int[] partitionedGraphHostNodesTable
public static java.lang.String RPC_MECHANISM
public static java.util.HashMap<java.lang.Byte,java.lang.String> nodeClassNameMap
public static java.util.HashMap<java.lang.Byte,java.lang.Class> nodeClassMap
public static java.util.HashMap<java.lang.String,java.lang.Byte> nodeClassNametoIDMap
public StorageSystem(java.util.Vector<java.lang.String> hostList,
                     Config configParams)
              throws java.rmi.RemoteException
hostList - java.rmi.RemoteExceptionpublic StorageSystem(java.util.Vector<java.lang.String> hostList,
                     HashtableServer paramHashtableServer,
                     Config configParams,
                     java.util.HashMap<java.lang.Byte,java.lang.String> nodeClassNameMap,
                     java.util.HashMap<java.lang.Byte,java.lang.Class> nodeClassMap)
              throws java.rmi.RemoteException
hostList - paramHashtableServer - configParams - nodeClassNameMap - : Map containing Classnames of all the Node Inherited classes used in the programnodeClassMap - : Map containing Classes of all the Node Inherited classes used in the programjava.rmi.RemoteExceptionpublic StorageSystem(java.util.Vector<java.lang.String> hostList,
                     Config configParams,
                     java.util.HashMap<java.lang.Byte,java.lang.String> nodeClassNameMap,
                     java.util.HashMap<java.lang.Byte,java.lang.Class> nodeClassMap)
              throws java.rmi.RemoteException
hostList - configParams - nodeClassNameMap - nodeClassMap - java.rmi.RemoteExceptionpublic StorageSystem(java.util.Vector<java.lang.String> hostList,
                     HashtableServer paramHashtableServer,
                     boolean writeThrough,
                     Config configParams,
                     java.util.HashMap<java.lang.Byte,java.lang.String> nodeClassNameMap,
                     java.util.HashMap<java.lang.Byte,java.lang.Class> nodeClassMap)
              throws java.rmi.RemoteException
hostList - paramHashtableServer - writeThrough - java.rmi.RemoteExceptionpublic StorageSystem(java.util.Vector<java.lang.String> hostList,
                     boolean writeThrough,
                     Config configParams,
                     java.util.HashMap<java.lang.Byte,java.lang.String> nodeClassNameMap,
                     java.util.HashMap<java.lang.Byte,java.lang.Class> nodeClassMap)
              throws java.rmi.RemoteException
java.rmi.RemoteExceptionpublic int getNumberOfServers()
public void enableStats()
public Node getNode(java.lang.String nodeId) throws java.rmi.RemoteException
nodeId - The id of the node that we want to fetch. Can be a local or remote id.java.rmi.RemoteException - Thrown if the node could not be fetched.public Node getNode(java.lang.String nodeId, boolean withCaching) throws java.rmi.RemoteException
withCaching is true and caching is enabled through the configuration, then an attempt to
 get the node from the local cache will be made. Otherwise, the behavior is identical to getNode(String)nodeId - The id of the node that we want to fetch. Can be a local or remote id.withCaching - True if an attempt to fetch from cache is desired, false otherwise.java.rmi.RemoteException - Thrown if the node could not be fetched.public java.util.Vector<Node> getNodesParallel(java.util.Vector<java.lang.String> nodeIds) throws java.rmi.RemoteException
nodeIds - The ids of the desired nodes. The ids can be a mixture of local and remote ids.java.rmi.RemoteException - Thrown if caching is enabled through the configuration and the nodes could not
                         be fetched from the cache.public java.util.Vector<Node> getNodesParallel(java.util.Vector<java.lang.String> nodeIds, boolean withCaching) throws java.rmi.RemoteException
withCaching is true and getNodesParallel(Vector)nodeIds - The ids of the nodes we want to fetch. Can be a mixture of local and remote ids.withCaching - True if an attempt to fetch from cache is desired, false otherwise.java.rmi.RemoteException - Thrown only if caching is desired and the nodes could not be fetched from cache.public NodeData getNodeProperties(NodeData n) throws java.rmi.RemoteException, java.lang.InterruptedException
n - A NodeData object containing:
          java.rmi.RemoteException - Thrown if the properties could not be fetchedjava.lang.InterruptedException - Thrown if the properties could not be fetchedpublic java.util.Vector<NodeData> getNodePropertiesParallel(java.util.Vector<NodeData> nodeDatas) throws java.rmi.RemoteException, java.lang.InterruptedException
nodeDatas - Each NodeData object will contain
                  java.rmi.RemoteException - Thrown if a node's properties could not be fetched.java.lang.InterruptedException - Thrown if a node's properties could not be fetched.public NodeData exec(NodeData n) throws java.rmi.RemoteException
n - Contains the nodeId of the node whose methods are to be executed. The methods that are to be
          executed are provided as a mapping of method name to parameters.java.rmi.RemoteExceptionpublic java.util.Vector<NodeData> execParallel(java.util.Vector<NodeData> nodeDataVector) throws java.rmi.RemoteException
java.rmi.RemoteExceptionpublic boolean putNode(java.lang.String nodeId,
                       Node node)
                throws java.rmi.RemoteException
nodeIdnodeId - The identification of the node that is to be put into the servernode - The node that is to be put into the serverjava.rmi.RemoteException - Thrown if the node could not be put into the serverpublic void putNodesParallel(java.util.Vector<Node> nodeList) throws java.rmi.RemoteException
nodeList - The nodes that are to be put into the servers.java.rmi.RemoteException - Thrown if a node could not be put into its serverpublic boolean updateNodeProperties(NodeData n) throws java.rmi.RemoteException, org.apache.thrift.TException
n - - this is a Node data which tells what the updated properties and TS arejava.rmi.RemoteExceptionorg.apache.thrift.TExceptionpublic void updateNodePropertiesParallel(java.util.Vector<NodeData> nodeDataVector) throws java.rmi.RemoteException
nodeDataVector - java.rmi.RemoteExceptionpublic java.util.Vector<java.lang.String> getAllKeys(java.lang.String url)
                                              throws java.rmi.RemoteException
java.rmi.RemoteExceptionpublic boolean relocate(java.lang.String nodeId)
                 throws java.rmi.RemoteException
java.rmi.RemoteExceptionpublic boolean relocate(java.lang.String nodeId,
                        boolean lock)
                 throws java.rmi.RemoteException
java.rmi.RemoteExceptionpublic java.lang.String getLocation(java.lang.String nodeId)
public java.lang.String getStats()
public java.lang.String getStats(boolean includeHashtable)
                          throws java.rmi.RemoteException
includeHashtable - java.rmi.RemoteExceptionpublic int getServerID(java.lang.String nodeId)
public HashtableServer getServer(java.lang.String nodeId)
public java.util.Vector<Node> getLocalNodes(java.util.Vector<java.lang.String> nodeIds)
nodeIds - The nodeIds of the local nodes we want to fetch.@Deprecated public java.util.Vector<NodeData> getLocalNodesData(java.util.Vector<NodeData> nodeData, java.util.Vector<NodeData> remoteVector)
nodeData - Each NodeData contains the nodeId of the node whose properties we want to fetch. The
                     desired properties are contained within the same NodeData object.remoteVector - A pointer to a vector of NodeData. Any remote nodeId from nodeData will be added
                     to this.nodeData and the respective
 properties and values we wanted to fetch.public java.util.Vector<Node> getLocalNodes(java.util.Vector<java.lang.String> nodeIds, boolean withCaching) throws java.rmi.RemoteException
withCaching is true and getLocalNodes(Vector)nodeIds - The nodeIds of the local nodes we want to fetch.withCaching - True if an attempt to include locally cached nodes is desired, false otherwise.java.rmi.RemoteException - Thrown if the cached nodes could not be fetched.public java.util.Vector<Node> getAllLocalNodes() throws java.rmi.RemoteException
java.rmi.RemoteExceptionpublic void clearStatContainers()
                         throws java.rmi.RemoteException
java.rmi.RemoteExceptionpublic boolean acquireLocks(java.util.SortedSet<LockRequest> requests)
requests - Metadata of nodes that are to be lockedpublic void commitChanges(java.util.Set<Node> writeSet, java.util.Set<NodeData> writeNDSet, java.util.Map<java.lang.String,java.lang.Long> readSet)
public void checkpoint()
checkpoint in interface CheckpointListener