signature:
public class OPropertyImpl { /** * Remove the index on property
 * @ deprecated Use { @ link OIndexManager # dropIndex ( String ) } instead . */
@ Deprecated public OPropertyImpl dropIndexes ( ) { } }

implementation: getDatabase ( ) . checkSecurity ( ORule . ResourceGeneric . SCHEMA , ORole . PERMISSION_DELETE ) ; acquireSchemaReadLock ( ) ; try { final OIndexManager indexManager = getDatabase ( ) . getMetadata ( ) . getIndexManager ( ) ; final ArrayList < OIndex < ? > > relatedIndexes = new ArrayList < OIndex < ? > > ( ) ; for ( final OIndex < ? > index : indexManager . getClassIndexes ( owner . getName ( ) ) ) { final OIndexDefinition definition = index . getDefinition ( ) ; if ( OCollections . indexOf ( definition . getFields ( ) , globalRef . getName ( ) , new OCaseInsentiveComparator ( ) ) > - 1 ) { if ( definition instanceof OPropertyIndexDefinition ) { relatedIndexes . add ( index ) ; } else { throw new IllegalArgumentException ( "This operation applicable only for property indexes. " + index . getName ( ) + " is " + index . getDefinition ( ) ) ; } } } for ( final OIndex < ? > index : relatedIndexes ) getDatabase ( ) . getMetadata ( ) . getIndexManager ( ) . dropIndex ( index . getName ( ) ) ; return this ; } finally { releaseSchemaReadLock ( ) ; }


signature:
public class OPropertyImpl { /** * Returns the first index defined for the property .
 * @ deprecated Use { @ link OClass # getInvolvedIndexes ( String . . . ) } instead . */
@ Deprecated public OIndex < ? > getIndex ( ) { } }

implementation: acquireSchemaReadLock ( ) ; try { Set < OIndex < ? > > indexes = owner . getInvolvedIndexes ( globalRef . getName ( ) ) ; if ( indexes != null && ! indexes . isEmpty ( ) ) return indexes . iterator ( ) . next ( ) ; return null ; } finally { releaseSchemaReadLock ( ) ; }


signature:
public class OPropertyImpl { /** * Returns the linked class in lazy mode because while unmarshalling the class could be not loaded yet .
 * @ return */
public OClass getLinkedClass ( ) { } }

implementation: acquireSchemaReadLock ( ) ; try { if ( linkedClass == null && linkedClassName != null ) linkedClass = owner . owner . getClass ( linkedClassName ) ; return linkedClass ; } finally { releaseSchemaReadLock ( ) ; }


signature:
public class OCommandExecutorSQLCreateVertex { /** * Execute the command and return the ODocument object created . */
public Object execute ( final Map < Object , Object > iArgs ) { } }

implementation:
if ( clazz == null ) throw new OCommandExecutionException ( "Cannot execute the command because it has not been parsed yet" ) ; // CREATE VERTEX DOES NOT HAVE TO BE IN TX
final OVertex vertex = getDatabase ( ) . newVertex ( clazz ) ; if ( fields != null ) // EVALUATE FIELDS
for ( final OPair < String , Object > f : fields ) { if ( f . getValue ( ) instanceof OSQLFunctionRuntime ) f . setValue ( ( ( OSQLFunctionRuntime ) f . getValue ( ) ) . getValue ( vertex . getRecord ( ) , null , context ) ) ; } OSQLHelper . bindParameters ( vertex . getRecord ( ) , fields , new OCommandParameters ( iArgs ) , context ) ; if ( content != null ) ( ( ODocument ) vertex . getRecord ( ) ) . merge ( content , true , false ) ; if ( clusterName != null ) vertex . save ( clusterName ) ; else vertex . save ( ) ; return vertex . getRecord ( ) ;


signature:
public class OCompositeKey { /** * Add new key value to the list of already registered values .
 * If passed in value is { @ link OCompositeKey } itself then its values will be copied in current index . But key itself will not be
 * added .
 * @ param key Key to add . */
public void addKey ( final Object key ) { } }

implementation: if ( key instanceof OCompositeKey ) { final OCompositeKey compositeKey = ( OCompositeKey ) key ; for ( final Object inKey : compositeKey . keys ) { addKey ( inKey ) ; } } else { keys . add ( key ) ; }


signature:
public class OIndexManagerShared { /** * Create a new index .
 * May require quite a long time if big amount of data should be indexed .
 * @ param iName name of index
 * @ param type index type . Specified by plugged index factories .
 * @ param indexDefinition metadata that describes index structure
 * @ param clusterIdsToIndex ids of clusters that index should track for changes .
 * @ param progressListener listener to track task progress .
 * @ param metadata document with additional properties that can be used by index engine .
 * @ param algorithm tip to an index factory what algorithm to use
 * @ return a newly created index instance */
public OIndex < ? > createIndex ( ODatabaseDocumentInternal database , final String iName , String type , final OIndexDefinition indexDefinition , final int [ ] clusterIdsToIndex , OProgressListener progressListener , ODocument metadata , String algorithm ) { } }

implementation:
if ( database . getTransaction ( ) . isActive ( ) ) throw new IllegalStateException ( "Cannot create a new index inside a transaction" ) ; final Character c = OSchemaShared . checkFieldNameIfValid ( iName ) ; if ( c != null ) throw new IllegalArgumentException ( "Invalid index name '" + iName + "'. Character '" + c + "' is invalid" ) ; if ( indexDefinition == null ) { throw new IllegalArgumentException ( "Index definition cannot be null" ) ; } final Locale locale = getServerLocale ( ) ; type = type . toUpperCase ( locale ) ; if ( algorithm == null ) { algorithm = OIndexes . chooseDefaultIndexAlgorithm ( type ) ; } final String valueContainerAlgorithm = chooseContainerAlgorithm ( type ) ; final OIndexInternal < ? > index ; acquireExclusiveLock ( ) ; try { if ( indexes . containsKey ( iName ) ) throw new OIndexException ( "Index with name " + iName + " already exists." ) ; // manual indexes are always durable
if ( clusterIdsToIndex == null || clusterIdsToIndex . length == 0 ) { if ( metadata == null ) metadata = new ODocument ( ) . setTrackingChanges ( false ) ; final Object durable = metadata . field ( "durableInNonTxMode" ) ; if ( ! ( durable instanceof Boolean ) ) metadata . field ( "durableInNonTxMode" , true ) ; if ( metadata . field ( "trackMode" ) == null ) metadata . field ( "trackMode" , "FULL" ) ; } index = OIndexes . createIndex ( getStorage ( ) , iName , type , algorithm , valueContainerAlgorithm , metadata , - 1 ) ; if ( progressListener == null ) // ASSIGN DEFAULT PROGRESS LISTENER
progressListener = new OIndexRebuildOutputListener ( index ) ; final Set < String > clustersToIndex = findClustersByIds ( clusterIdsToIndex , database ) ; Object ignoreNullValues = metadata == null ? null : metadata . field ( "ignoreNullValues" ) ; if ( Boolean . TRUE . equals ( ignoreNullValues ) ) { indexDefinition . setNullValuesIgnored ( true ) ; } else if ( Boolean . FALSE . equals ( ignoreNullValues ) ) { indexDefinition . setNullValuesIgnored ( false ) ; } else { indexDefinition . setNullValuesIgnored ( database . getConfiguration ( ) . getValueAsBoolean ( OGlobalConfiguration . INDEX_IGNORE_NULL_VALUES_DEFAULT ) ) ; } // decide which cluster to use ( " index " - for automatic and " manindex " for manual )
final String clusterName = indexDefinition . getClassName ( ) != null ? defaultClusterName : manualClusterName ; index . create ( iName , indexDefinition , clusterName , clustersToIndex , true , progressListener ) ; addIndexInternal ( index ) ; if ( metadata != null ) { final ODocument config = index . getConfiguration ( ) ; config . field ( "metadata" , metadata , OType . EMBEDDED ) ; } setDirty ( ) ; save ( ) ; } finally { releaseExclusiveLock ( ) ; } notifyInvolvedClasses ( database , clusterIdsToIndex ) ; return preProcessBeforeReturn ( database , index ) ;


signature:
public class OIndexManagerShared { /** * Binds POJO to ODocument . */
@ Override public ODocument toStream ( ) { } }

implementation: internalAcquireExclusiveLock ( ) ; try { document . setInternalStatus ( ORecordElement . STATUS . UNMARSHALLING ) ; try { final OTrackedSet < ODocument > indexes = new OTrackedSet < > ( document ) ; for ( final OIndex < ? > i : this . indexes . values ( ) ) { indexes . add ( ( ( OIndexInternal < ? > ) i ) . updateConfiguration ( ) ) ; } document . field ( CONFIG_INDEXES , indexes , OType . EMBEDDEDSET ) ; } finally { document . setInternalStatus ( ORecordElement . STATUS . LOADED ) ; } document . setDirty ( ) ; return document ; } finally { internalReleaseExclusiveLock ( ) ; }


signature:
public class OModifiableDistributedConfiguration { /** * Sets the server role between MASTER ( default ) and REPLICA . */
public void setServerRole ( final String iServerName , final ROLES role ) { } }

implementation: synchronized ( configuration ) { ODocument servers = configuration . field ( SERVERS ) ; if ( servers == null ) { servers = new ODocument ( ) ; configuration . field ( SERVERS , servers , OType . EMBEDDED ) ; } servers . field ( iServerName , role ) ; incrementVersion ( ) ; }


signature:
public class OModifiableDistributedConfiguration { /** * Adds a server in the configuration . It replaces all the tags & lt ; NEW _ NODE & gt ; with the new server name < br >
 * NOTE : It must be executed in distributed database lock .
 * @ param iNode
 * Server name
 * @ return the list of changed partitions or null if no changes have applied */
public List < String > addNewNodeInServerList ( final String iNode ) { } }

implementation:
synchronized ( configuration ) { final List < String > changedPartitions = new ArrayList < String > ( ) ; // ADD THE NODE IN CONFIGURATION . LOOK FOR $ newNode TAG
for ( String clusterName : getClusterNames ( ) ) { final List < String > partitions = getClusterConfiguration ( clusterName ) . field ( SERVERS ) ; if ( partitions != null ) { final int newNodePos = partitions . indexOf ( OModifiableDistributedConfiguration . NEW_NODE_TAG ) ; if ( newNodePos > - 1 && ! partitions . contains ( iNode ) ) { partitions . add ( newNodePos , iNode ) ; changedPartitions . add ( clusterName ) ; } } } if ( ! changedPartitions . isEmpty ( ) ) { // INCREMENT VERSION
incrementVersion ( ) ; if ( ! getRegisteredServers ( ) . contains ( iNode ) ) { if ( getNewNodeStrategy ( ) == NEW_NODE_STRATEGIES . STATIC ) { // REGISTER THE SERVER AS STATIC AND INCREMENT VERSION
setServerRole ( iNode , getServerRole ( "*" ) ) ; } } return changedPartitions ; } } return null ;


signature:
public class OModifiableDistributedConfiguration { /** * Sets the server as owner for the given cluster . The owner server is the first in server list . < br >
 * NOTE : It must be executed in distributed database lock .
 * @ param iClusterName
 * Cluster name or * . Does not accept null . */
public void setServerOwner ( final String iClusterName , final String iServerName ) { } }

implementation:
if ( iClusterName == null ) throw new IllegalArgumentException ( "cluster name cannot be null" ) ; synchronized ( configuration ) { final ODocument clusters = configuration . field ( CLUSTERS ) ; ODocument cluster = clusters . field ( iClusterName ) ; if ( cluster == null ) // CREATE IT
cluster = createCluster ( iClusterName ) ; else { // CHECK IF THE OWNER IS ALREADY CONFIGURED
final String owner = cluster . field ( OWNER ) ; if ( owner != null && ! iServerName . equalsIgnoreCase ( owner ) ) throw new ODistributedException ( "Cannot overwrite ownership of cluster '" + iClusterName + "' to the server '" + iServerName + "', because server '" + owner + "' was already configured as owner" ) ; } List < String > serverList = getClusterConfiguration ( iClusterName ) . field ( SERVERS ) ; if ( serverList == null ) { serverList = initClusterServers ( cluster ) ; } if ( ! serverList . isEmpty ( ) && serverList . get ( 0 ) . equals ( iServerName ) ) // ALREADY OWNER
return ; // REMOVE THE NODE IF ANY
boolean removed = false ; for ( Iterator < String > it = serverList . iterator ( ) ; it . hasNext ( ) ; ) { if ( it . next ( ) . equals ( iServerName ) ) { it . remove ( ) ; removed = true ; break ; } } if ( ! removed ) throw new ODistributedException ( "Cannot set ownership of cluster '" + iClusterName + "' to the server '" + iServerName + "', because the server has no that cluster (sharding)" ) ; // ADD THE NODE AS FIRST OF THE LIST = MASTER
serverList . add ( 0 , iServerName ) ; incrementVersion ( ) ; }


signature:
public class OModifiableDistributedConfiguration { /** * Removes a server from the list . < br >
 * NOTE : It must be executed in distributed database lock .
 * @ param iNode
 * Server name
 * @ return */
public List < String > removeServer ( final String iNode ) { } }

implementation:
synchronized ( configuration ) { final List < String > changedPartitions = new ArrayList < String > ( ) ; for ( String clusterName : getClusterNames ( ) ) { final Collection < String > nodes = getClusterConfiguration ( clusterName ) . field ( SERVERS ) ; if ( nodes != null ) { for ( String node : nodes ) { if ( node . equals ( iNode ) ) { // FOUND : REMOVE IT
nodes . remove ( node ) ; changedPartitions . add ( clusterName ) ; break ; } } } } if ( ! changedPartitions . isEmpty ( ) ) { incrementVersion ( ) ; return changedPartitions ; } } return null ;


signature:
public class OModifiableDistributedConfiguration { /** * Set a server offline . It assures the offline server is never on top of the list . < br >
 * NOTE : It must be executed in distributed database lock .
 * @ param iNode
 * Server name
 * @ param newLockManagerServer
 * New Lock Manager server name
 * @ return */
public List < String > setServerOffline ( final String iNode , final String newLockManagerServer ) { } }

implementation:
final List < String > changedPartitions = new ArrayList < String > ( ) ; final String [ ] clusters = getClusterNames ( ) ; synchronized ( configuration ) { for ( String clusterName : clusters ) { final List < String > nodes = getClusterConfiguration ( clusterName ) . field ( SERVERS ) ; if ( nodes != null && nodes . size ( ) > 1 ) { for ( String node : nodes ) { if ( node . equals ( iNode ) ) { // FOUND : PUT THE NODE AT THE END ( BEFORE ANY TAG < NEW _ NODE > )
nodes . remove ( node ) ; final boolean newNodeRemoved = nodes . remove ( NEW_NODE_TAG ) ; nodes . add ( node ) ; if ( newNodeRemoved ) // REINSERT NEW NODE TAG AT THE END
nodes . add ( NEW_NODE_TAG ) ; if ( newLockManagerServer != null ) { // ASSURE THE NEW LOCK MANAGER IS THE FIRST IN THE LIST
if ( nodes . remove ( newLockManagerServer ) ) nodes . add ( 0 , newLockManagerServer ) ; } changedPartitions . add ( clusterName ) ; break ; } } } } if ( ! changedPartitions . isEmpty ( ) ) { incrementVersion ( ) ; return changedPartitions ; } } return null ;


signature:
public class OClusterRemote { /** * ( non - Javadoc )
 * @ see com . orientechnologies . orient . core . storage . OCluster # configure ( com . orientechnologies . orient . core . storage . OStorage , int ,
 * java . lang . String , java . lang . String , int , java . lang . Object [ ] ) */
public void configure ( OStorage iStorage , int iId , String iClusterName , Object ... iParameters ) { } }

implementation: id = iId ; name = iClusterName ;


signature:
public class OClusterRemote { /** * ( non - Javadoc )
 * @ see com . orientechnologies . orient . core . storage . OCluster # configure ( com . orientechnologies . orient . core . storage . OStorage ,
 * com . orientechnologies . orient . core . config . OStorageClusterConfiguration ) */
public void configure ( OStorage iStorage , OStorageClusterConfiguration iConfig ) throws IOException { } }

implementation: id = iConfig . getId ( ) ; name = iConfig . getName ( ) ;


signature:
public class ORecordAbstract { /** * Remove the current event listener .
 * @ see ORecordListener */
protected void removeListener ( final ORecordListener listener ) { } }

implementation: if ( _listeners != null ) { _listeners . remove ( listener ) ; if ( _listeners . isEmpty ( ) ) _listeners = null ; }


signature:
public class ODistributedMessageServiceImpl { /** * Creates a distributed database instance if not defined yet . */
public ODistributedDatabaseImpl registerDatabase ( final String iDatabaseName , ODistributedConfiguration cfg ) { } }

implementation: final ODistributedDatabaseImpl ddb = databases . get ( iDatabaseName ) ; if ( ddb != null ) return ddb ; return new ODistributedDatabaseImpl ( manager , this , iDatabaseName , cfg , manager . getServerInstance ( ) ) ;


signature:
public class ODistributedMessageServiceImpl { /** * Not synchronized , it ' s called when a message arrives */
public void dispatchResponseToThread ( final ODistributedResponse response ) { } }

implementation:
try { final long msgId = response . getRequestId ( ) . getMessageId ( ) ; // GET ASYNCHRONOUS MSG MANAGER IF ANY
final ODistributedResponseManager asynchMgr = responsesByRequestIds . get ( msgId ) ; if ( asynchMgr == null ) { if ( ODistributedServerLog . isDebugEnabled ( ) ) ODistributedServerLog . debug ( this , manager . getLocalNodeName ( ) , response . getExecutorNodeName ( ) , DIRECTION . IN , "received response for message %d after the timeout (%dms)" , msgId , OGlobalConfiguration . DISTRIBUTED_ASYNCH_RESPONSES_TIMEOUT . getValueAsLong ( ) ) ; } else if ( asynchMgr . collectResponse ( response ) ) { // ALL RESPONSE RECEIVED , REMOVE THE RESPONSE MANAGER WITHOUT WAITING THE PURGE THREAD REMOVE THEM FOR TIMEOUT
responsesByRequestIds . remove ( msgId ) ; } } finally { Orient . instance ( ) . getProfiler ( ) . updateCounter ( "distributed.node.msgReceived" , "Number of replication messages received in current node" , + 1 , "distributed.node.msgReceived" ) ; Orient . instance ( ) . getProfiler ( ) . updateCounter ( "distributed.node." + response . getExecutorNodeName ( ) + ".msgReceived" , "Number of replication messages received in current node from a node" , + 1 , "distributed.node.*.msgReceived" ) ; }


signature:
public class ODistributedMessageServiceImpl { /** * Removes a response manager because in timeout . */
public void timeoutRequest ( final long msgId ) { } }

implementation: final ODistributedResponseManager asynchMgr = responsesByRequestIds . remove ( msgId ) ; if ( asynchMgr != null ) asynchMgr . timeout ( ) ;


signature:
public class ODatabaseDocumentEmbedded { /** * { @ inheritDoc } */
public void internalCreate ( OrientDBConfig config , OSharedContext ctx ) { } }

implementation:
this . sharedContext = ctx ; this . status = STATUS . OPEN ; // THIS IF SHOULDN ' T BE NEEDED , CREATE HAPPEN ONLY IN EMBEDDED
applyAttributes ( config ) ; applyListeners ( config ) ; metadata = new OMetadataDefault ( this ) ; installHooksEmbedded ( ) ; createMetadata ( ctx ) ; if ( this . getMetadata ( ) . getCommandCache ( ) . isEnabled ( ) ) registerHook ( new OCommandCacheHook ( this ) , ORecordHook . HOOK_POSITION . REGULAR ) ;


signature:
public class ODatabaseDocumentEmbedded { /** * Returns a copy of current database if it ' s open . The returned instance can be used by another thread without affecting current
 * instance . The database copy is not set in thread local . */
public ODatabaseDocumentInternal copy ( ) { } }

implementation: ODatabaseDocumentEmbedded database = new ODatabaseDocumentEmbedded ( getSharedContext ( ) . getStorage ( ) ) ; database . init ( config , this . sharedContext ) ; String user ; if ( getUser ( ) != null ) { user = getUser ( ) . getName ( ) ; } else { user = null ; } database . internalOpen ( user , null , false ) ; database . callOnOpenListeners ( ) ; this . activateOnCurrentThread ( ) ; return database ;


signature:
public class ODatabaseDocumentEmbedded { /** * This method is internal , it can be subject to signature change or be removed , do not use .
 * @ Internal */
public void executeDeleteRecord ( OIdentifiable record , final int iVersion , final boolean iRequired , final OPERATION_MODE iMode , boolean prohibitTombstones ) { } }

implementation: checkOpenness ( ) ; checkIfActive ( ) ; final ORecordId rid = ( ORecordId ) record . getIdentity ( ) ; if ( rid == null ) throw new ODatabaseException ( "Cannot delete record because it has no identity. Probably was created from scratch or contains projections of fields rather than a full record" ) ; if ( ! rid . isValid ( ) ) return ; record = record . getRecord ( ) ; if ( record == null ) return ; final OMicroTransaction microTx = beginMicroTransaction ( ) ; try { microTx . deleteRecord ( record . getRecord ( ) , iMode ) ; } catch ( Exception e ) { endMicroTransaction ( false ) ; throw e ; } endMicroTransaction ( true ) ; return ;


signature:
public class ODatabaseDocumentEmbedded { /** * This method is internal , it can be subject to signature change or be removed , do not use .
 * @ Internal */
public < RET extends ORecord > RET executeReadRecord ( final ORecordId rid , ORecord iRecord , final int recordVersion , final String fetchPlan , final boolean ignoreCache , final boolean iUpdateCache , final boolean loadTombstones , final OStorage . LOCKING_STRATEGY lockingStrategy , RecordReader recordReader ) { } }

implementation:
checkOpenness ( ) ; checkIfActive ( ) ; getMetadata ( ) . makeThreadLocalSchemaSnapshot ( ) ; ORecordSerializationContext . pushContext ( ) ; try { checkSecurity ( ORule . ResourceGeneric . CLUSTER , ORole . PERMISSION_READ , getClusterNameById ( rid . getClusterId ( ) ) ) ; // either regular or micro tx must be active or both inactive
assert ! ( getTransaction ( ) . isActive ( ) && ( microTransaction != null && microTransaction . isActive ( ) ) ) ; // SEARCH IN LOCAL TX
ORecord record = getTransaction ( ) . getRecord ( rid ) ; if ( record == OBasicTransaction . DELETED_RECORD ) // DELETED IN TX
return null ; if ( record == null ) { if ( microTransaction != null && microTransaction . isActive ( ) ) { record = microTransaction . getRecord ( rid ) ; if ( record == OBasicTransaction . DELETED_RECORD ) return null ; } } if ( record == null && ! ignoreCache ) // SEARCH INTO THE CACHE
record = getLocalCache ( ) . findRecord ( rid ) ; if ( record != null ) { if ( iRecord != null ) { iRecord . fromStream ( record . toStream ( ) ) ; ORecordInternal . setVersion ( iRecord , record . getVersion ( ) ) ; record = iRecord ; } OFetchHelper . checkFetchPlanValid ( fetchPlan ) ; if ( beforeReadOperations ( record ) ) return null ; if ( record . getInternalStatus ( ) == ORecordElement . STATUS . NOT_LOADED ) record . reload ( ) ; if ( lockingStrategy == OStorage . LOCKING_STRATEGY . KEEP_SHARED_LOCK ) { OLogManager . instance ( ) . warn ( this , "You use deprecated record locking strategy: %s it may lead to deadlocks " + lockingStrategy ) ; record . lock ( false ) ; } else if ( lockingStrategy == OStorage . LOCKING_STRATEGY . KEEP_EXCLUSIVE_LOCK ) { OLogManager . instance ( ) . warn ( this , "You use deprecated record locking strategy: %s it may lead to deadlocks " + lockingStrategy ) ; record . lock ( true ) ; } afterReadOperations ( record ) ; if ( record instanceof ODocument ) ODocumentInternal . checkClass ( ( ODocument ) record , this ) ; return ( RET ) record ; } final ORawBuffer recordBuffer ; if ( ! rid . isValid ( ) ) recordBuffer = null ; else { OFetchHelper . checkFetchPlanValid ( fetchPlan ) ; int version ; if ( iRecord != null ) version = iRecord . getVersion ( ) ; else version = recordVersion ; recordBuffer = recordReader . readRecord ( getStorage ( ) , rid , fetchPlan , ignoreCache , version ) ; } if ( recordBuffer == null ) return null ; if ( iRecord == null || ORecordInternal . getRecordType ( iRecord ) != recordBuffer . recordType ) // NO SAME RECORD TYPE : CAN ' T REUSE OLD ONE BUT CREATE A NEW ONE FOR IT
iRecord = Orient . instance ( ) . getRecordFactoryManager ( ) . newInstance ( recordBuffer . recordType , rid . getClusterId ( ) , this ) ; ORecordInternal . setRecordSerializer ( iRecord , getSerializer ( ) ) ; ORecordInternal . fill ( iRecord , rid , recordBuffer . version , recordBuffer . buffer , false , this ) ; if ( iRecord instanceof ODocument ) ODocumentInternal . checkClass ( ( ODocument ) iRecord , this ) ; if ( ORecordVersionHelper . isTombstone ( iRecord . getVersion ( ) ) ) return ( RET ) iRecord ; if ( beforeReadOperations ( iRecord ) ) return null ; iRecord . fromStream ( recordBuffer . buffer ) ; afterReadOperations ( iRecord ) ; if ( iUpdateCache ) getLocalCache ( ) . updateRecord ( iRecord ) ; return ( RET ) iRecord ; } catch ( OOfflineClusterException t ) { throw t ; } catch ( ORecordNotFoundException t ) { throw t ; } catch ( Exception t ) { if ( rid . isTemporary ( ) ) throw OException . wrapException ( new ODatabaseException ( "Error on retrieving record using temporary RID: " + rid ) , t ) ; else throw OException . wrapException ( new ODatabaseException ( "Error on retrieving record " + rid + " (cluster: " + getStorage ( ) . getPhysicalClusterNameById ( rid . getClusterId ( ) ) + ")" ) , t ) ; } finally { ORecordSerializationContext . pullContext ( ) ; getMetadata ( ) . clearThreadLocalSchemaSnapshot ( ) ; }


signature:
public class OByteSerializer { /** * { @ inheritDoc } */
@ Override public void serializeInByteBufferObject ( Byte object , ByteBuffer buffer , Object ... hints ) { } }

implementation: buffer . put ( object ) ;


signature:
public class ORidBag { /** * Notify collection that changes has been saved . Converts to non embedded implementation if needed .
 * WARNING ! Method is for internal usage .
 * @ param newPointer new collection pointer */
public void notifySaved ( OBonsaiCollectionPointer newPointer ) { } }

implementation: if ( newPointer . isValid ( ) ) { if ( isEmbedded ( ) ) { replaceWithSBTree ( newPointer ) ; } else { ( ( OSBTreeRidBag ) delegate ) . setCollectionPointer ( newPointer ) ; ( ( OSBTreeRidBag ) delegate ) . clearChanges ( ) ; } }


signature:
public class ORidBag { /** * IMPORTANT ! Only for internal usage . */
public boolean tryMerge ( final ORidBag otherValue , boolean iMergeSingleItemsOfMultiValueFields ) { } }

implementation: if ( ! isEmbedded ( ) && ! otherValue . isEmbedded ( ) ) { final OSBTreeRidBag thisTree = ( OSBTreeRidBag ) delegate ; final OSBTreeRidBag otherTree = ( OSBTreeRidBag ) otherValue . delegate ; if ( thisTree . getCollectionPointer ( ) . equals ( otherTree . getCollectionPointer ( ) ) ) { thisTree . mergeChanges ( otherTree ) ; uuid = otherValue . uuid ; return true ; } } else if ( iMergeSingleItemsOfMultiValueFields ) { final Iterator < OIdentifiable > iter = otherValue . rawIterator ( ) ; while ( iter . hasNext ( ) ) { final OIdentifiable value = iter . next ( ) ; if ( value != null ) { final Iterator < OIdentifiable > localIter = rawIterator ( ) ; boolean found = false ; while ( localIter . hasNext ( ) ) { final OIdentifiable v = localIter . next ( ) ; if ( value . equals ( v ) ) { found = true ; break ; } } if ( ! found ) add ( value ) ; } } return true ; } return false ;


signature:
public class ORidBag { /** * Silently replace delegate by tree implementation .
 * @ param pointer new collection pointer */
private void replaceWithSBTree ( OBonsaiCollectionPointer pointer ) { } }

implementation: delegate . requestDelete ( ) ; final OSBTreeRidBag treeBag = new OSBTreeRidBag ( ) ; treeBag . setCollectionPointer ( pointer ) ; treeBag . setOwner ( delegate . getOwner ( ) ) ; for ( OMultiValueChangeListener < OIdentifiable , OIdentifiable > listener : delegate . getChangeListeners ( ) ) treeBag . addChangeListener ( listener ) ; delegate = treeBag ;


signature:
public class OCommandExecutorUtility { /** * Manages cross compiler compatibility issues .
 * @ param result Result to transform */
public static Object transformResult ( Object result ) { } }

implementation:
if ( java8MethodIsArray == null || ! ( result instanceof Map ) ) { return result ; } // PATCH BY MAT ABOUT NASHORN RETURNING VALUE FOR ARRAYS .
try { if ( ( Boolean ) java8MethodIsArray . invoke ( result ) ) { List < ? > partial = new ArrayList ( ( ( Map ) result ) . values ( ) ) ; List < Object > finalResult = new ArrayList < Object > ( ) ; for ( Object o : partial ) { finalResult . add ( transformResult ( o ) ) ; } return finalResult ; } else { Map < Object , Object > mapResult = ( Map ) result ; List < Object > keys = new ArrayList < Object > ( mapResult . keySet ( ) ) ; for ( Object key : keys ) { mapResult . put ( key , transformResult ( mapResult . get ( key ) ) ) ; } return mapResult ; } } catch ( Exception e ) { OLogManager . instance ( ) . error ( OCommandExecutorUtility . class , "" , e ) ; } return result ;


signature:
public class OCommandExecutorSQLCreateCluster { /** * Execute the CREATE CLUSTER . */
public Object execute ( final Map < Object , Object > iArgs ) { } }

implementation: if ( clusterName == null ) throw new OCommandExecutionException ( "Cannot execute the command because it has not been parsed yet" ) ; final ODatabaseDocument database = getDatabase ( ) ; final int clusterId = database . getClusterIdByName ( clusterName ) ; if ( clusterId > - 1 ) throw new OCommandSQLParsingException ( "Cluster '" + clusterName + "' already exists" ) ; if ( blob ) { if ( requestedId == - 1 ) { return database . addBlobCluster ( clusterName ) ; } else { throw new OCommandExecutionException ( "Request id not supported by blob cluster creation." ) ; } } else { if ( requestedId == - 1 ) { return database . addCluster ( clusterName ) ; } else { return database . addCluster ( clusterName , requestedId , null ) ; } }


signature:
public class ODatabasePoolAbstract { /** * Closes all the databases . */
public void close ( ) { } }

implementation: lock ( ) ; try { if ( this . evictionTask != null ) { this . evictionTask . cancel ( ) ; } for ( Entry < String , OReentrantResourcePool < String , DB > > pool : pools . entrySet ( ) ) { for ( DB db : pool . getValue ( ) . getResources ( ) ) { pool . getValue ( ) . close ( ) ; try { OLogManager . instance ( ) . debug ( this , "Closing pooled database '%s'..." , db . getName ( ) ) ; ( ( ODatabasePooled ) db ) . forceClose ( ) ; OLogManager . instance ( ) . debug ( this , "OK" , db . getName ( ) ) ; } catch ( Exception e ) { OLogManager . instance ( ) . debug ( this , "Error: %d" , e . toString ( ) ) ; } } } } finally { unlock ( ) ; }


signature:
public class ODatabasePoolAbstract { /** * Removes from memory the pool associated to the closed storage . This avoids pool open against closed storages . */
public void onStorageUnregistered ( final OStorage iStorage ) { } }

implementation: final String storageURL = iStorage . getURL ( ) ; lock ( ) ; try { Set < String > poolToClose = null ; for ( Entry < String , OReentrantResourcePool < String , DB > > e : pools . entrySet ( ) ) { final int pos = e . getKey ( ) . indexOf ( "@" ) ; final String dbName = e . getKey ( ) . substring ( pos + 1 ) ; if ( storageURL . equals ( dbName ) ) { if ( poolToClose == null ) poolToClose = new HashSet < String > ( ) ; poolToClose . add ( e . getKey ( ) ) ; } } if ( poolToClose != null ) for ( String pool : poolToClose ) remove ( pool ) ; } finally { unlock ( ) ; }


signature:
public class OSQLEngine { /** * Iterates on all factories and append all function names .
 * @ return Set of all function names . */
public static Set < String > getFunctionNames ( ) { } }

implementation: final Set < String > types = new HashSet < String > ( ) ; final Iterator < OSQLFunctionFactory > ite = getFunctionFactories ( ) ; while ( ite . hasNext ( ) ) { types . addAll ( ite . next ( ) . getFunctionNames ( ) ) ; } return types ;


signature:
public class OSQLEngine { /** * Iterates on all factories and append all collate names .
 * @ return Set of all colate names . */
public static Set < String > getCollateNames ( ) { } }

implementation: final Set < String > types = new HashSet < String > ( ) ; final Iterator < OCollateFactory > ite = getCollateFactories ( ) ; while ( ite . hasNext ( ) ) { types . addAll ( ite . next ( ) . getNames ( ) ) ; } return types ;


signature:
public class OSQLEngine { /** * Iterates on all factories and append all command names .
 * @ return Set of all command names . */
public static Set < String > getCommandNames ( ) { } }

implementation: final Set < String > types = new HashSet < String > ( ) ; final Iterator < OCommandExecutorSQLFactory > ite = getCommandFactories ( ) ; while ( ite . hasNext ( ) ) { types . addAll ( ite . next ( ) . getCommandNames ( ) ) ; } return types ;


signature:
public class ORecordSerializerBinaryV1 { /** * use only for named fields */
private Tuple < Integer , OType > getFieldSizeAndTypeFromCurrentPosition ( BytesContainer bytes ) { } }

implementation: int fieldSize = OVarIntSerializer . readAsInteger ( bytes ) ; OType type = readOType ( bytes , false ) ; return new Tuple < > ( fieldSize , type ) ;


signature:
public class OHttpResponseWrapper { /** * Sets the response ' s status as HTTP code and reason .
 * @ param iHttpCode
 * Response ' s HTTP code
 * @ param iReason
 * Response ' s reason
 * @ return The object itself for fluent chained calls */
public OHttpResponseWrapper writeStatus ( final int iHttpCode , final String iReason ) throws IOException { } }

implementation: response . writeStatus ( iHttpCode , iReason ) ; return this ;


signature:
public class OHttpResponseWrapper { /** * Sets the response ' s headers specifying when using the keep - alive or not .
 * @ param iContentType
 * Response ' s content type
 * @ param iKeepAlive
 * Use the keep - alive of the connection
 * @ return The object itself for fluent chained calls */
public OHttpResponseWrapper writeHeaders ( final String iContentType , final boolean iKeepAlive ) throws IOException { } }

implementation: response . writeHeaders ( iContentType , iKeepAlive ) ; return this ;


signature:
public class OHttpResponseWrapper { /** * Writes records as response specifying a fetch - plan to serialize nested records . The records are serialized in JSON format .
 * @ param iRecords
 * List of records to serialize
 * @ param iFetchPlan
 * Fetch plan to specify nested records
 * @ return The object itself for fluent chained calls */
public OHttpResponseWrapper writeRecords ( final Object iRecords , final String iFetchPlan ) throws IOException { } }

implementation: response . writeRecords ( iRecords , iFetchPlan ) ; return this ;


signature:
public class OHttpResponseWrapper { /** * Writes a record as response . The record is serialized in JSON format .
 * @ param iRecord
 * Record to serialize
 * @ param iFetchPlan
 * Fetch plan to specify nested records
 * @ return The object itself for fluent chained calls */
public OHttpResponseWrapper writeRecord ( final ORecord iRecord , final String iFetchPlan ) throws IOException { } }

implementation: response . writeRecord ( iRecord , iFetchPlan , null ) ; return this ;


signature:
public class OHttpResponseWrapper { /** * Sends the complete HTTP response in one call .
 * @ param iCode
 * HTTP response ' s Code
 * @ param iReason
 * Response ' s reason
 * @ param iContentType
 * Response ' s content type
 * @ param iContent
 * Content to send . Content can be a string for plain text , binary data to return directly binary information ,
 * OIdentifiable for a single record and Collection < OIdentifiable > for a collection of records
 * @ return The object itself for fluent chained calls */
public OHttpResponseWrapper send ( final int iCode , final String iReason , final String iContentType , final Object iContent ) throws IOException { } }

implementation: response . send ( iCode , iReason , iContentType , iContent , null ) ; return this ;


signature:
public class OHttpResponseWrapper { /** * Sends the complete HTTP response in one call specifying a stream as content .
 * @ param iCode
 * HTTP response ' s Code
 * @ param iReason
 * Response ' s reason
 * @ param iContentType
 * Response ' s content type
 * @ param iContent
 * java . io . InputStream object
 * @ param iSize
 * Content size in bytes
 * @ return The object itself for fluent chained calls */
public OHttpResponseWrapper sendStream ( final int iCode , final String iReason , final String iContentType , final InputStream iContent , final long iSize ) throws IOException { } }

implementation: response . sendStream ( iCode , iReason , iContentType , iContent , iSize ) ; return this ;


signature:
public class ORecordIteratorCluster { /** * Return the element at the current position and move backward the cursor to the previous position available .
 * @ return the previous record found , otherwise the NoSuchElementException exception is thrown when no more records are found . */
@ SuppressWarnings ( "unchecked" ) @ Override public REC previous ( ) { } }

implementation:
checkDirection ( false ) ; if ( currentRecord != null ) { try { return ( REC ) currentRecord ; } finally { currentRecord = null ; } } // ITERATE UNTIL THE PREVIOUS GOOD RECORD
while ( hasPrevious ( ) ) { try { return ( REC ) currentRecord ; } finally { currentRecord = null ; } } return null ;


signature:
public class ORecordIteratorCluster { /** * Return the element at the current position and move forward the cursor to the next position available .
 * @ return the next record found , otherwise the NoSuchElementException exception is thrown when no more records are found . */
@ SuppressWarnings ( "unchecked" ) public REC next ( ) { } }

implementation:
checkDirection ( true ) ; ORecord record ; // ITERATE UNTIL THE NEXT GOOD RECORD
while ( hasNext ( ) ) { // FOUND
if ( currentRecord != null ) { try { return ( REC ) currentRecord ; } finally { currentRecord = null ; } } record = getTransactionEntry ( ) ; if ( record != null ) return ( REC ) record ; } return null ;


signature:
public class ORecordIteratorCluster { /** * Move the iterator to the begin of the range . If no range was specified move to the first record of the cluster .
 * @ return The object itself */
@ Override public ORecordIteratorCluster < REC > begin ( ) { } }

implementation: browsedRecords = 0 ; updateRangesOnLiveUpdate ( ) ; resetCurrentPosition ( ) ; currentRecord = readCurrentRecord ( getRecord ( ) , + 1 ) ; return this ;


signature:
public class ORecordIteratorCluster { /** * Tell to the iterator that the upper limit must be checked at every cycle . Useful when concurrent deletes or additions change
 * the size of the cluster while you ' re browsing it . Default is false .
 * @ param iLiveUpdated True to activate it , otherwise false ( default )
 * @ see # isLiveUpdated ( ) */
@ Override public ORecordIteratorCluster < REC > setLiveUpdated ( boolean iLiveUpdated ) { } }

implementation:
super . setLiveUpdated ( iLiveUpdated ) ; // SET THE RANGE LIMITS
if ( iLiveUpdated ) { firstClusterEntry = 0L ; lastClusterEntry = Long . MAX_VALUE ; } else { final long [ ] range = database . getStorage ( ) . getClusterDataRange ( current . getClusterId ( ) ) ; firstClusterEntry = range [ 0 ] ; lastClusterEntry = range [ 1 ] ; } totalAvailableRecords = database . countClusterElements ( current . getClusterId ( ) ) ; return this ;


signature:
public class OrientDBObject { /** * Open a database specified by name using the username and password if needed
 * @ param name of the database to open
 * @ param user the username allowed to open the database
 * @ param password related to the specified username
 * @ return the opened database */
public ODatabaseObject open ( String name , String user , String password ) { } }

implementation: return new OObjectDatabaseTx ( ( ODatabaseDocumentInternal ) orientDB . open ( name , user , password ) ) ;


signature:
public class OrientDBObject { /** * Create a new database
 * @ param name database name
 * @ param type can be plocal or memory
 * @ param config database specific configuration that override the orientDB global settings where needed . */
public void create ( String name , ODatabaseType type , OrientDBConfig config ) { } }

implementation: orientDB . create ( name , type , config ) ;


signature:
public class OArrayRangeSelector { /** * @ param target
 * @ param value
 * @ param ctx
 * @ return */
public void setValue ( Object target , Object value , OCommandContext ctx ) { } }

implementation:
if ( target == null ) { return ; } if ( target . getClass ( ) . isArray ( ) ) { setArrayValue ( target , value , ctx ) ; } else if ( target instanceof List ) { setValue ( ( List ) target , value , ctx ) ; } else if ( OMultiValue . isMultiValue ( value ) ) { // TODO
} // TODO


signature:
public class ODatabaseDocumentTxPooled { /** * Avoid to close it but rather release itself to the owner pool . */
@ Override public void close ( ) { } }

implementation: if ( isClosed ( ) ) return ; checkOpenness ( ) ; if ( ownerPool != null && ownerPool . getConnectionsInCurrentThread ( getURL ( ) , userName ) > 1 ) { ownerPool . release ( this ) ; return ; } try { commit ( true ) ; } catch ( Exception e ) { OLogManager . instance ( ) . error ( this , "Error on releasing database '%s' in pool" , e , getName ( ) ) ; } try { callOnCloseListeners ( ) ; } catch ( Exception e ) { OLogManager . instance ( ) . error ( this , "Error on releasing database '%s' in pool" , e , getName ( ) ) ; } getLocalCache ( ) . clear ( ) ; if ( ownerPool != null ) { final ODatabaseDocumentPool localCopy = ownerPool ; ownerPool = null ; localCopy . release ( this ) ; } ODatabaseRecordThreadLocal . instance ( ) . remove ( ) ;


signature:
public class OSBTreeCollectionManagerShared { /** * Change UUID to null to prevent its serialization to disk . */
@ Override public UUID listenForChanges ( ORidBag collection ) { } }

implementation: UUID ownerUUID = collection . getTemporaryId ( ) ; if ( ownerUUID != null ) { final OBonsaiCollectionPointer pointer = collection . getPointer ( ) ; Map < UUID , OBonsaiCollectionPointer > changedPointers = collectionPointerChanges . get ( ) ; if ( pointer != null && pointer . isValid ( ) ) { changedPointers . put ( ownerUUID , pointer ) ; } } return null ;


signature:
public class ODistributedDatabaseImpl { /** * Distributed requests against the available workers by using one queue per worker . This guarantee the sequence of the operations
 * against the same record cluster . */
public synchronized void processRequest ( final ODistributedRequest request , final boolean waitForAcceptingRequests ) { } }

implementation:
if ( ! running ) { throw new ODistributedException ( "Server is going down or is removing the database:'" + getDatabaseName ( ) + "' discarding" ) ; } final ORemoteTask task = request . getTask ( ) ; if ( waitForAcceptingRequests ) { waitIsReady ( task ) ; if ( ! running ) { throw new ODistributedException ( "Server is going down or is removing the database:'" + getDatabaseName ( ) + "' discarding" ) ; } } totalReceivedRequests . incrementAndGet ( ) ; // final ODistributedMomentum lastMomentum = filterByMomentum . get ( ) ;
// if ( lastMomentum ! = null & & task instanceof OAbstractReplicatedTask ) {
// final OLogSequenceNumber taskLastLSN = ( ( OAbstractReplicatedTask ) task ) . getLastLSN ( ) ;
// final String sourceServer = manager . getNodeNameById ( request . getId ( ) . getNodeId ( ) ) ;
// final OLogSequenceNumber lastLSNFromMomentum = lastMomentum . getLSN ( sourceServer ) ;
// if ( taskLastLSN ! = null & & lastLSNFromMomentum ! = null & & taskLastLSN . compareTo ( lastLSNFromMomentum ) < 0 ) {
// / / SKIP REQUEST BECAUSE CONTAINS AN OLD LSN
// final String msg = String . format ( " Skipped request % s on database ' % s ' because % s < current % s " , request , databaseName ,
// taskLastLSN , lastLSNFromMomentum ) ;
// ODistributedServerLog . info ( this , localNodeName , null , DIRECTION . NONE , msg ) ;
// ODistributedWorker . sendResponseBack ( this , manager , request , new ODistributedException ( msg ) ) ;
// return ;
final int [ ] partitionKeys = task . getPartitionKey ( ) ; if ( ODistributedServerLog . isDebugEnabled ( ) ) ODistributedServerLog . debug ( this , localNodeName , task . getNodeSource ( ) , DIRECTION . IN , "Request %s on database '%s' partitionKeys=%s task=%s" , request , databaseName , Arrays . toString ( partitionKeys ) , task ) ; if ( partitionKeys . length > 1 || partitionKeys [ 0 ] == - 1 ) { final Set < Integer > involvedWorkerQueues ; if ( partitionKeys . length > 1 ) involvedWorkerQueues = getInvolvedQueuesByPartitionKeys ( partitionKeys ) ; else // LOCK ALL THE QUEUES
involvedWorkerQueues = ALL_QUEUES ; // if ( ODistributedServerLog . isDebugEnabled ( ) )
ODistributedServerLog . debug ( this , localNodeName , null , DIRECTION . NONE , "Request %s on database '%s' involvedQueues=%s" , request , databaseName , involvedWorkerQueues ) ; if ( involvedWorkerQueues . size ( ) == 1 ) // JUST ONE QUEUE INVOLVED : PROCESS IT IMMEDIATELY
processRequest ( involvedWorkerQueues . iterator ( ) . next ( ) , request ) ; else { // INVOLVING MULTIPLE QUEUES
// if ( ODistributedServerLog . isDebugEnabled ( ) )
ODistributedServerLog . debug ( this , localNodeName , null , DIRECTION . NONE , "Request %s on database '%s' waiting for all the previous requests to be completed" , request , databaseName ) ; CyclicBarrier started = new CyclicBarrier ( involvedWorkerQueues . size ( ) ) ; CyclicBarrier finished = new CyclicBarrier ( involvedWorkerQueues . size ( ) ) ; // WAIT ALL THE INVOLVED QUEUES ARE FREE AND SYNCHRONIZED
for ( int queue : involvedWorkerQueues ) { ODistributedWorker worker = workerThreads . get ( queue ) ; OWaitPartitionsReadyTask waitRequest = new OWaitPartitionsReadyTask ( started , task , finished ) ; final ODistributedRequest syncRequest = new ODistributedRequest ( null , request . getId ( ) . getNodeId ( ) , request . getId ( ) . getMessageId ( ) , databaseName , waitRequest ) ; worker . processRequest ( syncRequest ) ; } } } else if ( partitionKeys . length == 1 && partitionKeys [ 0 ] == - 2 ) { // ANY PARTITION : USE THE FIRST EMPTY IF ANY , OTHERWISE THE FIRST IN THE LIST
boolean found = false ; for ( ODistributedWorker q : workerThreads ) { if ( q . isWaitingForNextRequest ( ) && q . localQueue . isEmpty ( ) ) { q . processRequest ( request ) ; found = true ; break ; } } if ( ! found ) // ALL THE THREADS ARE BUSY , SELECT THE FIRST EMPTY ONE
for ( ODistributedWorker q : workerThreads ) { if ( q . localQueue . isEmpty ( ) ) { q . processRequest ( request ) ; found = true ; break ; } } if ( ! found ) // EXEC ON THE FIRST QUEUE
workerThreads . get ( 0 ) . processRequest ( request ) ; } else if ( partitionKeys . length == 1 && partitionKeys [ 0 ] == - 3 ) { // SERVICE - LOCK
ODistributedServerLog . debug ( this , localNodeName , request . getTask ( ) . getNodeSource ( ) , DIRECTION . IN , "Request %s on database '%s' dispatched to the lock worker" , request , databaseName ) ; lockThread . processRequest ( request ) ; } else if ( partitionKeys . length == 1 && partitionKeys [ 0 ] == - 4 ) { // SERVICE - FAST _ NOLOCK
ODistributedServerLog . debug ( this , localNodeName , request . getTask ( ) . getNodeSource ( ) , DIRECTION . IN , "Request %s on database '%s' dispatched to the nowait worker" , request , databaseName ) ; nowaitThread . processRequest ( request ) ; } else { processRequest ( partitionKeys [ 0 ] , request ) ; }


signature:
public class OSessionStoragePerformanceStatistic { /** * Called inside of { @ link com . orientechnologies . orient . core . storage . impl . local . paginated . base . ODurableComponent } to notify that
 * component started to perform operation on data . After that all performance characteristic started to be gathered for this
 * component till method { @ link # completeComponentOperation ( ) } will be called .
 * Components can be stacked , so if components < code > c1 < / code > and then < code > c2 < / code > call this method than performance data for
 * both components at once started to be gathered .
 * @ param componentName Name of component which started to perform operation on data . Name is case sensitive . */
public void startComponentOperation ( String componentName , ComponentType type ) { } }

implementation: final Component currentComponent = componentsStack . peek ( ) ; if ( currentComponent != null && componentName . equals ( currentComponent . name ) ) { currentComponent . operationCount ++ ; return ; } componentsStack . push ( new Component ( componentName , type ) ) ;


signature:
public class OSessionStoragePerformanceStatistic { /** * Indicates that the most earliest component in stack of components has completed it ' s operation , so performance data for this
 * component is stopped to be gathered .
 * @ see # startComponentOperation ( String , ComponentType ) */
public void completeComponentOperation ( ) { } }

implementation: final Component currentComponent = componentsStack . peek ( ) ; if ( currentComponent == null ) return ; currentComponent . operationCount -- ; if ( currentComponent . operationCount == 0 ) { final String componentName = currentComponent . name ; PerformanceCountersHolder cHolder = countersByComponent . computeIfAbsent ( componentName , k -> currentComponent . type . newCountersHolder ( ) ) ; cHolder . operationsCount ++ ; componentsStack . pop ( ) ; makeSnapshotIfNeeded ( - 1 ) ; }


signature:
public class OSessionStoragePerformanceStatistic { /** * Read speed of data in pages per second on cache level for component name of which is passed as method argument . If null value
 * is passed then value for whole system will be returned . If data for component with passed in name does not exist then
 * < code > - 1 < / code > will be returned .
 * @ param componentName Name of component data of which should be returned . Name is case sensitive .
 * @ return Read speed of data in pages per second on cache level or value which is less than 0 , which means that value cannot be
 * calculated . */
public long getReadSpeedFromCacheInPages ( String componentName ) { } }

implementation: if ( componentName == null ) return performanceCountersHolder . getReadSpeedFromCacheInPages ( ) ; final PerformanceCountersHolder cHolder = countersByComponent . get ( componentName ) ; if ( cHolder != null ) return cHolder . getReadSpeedFromCacheInPages ( ) ; return - 1 ;


signature:
public class OSessionStoragePerformanceStatistic { /** * Read speed of data from file system in pages for component name of which is passed as method argument . If null value is passed
 * then value for whole system will be returned . If data for component with passed in name does not exist then < code > - 1 < / code >
 * will be returned .
 * @ param componentName Name of component data of which should be returned . Name is case sensitive .
 * @ return Read speed of data from file system in pages per second or value which is less than 0 , which means that value cannot be
 * calculated . */
public long getReadSpeedFromFileInPages ( String componentName ) { } }

implementation: if ( componentName == null ) return performanceCountersHolder . getReadSpeedFromFileInPages ( ) ; final PerformanceCountersHolder cHolder = countersByComponent . get ( componentName ) ; if ( cHolder != null ) return cHolder . getReadSpeedFromFileInPages ( ) ; return - 1 ;


signature:
public class OSessionStoragePerformanceStatistic { /** * Amount of pages read from cache for component name of which is passed as method argument . If null value is passed then value
 * for whole system will be returned . If data for component with passed in name does not exist then < code > - 1 < / code > will be
 * returned .
 * @ param componentName Name of component data of which should be returned . Name is case sensitive .
 * @ return Amount of pages read from cache in total . */
public long getAmountOfPagesReadFromCache ( String componentName ) { } }

implementation: if ( componentName == null ) return performanceCountersHolder . getAmountOfPagesReadFromCache ( ) ; final PerformanceCountersHolder cHolder = countersByComponent . get ( componentName ) ; if ( cHolder != null ) return cHolder . getAmountOfPagesReadFromCache ( ) ; return - 1 ;


signature:
public class OSessionStoragePerformanceStatistic { /** * Amount of pages are read from file for component name of which is passed as method argument . If null value is passed then value
 * for whole system will be returned . If data for component with passed in name does not exist then < code > - 1 < / code > will be
 * returned .
 * @ param componentName Name of component data of which should be returned . Name is case sensitive .
 * @ return Amount of pages are read from file . */
public long getAmountOfPagesReadFromFile ( String componentName ) { } }

implementation: if ( componentName == null ) return performanceCountersHolder . getAmountOfPagesReadFromFile ( ) ; final PerformanceCountersHolder cHolder = countersByComponent . get ( componentName ) ; if ( cHolder != null ) return cHolder . getAmountOfPagesReadFromFile ( ) ; return - 1 ;


signature:
public class OSessionStoragePerformanceStatistic { /** * Write speed of data in pages per second on cache level for component name of which is passed as method argument . If null value
 * is passed then value for whole system will be returned . If data for component with passed in name does not exist then
 * < code > - 1 < / code > will be returned .
 * @ param componentName Name of component data of which should be returned . Name is case sensitive .
 * @ return Write speed of data in pages per second on cache level or value which is less than 0 , which means that value cannot be
 * calculated . */
public long getWriteSpeedInCacheInPages ( String componentName ) { } }

implementation: if ( componentName == null ) return performanceCountersHolder . getWriteSpeedInCacheInPages ( ) ; final PerformanceCountersHolder cHolder = countersByComponent . get ( componentName ) ; if ( cHolder != null ) return cHolder . getWriteSpeedInCacheInPages ( ) ; return - 1 ;


signature:
public class OSessionStoragePerformanceStatistic { /** * Amount of pages written to cache for component name of which is passed as method argument . If null value is passed then value
 * for whole system will be returned . If data for component with passed in name does not exist then < code > - 1 < / code > will be
 * returned .
 * @ param componentName Name of component data of which should be returned . Name is case sensitive .
 * @ return Amount of pages written to cache . */
public long getAmountOfPagesWrittenInCache ( String componentName ) { } }

implementation: if ( componentName == null ) return performanceCountersHolder . getAmountOfPagesWrittenInCache ( ) ; final PerformanceCountersHolder cHolder = countersByComponent . get ( componentName ) ; if ( cHolder != null ) return cHolder . getAmountOfPagesWrittenInCache ( ) ; return - 1 ;


signature:
public class OSessionStoragePerformanceStatistic { /** * Percent of cache hits for component name of which is passed as method argument . If null value is passed then value for whole
 * system will be returned . If data for component with passed in name does not exist then < code > - 1 < / code > will be returned .
 * @ param componentName Name of component data of which should be returned . Name is case sensitive .
 * @ return Percent of cache hits or value which is less than 0 , which means that value cannot be calculated . */
public int getCacheHits ( String componentName ) { } }

implementation: if ( componentName == null ) return performanceCountersHolder . getCacheHits ( ) ; final PerformanceCountersHolder cHolder = countersByComponent . get ( componentName ) ; if ( cHolder != null ) return cHolder . getCacheHits ( ) ; return - 1 ;


signature:
public class OSessionStoragePerformanceStatistic { /** * Average amount of pages which were read from cache for component with given name during single data operation .
 * If null value is passed or data for component with passed in name does not exist then < code > - 1 < / code > will be returned .
 * @ param componentName Name of component data of which should be returned . Name is case sensitive .
 * @ return Average amount of pages which were read from cache for component with given name during single data operation or value
 * which is less than 0 , which means that value cannot be calculated . */
public long getAmountOfPagesPerOperation ( String componentName ) { } }

implementation: if ( componentName == null ) { return - 1 ; } final PerformanceCountersHolder cHolder = countersByComponent . get ( componentName ) ; if ( cHolder != null ) return cHolder . getAmountOfPagesPerOperation ( ) ; return - 1 ;


signature:
public class OSessionStoragePerformanceStatistic { /** * Takes performance data are split by components from last snapshot and aggregates them with data passed inside method as
 * parameter . Result of aggregation of performance data is returned inside of passed in performance data .
 * @ param counters Performance data for each component . */
public void pushComponentCounters ( Map < String , PerformanceCountersHolder > counters ) { } }

implementation: if ( snapshot == null ) return ; for ( Map . Entry < String , PerformanceCountersHolder > entry : snapshot . countersByComponent . entrySet ( ) ) { final String componentName = entry . getKey ( ) ; PerformanceCountersHolder holder = counters . computeIfAbsent ( componentName , k -> entry . getValue ( ) . newInstance ( ) ) ; entry . getValue ( ) . pushData ( holder ) ; }


signature:
public class OSessionStoragePerformanceStatistic { /** * Takes write cache performance data from last snapshot and aggregates them with data passed inside method as parameter . Result
 * of aggregation of performance data is returned inside of passed in performance data and as result of this method call .
 * @ param holder Performance data for write cache may be < code > null < / code >
 * @ return Result of aggregation of performance data */
public WritCacheCountersHolder pushWriteCacheCounters ( WritCacheCountersHolder holder ) { } }

implementation: if ( snapshot == null ) return holder ; if ( snapshot . writCacheCountersHolder == null ) return holder ; if ( holder == null ) holder = new WritCacheCountersHolder ( ) ; snapshot . writCacheCountersHolder . pushData ( holder ) ; return holder ;


signature:
public class OSessionStoragePerformanceStatistic { /** * Takes storage performance data from last snapshot and aggregates them with data passed inside method as parameter . Result of
 * aggregation of performance data is returned inside of passed in performance data and as result of this method call .
 * @ param holder Performance data for storage may be < code > null < / code >
 * @ return Result of aggregation of performance data */
public StorageCountersHolder pushStorageCounters ( StorageCountersHolder holder ) { } }

implementation: if ( snapshot == null ) return holder ; if ( snapshot . storageCountersHolder == null ) return holder ; if ( holder == null ) holder = new StorageCountersHolder ( ) ; snapshot . storageCountersHolder . pushData ( holder ) ; return holder ;


signature:
public class OSessionStoragePerformanceStatistic { /** * Takes write ahead log data from last snapshot and aggregates them with data passed inside method as parameter . Result of
 * aggregation of performance data is returned inside of passed in performance data and as result of this method call .
 * @ param holder Performance data for write ahead log may be < code > null < / code >
 * @ return Result of aggregation of performance data */
public WALCountersHolder pushWALCounters ( WALCountersHolder holder ) { } }

implementation: if ( snapshot == null ) return holder ; if ( snapshot . walCountersHolder == null ) return holder ; if ( holder == null ) holder = new WALCountersHolder ( ) ; snapshot . walCountersHolder . pushData ( holder ) ; return holder ;


signature:
public class OSessionStoragePerformanceStatistic { /** * Takes performance data for component from last snapshot and aggregates them with data passed inside method as parameter . Result
 * of aggregation of performance data is returned inside of passed in performance data .
 * @ param name Name of component for which performance data are gathered .
 * @ param holder Performance data for given component . */
public void pushComponentCounters ( String name , PerformanceCountersHolder holder ) { } }

implementation: if ( snapshot == null ) return ; final PerformanceCountersHolder countersHolder = snapshot . countersByComponent . get ( name ) ; if ( countersHolder != null ) { countersHolder . pushData ( holder ) ; }


signature:
public class OSessionStoragePerformanceStatistic { /** * Converts properties of given class into values of fields of returned document . Names of fields equal to names of properties .
 * All data related to separate components are stored in field < code > dataByComponent < / code > map which has type
 * { @ link OType # EMBEDDEDMAP } where key of map entry is name of component , and value is document which contains the same fields as
 * high level document but with values for single component not whole system .
 * Write ahead log performance data are stored inside of < code > walData < / code > field .
 * @ return Performance characteristics of storage gathered after call of
 * { @ link OAbstractPaginatedStorage # startGatheringPerformanceStatisticForCurrentThread ( ) } */
public ODocument toDocument ( ) { } }

implementation: final ODocument document = performanceCountersHolder . toDocument ( ) ; document . field ( "commitTime" , getCommitTime ( ) , OType . LONG ) ; final Map < String , ODocument > countersMap = new HashMap < > ( ) ; for ( Map . Entry < String , PerformanceCountersHolder > entry : countersByComponent . entrySet ( ) ) { countersMap . put ( entry . getKey ( ) , entry . getValue ( ) . toDocument ( ) ) ; } document . field ( "dataByComponent" , countersMap , OType . EMBEDDEDMAP ) ; if ( walCountersHolder != null ) { final ODocument wal = walCountersHolder . toDocument ( ) ; document . field ( "walData" , wal , OType . EMBEDDED ) ; } return document ;


signature:
public class OSessionStoragePerformanceStatistic { /** * Increments counter of page accesses from cache .
 * If you wish to gather statistic for current durable component please call
 * { @ link # startComponentOperation ( String , ComponentType ) } method before the call and { @ link # completeComponentOperation ( ) } after
 * the call . */
public void incrementPageAccessOnCacheLevel ( boolean cacheHit ) { } }

implementation: performanceCountersHolder . cacheAccessCount ++ ; if ( cacheHit ) performanceCountersHolder . cacheHit ++ ; for ( Component component : componentsStack ) { final String componentName = component . name ; PerformanceCountersHolder cHolder = countersByComponent . computeIfAbsent ( componentName , k -> component . type . newCountersHolder ( ) ) ; cHolder . cacheAccessCount ++ ; if ( cacheHit ) cHolder . cacheHit ++ ; } makeSnapshotIfNeeded ( - 1 ) ;


signature:
public class OSessionStoragePerformanceStatistic { /** * Stops and records results of timer which counts how much time was spent on operation of flush pages in write cache .
 * @ param pagesFlushed Amount of pages were flushed during this operation . */
public void stopWriteCacheFlushTimer ( int pagesFlushed ) { } }

implementation:
// lazy initialization to prevent memory consumption
if ( writCacheCountersHolder == null ) writCacheCountersHolder = new WritCacheCountersHolder ( ) ; final long endTs = nanoTimer . getNano ( ) ; final long timeDiff = ( endTs - timeStamps . pop ( ) ) ; writCacheCountersHolder . flushOperationsCount ++ ; writCacheCountersHolder . amountOfPagesFlushed += pagesFlushed ; writCacheCountersHolder . flushOperationsTime += timeDiff ; makeSnapshotIfNeeded ( endTs ) ;


signature:
public class OSessionStoragePerformanceStatistic { /** * Stops and records results of timer which counts how much time was spent on fuzzy checkpoint operation . */
public void stopFuzzyCheckpointTimer ( ) { } }

implementation: if ( writCacheCountersHolder == null ) writCacheCountersHolder = new WritCacheCountersHolder ( ) ; final long endTs = nanoTimer . getNano ( ) ; final long timeDiff = ( endTs - timeStamps . pop ( ) ) ; writCacheCountersHolder . fuzzyCheckpointCount ++ ; writCacheCountersHolder . fuzzyCheckpointTime += timeDiff ; makeSnapshotIfNeeded ( endTs ) ;


signature:
public class OSessionStoragePerformanceStatistic { /** * Stops and records results of timer which counts how much time was spent on read of page from disk cache .
 * If you wish to gather statistic for current durable component please call
 * { @ link # startComponentOperation ( String , ComponentType ) } method before the call and { @ link # completeComponentOperation ( ) } after
 * the call . */
public void stopPageReadFromCacheTimer ( ) { } }

implementation: final long endTs = nanoTimer . getNano ( ) ; final long timeDiff = ( endTs - timeStamps . pop ( ) ) ; performanceCountersHolder . pageReadFromCacheTime += timeDiff ; performanceCountersHolder . pageReadFromCacheCount ++ ; for ( Component component : componentsStack ) { final String componentName = component . name ; PerformanceCountersHolder cHolder = countersByComponent . computeIfAbsent ( componentName , k -> component . type . newCountersHolder ( ) ) ; cHolder . pageReadFromCacheTime += timeDiff ; cHolder . pageReadFromCacheCount ++ ; } final Component currentComponent = componentsStack . peek ( ) ; if ( currentComponent != null ) { PerformanceCountersHolder currentHolder = countersByComponent . get ( currentComponent . name ) ; if ( currentHolder . currentOperation != null ) { currentHolder . currentOperation . incrementOperationsCounter ( 1 , 0 ) ; } } makeSnapshotIfNeeded ( endTs ) ;


signature:
public class OSessionStoragePerformanceStatistic { /** * Stops and records results of timer which counts how much time was spent on full checkpoint operation . */
public void stopFullCheckpointTimer ( ) { } }

implementation: final long endTs = nanoTimer . getNano ( ) ; final long timeDiff = ( endTs - timeStamps . pop ( ) ) ; if ( storageCountersHolder == null ) storageCountersHolder = new StorageCountersHolder ( ) ; storageCountersHolder . fullCheckpointOperationsCount ++ ; storageCountersHolder . fullCheckpointOperationsTime += timeDiff ; makeSnapshotIfNeeded ( endTs ) ;


signature:
public class OSessionStoragePerformanceStatistic { /** * Stops and records results of timer which counts how much time was spent to write page to disk cache .
 * If you wish to gather statistic for current durable component please call
 * { @ link # startComponentOperation ( String , ComponentType ) } method before the call and { @ link # completeComponentOperation ( ) } after
 * the call . */
public void stopPageWriteInCacheTimer ( ) { } }

implementation: final long endTs = nanoTimer . getNano ( ) ; final long timeDiff = ( endTs - timeStamps . pop ( ) ) ; performanceCountersHolder . pageWriteToCacheTime += timeDiff ; performanceCountersHolder . pageWriteToCacheCount ++ ; for ( Component component : componentsStack ) { final String componentName = component . name ; PerformanceCountersHolder cHolder = countersByComponent . computeIfAbsent ( componentName , k -> component . type . newCountersHolder ( ) ) ; cHolder . pageWriteToCacheTime += timeDiff ; cHolder . pageWriteToCacheCount ++ ; } makeSnapshotIfNeeded ( endTs ) ;


signature:
public class OSessionStoragePerformanceStatistic { /** * Stops and records results of timer which counts how much time was spent on atomic operation commit . */
public void stopCommitTimer ( ) { } }

implementation: final long endTs = nanoTimer . getNano ( ) ; final long timeDiff = ( endTs - timeStamps . pop ( ) ) ; performanceCountersHolder . commitTime += timeDiff ; performanceCountersHolder . commitCount ++ ; makeSnapshotIfNeeded ( endTs ) ;


signature:
public class OSessionStoragePerformanceStatistic { /** * Stops and records results of timer which counts how much time was spent on logging of single write ahead log record .
 * @ param isStartRecord Indicates whether we logged " start atomic operation " record
 * @ param isStopRecord Indicates whether we logged " stop atomic operation " record */
public void stopWALRecordTimer ( boolean isStartRecord , boolean isStopRecord ) { } }

implementation: final long endTs = nanoTimer . getNano ( ) ; final long timeDiff = ( endTs - timeStamps . pop ( ) ) ; if ( walCountersHolder == null ) walCountersHolder = new WALCountersHolder ( ) ; walCountersHolder . logRecordCount ++ ; walCountersHolder . logRecordTime += timeDiff ; if ( isStartRecord ) { walCountersHolder . startRecordCount ++ ; walCountersHolder . startRecordTime += timeDiff ; } else if ( isStopRecord ) { walCountersHolder . stopRecordCount ++ ; walCountersHolder . stopRecordTime += timeDiff ; } makeSnapshotIfNeeded ( endTs ) ;


signature:
public class OSessionStoragePerformanceStatistic { /** * Stops timer and records how much time was spent on flushing of data from write ahead log cache . */
public void stopWALFlushTimer ( ) { } }

implementation: final long endTs = nanoTimer . getNano ( ) ; final long timeDiff = ( endTs - timeStamps . pop ( ) ) ; if ( walCountersHolder == null ) walCountersHolder = new WALCountersHolder ( ) ; walCountersHolder . flushCount ++ ; walCountersHolder . flushTime += timeDiff ; makeSnapshotIfNeeded ( endTs ) ;


signature:
public class OSessionStoragePerformanceStatistic { /** * Makes snapshot of data if time for next snapshot is passed . Also clear all data if { @ link # cleanUpInterval } interval is over .
 * @ param currentTime Time of last measurement in nanoseconds or - 1 if time is unknown */
private void makeSnapshotIfNeeded ( long currentTime ) { } }

implementation: if ( currentTime < 0 ) { currentTime = nanoTimer . getNano ( ) ; } if ( lastSnapshotTimestamp == - 1 ) lastSnapshotTimestamp = 0 ; if ( lastSnapshotTimestamp < 0 || currentTime - lastSnapshotTimestamp >= intervalBetweenSnapshots ) { snapshot = new PerformanceSnapshot ( performanceCountersHolder , countersByComponent , writCacheCountersHolder , storageCountersHolder , walCountersHolder ) ; lastSnapshotTimestamp = currentTime ; } if ( cleanUpInterval > 0 ) { if ( currentTime - lastCleanUpTimeStamp >= cleanUpInterval ) { performanceCountersHolder . clean ( ) ; for ( PerformanceCountersHolder pch : countersByComponent . values ( ) ) { pch . clean ( ) ; } if ( writCacheCountersHolder != null ) writCacheCountersHolder . clean ( ) ; if ( storageCountersHolder != null ) storageCountersHolder . clean ( ) ; if ( writCacheCountersHolder != null ) walCountersHolder . clean ( ) ; lastCleanUpTimeStamp = currentTime ; } }


signature:
public class OJMXPlugin { /** * ( non - Javadoc )
 * @ see com . orientechnologies . orient . server . handler . OServerHandlerAbstract # shutdown ( ) */
@ Override public void shutdown ( ) { } }

implementation: try { MBeanServer mBeanServer = ManagementFactory . getPlatformMBeanServer ( ) ; if ( onProfiler != null ) if ( mBeanServer . isRegistered ( onProfiler ) ) mBeanServer . unregisterMBean ( onProfiler ) ; } catch ( Exception e ) { OLogManager . instance ( ) . error ( this , "OrientDB Server v" + OConstants . getVersion ( ) + " unregisterMBean error" , e ) ; }


signature:
public class OStatementCache { /** * returns an already parsed SQL executor , taking it from the cache if it exists or creating a new one ( parsing and then putting
 * it into the cache ) if it doesn ' t
 * @ param statement the SQL statement
 * @ param db the current DB instance . If null , cache is ignored and a new executor is created through statement parsing
 * @ return a statement executor from the cache */
public static OStatement get ( String statement , ODatabaseDocumentInternal db ) { } }

implementation: if ( db == null ) { return parse ( statement ) ; } OStatementCache resource = db . getSharedContext ( ) . getStatementCache ( ) ; return resource . get ( statement ) ;


signature:
public class OStatementCache { /** * @ param statement an SQL statement
 * @ return the corresponding executor , taking it from the internal cache , if it exists */
public OStatement get ( String statement ) { } }

implementation:
OStatement result ; synchronized ( map ) { // LRU
result = map . remove ( statement ) ; if ( result != null ) { map . put ( statement , result ) ; } } if ( result == null ) { result = parse ( statement ) ; synchronized ( map ) { map . put ( statement , result ) ; } } return result ;


signature:
public class OStatementCache { /** * parses an SQL statement and returns the corresponding executor
 * @ param statement the SQL statement
 * @ return the corresponding executor
 * @ throws OCommandSQLParsingException if the input parameter is not a valid SQL statement */
protected static OStatement parse ( String statement ) throws OCommandSQLParsingException { } }

implementation: try { ODatabaseDocumentInternal db = ODatabaseRecordThreadLocal . instance ( ) . getIfDefined ( ) ; InputStream is ; if ( db == null ) { is = new ByteArrayInputStream ( statement . getBytes ( ) ) ; } else { try { is = new ByteArrayInputStream ( statement . getBytes ( db . getStorage ( ) . getConfiguration ( ) . getCharset ( ) ) ) ; } catch ( UnsupportedEncodingException e2 ) { OLogManager . instance ( ) . warn ( null , "Unsupported charset for database " + db + " " + db . getStorage ( ) . getConfiguration ( ) . getCharset ( ) ) ; is = new ByteArrayInputStream ( statement . getBytes ( ) ) ; } } OrientSql osql = null ; if ( db == null ) { osql = new OrientSql ( is ) ; } else { try { osql = new OrientSql ( is , db . getStorage ( ) . getConfiguration ( ) . getCharset ( ) ) ; } catch ( UnsupportedEncodingException e2 ) { OLogManager . instance ( ) . warn ( null , "Unsupported charset for database " + db + " " + db . getStorage ( ) . getConfiguration ( ) . getCharset ( ) ) ; osql = new OrientSql ( is ) ; } } OStatement result = osql . parse ( ) ; result . originalStatement = statement ; return result ; } catch ( ParseException e ) { throwParsingException ( e , statement ) ; } catch ( TokenMgrError e2 ) { throwParsingException ( e2 , statement ) ; } return null ;


signature:
public class ONodeManager { /** * / * = = = = = START / STOP = = = = = */
protected void start ( ) { } }

implementation: try { initNetwork ( ) ; initReceiveMessages ( ) ; initDiscoveryPing ( ) ; initCheckLeader ( ) ; initCheckDisconnect ( ) ; } catch ( Exception ex ) { OLogManager . instance ( ) . error ( this , "Cannot start distributed node discovery: " + ex . getMessage ( ) , ex ) ; }


signature:
public class ONodeManager { /** * inits the procedure that listens to pings from other servers , eg . that discovers other nodes in the network
 * @ throws IOException */
protected void initReceiveMessages ( ) throws IOException { } }

implementation: messageThread = new Thread ( ( ) -> { while ( ! Thread . interrupted ( ) ) { receiveMessages ( ) ; } } ) ; messageThread . setName ( "OrientDB_DistributedDiscoveryThread" ) ; messageThread . setDaemon ( true ) ; messageThread . start ( ) ;


signature:
public class ONodeManager { /** * init the procedure that sends pings to other servers , ie . that notifies that you are alive */
protected void initDiscoveryPing ( ) { } }

implementation: discoveryTimer = new TimerTask ( ) { @ Override public void run ( ) { try { sendPing ( ) ; if ( running ) { initDiscoveryPing ( ) ; } } catch ( Exception e ) { e . printStackTrace ( ) ; } } } ; taskScheduler . scheduleOnce ( discoveryTimer , discoveryPingIntervalMillis ) ;


signature:
public class ONodeManager { /** * inits the procedure that checks if a server is no longer available , ie . if he did not ping for a long time */
protected void initCheckDisconnect ( ) { } }

implementation: disconnectTimer = new TimerTask ( ) { public void run ( ) { try { checkIfKnownServersAreAlive ( ) ; if ( running ) { initCheckDisconnect ( ) ; } } catch ( Exception e ) { e . printStackTrace ( ) ; } } } ; taskScheduler . scheduleOnce ( disconnectTimer , discoveryPingIntervalMillis ) ;


signature:
public class ONodeManager { /** * init the procedure that sends pings to other servers , ie . that notifies that you are alive */
private void initCheckLeader ( ) { } }

implementation: checkerTimer = new TimerTask ( ) { @ Override public void run ( ) { try { if ( running ) { checkLeader ( ) ; initCheckLeader ( ) ; } } catch ( Exception e ) { e . printStackTrace ( ) ; } } } ; taskScheduler . scheduleOnce ( checkerTimer , checkLeaderIntervalMillis ) ;


signature:
public class ONodeManager { /** * / * = = = = = NETWORK UTILITIES = = = = = */
protected byte [ ] serializeMessage ( OBroadcastMessage message ) throws Exception { } }

implementation: ByteArrayOutputStream buffer = new ByteArrayOutputStream ( ) ; message . write ( new DataOutputStream ( buffer ) ) ; return encrypt ( buffer . toByteArray ( ) ) ;


signature:
public class ONodeManager { /** * / * = = = = = ENCRYPTION = = = = = */
private byte [ ] encrypt ( byte [ ] data ) throws Exception { } }

implementation: if ( config . getGroupPassword ( ) == null ) { return data ; } Cipher cipher = Cipher . getInstance ( "AES/CBC/PKCS5Padding" ) ; byte [ ] iv = cipher . getParameters ( ) . getParameterSpec ( IvParameterSpec . class ) . getIV ( ) ; IvParameterSpec ivSpec = new IvParameterSpec ( iv ) ; SecretKeySpec keySpec = new SecretKeySpec ( paddedPassword ( config . getGroupPassword ( ) ) , "AES" ) ; cipher . init ( Cipher . ENCRYPT_MODE , keySpec , ivSpec ) ; ByteArrayOutputStream stream = new ByteArrayOutputStream ( ) ; DataOutput output = new DataOutputStream ( stream ) ; output . writeInt ( iv . length ) ; output . write ( iv ) ; byte [ ] cypher = cipher . doFinal ( data ) ; output . writeInt ( cypher . length ) ; output . write ( cypher ) ; return stream . toByteArray ( ) ;


signature:
public class OrientElement { /** * Removes the Element from the Graph . In case the element is a Vertex , all the incoming and outgoing edges are automatically
 * removed too . */
void removeRecord ( ) { } }

implementation: checkIfAttached ( ) ; final OrientBaseGraph graph = getGraph ( ) ; graph . setCurrentGraphInThreadLocal ( ) ; graph . autoStartTransaction ( ) ; if ( checkDeletedInTx ( ) ) graph . throwRecordNotFoundException ( getIdentity ( ) , "The graph element with id " + getIdentity ( ) + " not found" ) ; try { getRecord ( ) . load ( ) ; } catch ( ORecordNotFoundException e ) { graph . throwRecordNotFoundException ( getIdentity ( ) , e . getMessage ( ) ) ; } getRecord ( ) . delete ( ) ;


signature:
public class OrientElement { /** * ( Blueprints Extension ) Sets multiple properties in one shot against Vertices and Edges . This improves performance avoiding to
 * save the graph element at every property set . < br >
 * Example :
 * < code >
 * vertex . setProperties ( " name " , " Jill " , " age " , 33 , " city " , " Rome " , " born " , " Victoria , TX " ) ;
 * < / code > You can also pass a Map of values as first argument . In this case all the map entries will be set as element
 * properties :
 * < code >
 * Map < String , Object > props = new HashMap < String , Object > ( ) ;
 * props . put ( " name " , " Jill " ) ;
 * props . put ( " age " , 33 ) ;
 * props . put ( " city " , " Rome " ) ;
 * props . put ( " born " , " Victoria , TX " ) ;
 * vertex . setProperties ( props ) ;
 * < / code >
 * @ param fields Odd number of fields to set as repeating pairs of key , value , or if one parameter is received and it ' s a Map , the Map
 * entries are used as field key / value pairs .
 * @ param < T >
 * @ return */
public < T extends OrientElement > T setProperties ( final Object ... fields ) { } }

implementation: if ( checkDeletedInTx ( ) ) graph . throwRecordNotFoundException ( getIdentity ( ) , "The graph element " + getIdentity ( ) + " has been deleted" ) ; setPropertiesInternal ( fields ) ; save ( ) ; return ( T ) this ;


signature:
public class OrientElement { /** * Sets a Property value .
 * @ param key Property name
 * @ param value Property value */
@ Override public void setProperty ( final String key , final Object value ) { } }

implementation: if ( checkDeletedInTx ( ) ) graph . throwRecordNotFoundException ( getIdentity ( ) , "The graph element " + getIdentity ( ) + " has been deleted" ) ; validateProperty ( this , key , value ) ; final OrientBaseGraph graph = getGraph ( ) ; if ( graph != null ) graph . autoStartTransaction ( ) ; getRecord ( ) . field ( key , value ) ; if ( graph != null ) save ( ) ;


signature:
public class OrientElement { /** * Removes a Property .
 * @ param key Property name
 * @ return Old value if any */
@ Override public < T > T removeProperty ( final String key ) { } }

implementation: if ( checkDeletedInTx ( ) ) throw new IllegalStateException ( "The vertex " + getIdentity ( ) + " has been deleted" ) ; final OrientBaseGraph graph = getGraph ( ) ; if ( graph != null ) graph . autoStartTransaction ( ) ; final Object oldValue = getRecord ( ) . removeField ( key ) ; if ( graph != null ) save ( ) ; return ( T ) oldValue ;


signature:
public class OrientElement { /** * Returns a Property value .
 * @ param key Property name
 * @ return Property value if any , otherwise NULL . */
@ Override public < T > T getProperty ( final String key ) { } }

implementation:
if ( key == null ) return null ; final OrientBaseGraph graph = getGraph ( ) ; if ( key . equals ( "_class" ) ) return ( T ) ODocumentInternal . getImmutableSchemaClass ( getRecord ( ) ) . getName ( ) ; else if ( key . equals ( "_version" ) ) return ( T ) new Integer ( getRecord ( ) . getVersion ( ) ) ; else if ( key . equals ( "_rid" ) ) return ( T ) rawElement . getIdentity ( ) . toString ( ) ; final ODocument record = getRecord ( ) ; if ( record == null ) // NO RECORD
return null ; final Object fieldValue = record . field ( key ) ; if ( graph != null && fieldValue instanceof OIdentifiable && ! ( ( ( OIdentifiable ) fieldValue ) . getRecord ( ) instanceof OBlob ) ) { ODocument fieldRecord = ( ( OIdentifiable ) fieldValue ) . getRecord ( ) ; if ( fieldRecord != null ) { final OClass schemaClass = fieldRecord . getSchemaClass ( ) ; if ( schemaClass != null && ( schemaClass . isVertexType ( ) || schemaClass . isEdgeType ( ) ) ) { // CONVERT IT TO VERTEX / EDGE
return ( T ) graph . getElement ( fieldValue ) ; } } return ( T ) fieldValue ; } else if ( ! ( fieldValue instanceof Map ) && OMultiValue . isMultiValue ( fieldValue ) && OMultiValue . getFirstValue ( fieldValue ) instanceof OIdentifiable ) { final OIdentifiable firstValue = ( OIdentifiable ) OMultiValue . getFirstValue ( fieldValue ) ; if ( firstValue instanceof ODocument ) { final ODocument document = ( ODocument ) firstValue ; // / clusterId - 2 Is considered a projection so does not have a class but is a not embedded record
if ( document . getIdentity ( ) . getClusterId ( ) != - 2 && ( document . isEmbedded ( ) || ODocumentInternal . getImmutableSchemaClass ( document ) == null ) ) return ( T ) fieldValue ; } if ( graph != null ) // CONVERT IT TO ITERABLE < VERTEX / EDGE >
return ( T ) new OrientElementIterable < OrientElement > ( graph , OMultiValue . getMultiValueIterable ( fieldValue ) ) ; } return ( T ) fieldValue ;


signature:
public class OrientElement { /** * ( Blueprints Extension ) Saves current element to a particular cluster . You don ' t need to call save ( ) unless you ' re working
 * against Temporary Vertices .
 * @ param iClusterName Cluster name or null to use the default " E " */
public void save ( final String iClusterName ) { } }

implementation: final OrientBaseGraph graph = checkIfAttached ( ) ; graph . setCurrentGraphInThreadLocal ( ) ; if ( rawElement instanceof ODocument ) if ( iClusterName != null ) rawElement = ( ( ODocument ) rawElement ) . save ( iClusterName ) ; else rawElement = ( ( ODocument ) rawElement ) . save ( ) ;


signature:
public class OrientElement { /** * ( Blueprints Extension ) Fills the Element from a byte [ ]
 * @ param stream byte array representation of the object
 * @ throws OSerializationException */
@ Override public OSerializableStream fromStream ( final byte [ ] stream ) throws OSerializationException { } }

implementation: final ODocument record = getRecord ( ) ; ( ( ORecordId ) record . getIdentity ( ) ) . fromString ( new String ( stream ) ) ; return this ;


signature:
public class OrientElement { /** * ( Blueprints Extension ) Returns the record ' s identity . */
@ Override public ORID getIdentity ( ) { } }

implementation:
if ( rawElement == null ) return ORecordId . EMPTY_RECORD_ID ; final ORID rid = rawElement . getIdentity ( ) ; if ( ! rid . isValid ( ) ) { final OrientBaseGraph graph = getGraph ( ) ; if ( graph != null ) { // SAVE THE RECORD TO OBTAIN A VALID RID
graph . setCurrentGraphInThreadLocal ( ) ; graph . autoStartTransaction ( ) ; save ( ) ; } } return rid ;


signature:
public class OrientElement { /** * ( Blueprints Extension ) Returns the underlying record . */
@ Override public ODocument getRecord ( ) { } }

implementation:
if ( rawElement == null ) return null ; if ( rawElement instanceof ODocument ) return ( ODocument ) rawElement ; final ODocument doc = rawElement . getRecord ( ) ; if ( doc == null ) return null ; // CHANGE THE RID - > DOCUMENT
rawElement = doc ; return doc ;


signature:
public class OrientElement { /** * ( Blueprints Extension ) Removes the reference to the current graph instance to let working offline . To reattach it use @ attach .
 * This methods works only in " classic detach / attach mode " when dettachment / attachment is done manually , by default it is done
 * automatically , and currently active graph connection will be used as graph elements owner .
 * @ return Current object to allow chained calls .
 * @ see # attach ( OrientBaseGraph ) , # isDetached */
public OrientElement detach ( ) { } }

implementation:
// EARLY UNMARSHALL FIELDS
getRecord ( ) . setLazyLoad ( false ) ; getRecord ( ) . fieldNames ( ) ; // COPY GRAPH SETTINGS TO WORK OFFLINE
if ( graph != null ) { settings = graph . settings . copy ( ) ; graph = null ; } classicDetachMode = true ; return this ;


signature:
public class OrientElement { /** * ( Blueprints Extension ) Replaces current graph instance with new one on @ detach - ed elements . Use this method to pass elements
 * between graphs or to switch between Tx and NoTx instances .
 * This methods works only in " classic detach / attach mode " when detachment / attachment is done manually , by default it is done
 * automatically , and currently active graph connection will be used as graph elements owner .
 * To set " classic detach / attach mode " please set custom database parameter < code > classicDetachMode < / code > to < code > true < / code > .
 * @ param iNewGraph The new Graph instance to use .
 * @ return Current object to allow chained calls .
 * @ see # detach ( ) , # isDetached */
public OrientElement attach ( final OrientBaseGraph iNewGraph ) { } }

implementation:
if ( iNewGraph == null ) throw new IllegalArgumentException ( "Graph is null" ) ; classicDetachMode = true ; graph = iNewGraph ; // LINK THE GRAPHS SETTINGS
settings = graph . settings ; return this ;


signature:
public class OrientElement { /** * ( Blueprints Extension ) Returns the Graph instance associated to the current element . On @ detach ed elements returns NULL . */
public OrientBaseGraph getGraph ( ) { } }

implementation: if ( classicDetachMode ) return graph ; OrientBaseGraph result = OrientBaseGraph . getActiveGraph ( ) ; if ( result == null && this . graph != null && ! graph . isClosed ( ) ) { result = graph ; } return result ;


signature:
public class OrientElement { /** * ( Blueprints Extension ) Validates an Element property .
 * @ param element Element instance
 * @ param key Property name
 * @ param value property value
 * @ throws IllegalArgumentException */
public final void validateProperty ( final Element element , final String key , final Object value ) throws IllegalArgumentException { } }

implementation: if ( settings . isStandardElementConstraints ( ) && null == value ) throw ExceptionFactory . propertyValueCanNotBeNull ( ) ; if ( null == key ) throw ExceptionFactory . propertyKeyCanNotBeNull ( ) ; if ( settings . isStandardElementConstraints ( ) && key . equals ( StringFactory . ID ) ) throw ExceptionFactory . propertyKeyIdIsReserved ( ) ; if ( element instanceof Edge && key . equals ( StringFactory . LABEL ) ) throw ExceptionFactory . propertyKeyLabelIsReservedForEdges ( ) ; if ( key . isEmpty ( ) ) throw ExceptionFactory . propertyKeyCanNotBeEmpty ( ) ;


signature:
public class OrientElement { /** * Check if a class already exists , otherwise create it at the fly . If a transaction is running commit changes , create the class
 * and begin a new transaction .
 * @ param className Class ' s name */
protected String checkForClassInSchema ( final String className ) { } }

implementation:
if ( className == null ) return null ; OrientBaseGraph graph = getGraph ( ) ; if ( graph == null ) return className ; final OSchema schema = graph . getRawGraph ( ) . getMetadata ( ) . getSchema ( ) ; if ( ! schema . existsClass ( className ) ) { // CREATE A NEW CLASS AT THE FLY
try { graph . executeOutsideTx ( new OCallable < OClass , OrientBaseGraph > ( ) { @ Override public OClass call ( final OrientBaseGraph g ) { return schema . createClass ( className , schema . getClass ( getBaseClassName ( ) ) ) ; } } , "Committing the active transaction to create the new type '" , className , "' as subclass of '" , getBaseClassName ( ) , "'. The transaction will be reopen right after that. To avoid this behavior create the classes outside the transaction" ) ; } catch ( OSchemaException e ) { if ( ! schema . existsClass ( className ) ) throw e ; } } else { // CHECK THE CLASS INHERITANCE
final OClass cls = schema . getClass ( className ) ; if ( ! cls . isSubClassOf ( getBaseClassName ( ) ) ) throw new IllegalArgumentException ( "Class '" + className + "' is not an instance of " + getBaseClassName ( ) ) ; } return className ;


signature:
public class OrientElement { /** * ( Blueprints Extension ) Sets multiple properties in one shot against Vertices and Edges without saving the element . This
 * improves performance avoiding to save the graph element at every property set . Example :
 * < code >
 * vertex . setProperties ( " name " , " Jill " , " age " , 33 , " city " , " Rome " , " born " , " Victoria , TX " ) ;
 * < / code > You can also pass a Map of values as first argument . In this case all the map entries will be set as element
 * properties :
 * < code >
 * Map < String , Object > props = new HashMap < String , Object > ( ) ;
 * props . put ( " name " , " Jill " ) ;
 * props . put ( " age " , 33 ) ;
 * props . put ( " city " , " Rome " ) ;
 * props . put ( " born " , " Victoria , TX " ) ;
 * vertex . setProperties ( props ) ;
 * < / code >
 * @ param fields Odd number of fields to set as repeating pairs of key , value , or if one parameter is received and it ' s a Map , the Map
 * entries are used as field key / value pairs .
 * @ param < T >
 * @ return */
protected < T extends OrientElement > T setPropertiesInternal ( final Object ... fields ) { } }

implementation:
OrientBaseGraph graph = getGraph ( ) ; if ( fields != null && fields . length > 0 && fields [ 0 ] != null ) { if ( graph != null ) graph . autoStartTransaction ( ) ; if ( fields . length == 1 ) { Object f = fields [ 0 ] ; if ( f instanceof Map < ? , ? > ) { for ( Map . Entry < Object , Object > entry : ( ( Map < Object , Object > ) f ) . entrySet ( ) ) setPropertyInternal ( this , ( ODocument ) rawElement . getRecord ( ) , entry . getKey ( ) . toString ( ) , entry . getValue ( ) ) ; } else if ( f instanceof Collection ) { for ( Object o : ( Collection ) f ) { if ( ! ( o instanceof OPair ) ) throw new IllegalArgumentException ( "Invalid fields: expecting a pairs of fields as String,Object, but found the item: " + o ) ; final OPair entry = ( OPair ) o ; setPropertyInternal ( this , ( ODocument ) rawElement . getRecord ( ) , entry . getKey ( ) . toString ( ) , entry . getValue ( ) ) ; } } else throw new IllegalArgumentException ( "Invalid fields: expecting a pairs of fields as String,Object or a single Map<String,Object>, but found: " + f ) ; } else { if ( fields . length % 2 != 0 ) throw new IllegalArgumentException ( "Invalid fields: expecting a pairs of fields as String,Object or a single Map<String,Object>, but found: " + Arrays . toString ( fields ) ) ; // SET THE FIELDS
for ( int i = 0 ; i < fields . length ; i += 2 ) setPropertyInternal ( this , ( ODocument ) rawElement . getRecord ( ) , fields [ i ] . toString ( ) , fields [ i + 1 ] ) ; } } return ( T ) this ;


signature:
public class OContextConfiguration { /** * @ param config Global configuration parameter .
 * @ return Value of configuration parameter stored in this context as enumeration if such one exists , otherwise value stored in
 * passed in { @ link OGlobalConfiguration } instance .
 * @ throws ClassCastException if stored value can not be casted and parsed from string to passed in enumeration class .
 * @ throws IllegalArgumentException if value associated with configuration parameter is a string bug can not be converted to
 * instance of passed in enumeration class . */
public < T extends Enum < T > > T getValueAsEnum ( final OGlobalConfiguration config , Class < T > enumType ) { } }

implementation: final Object value ; if ( this . config != null && this . config . containsKey ( config . getKey ( ) ) ) { value = this . config . get ( config . getKey ( ) ) ; } else { value = config . getValue ( ) ; } if ( value == null ) return null ; if ( enumType . isAssignableFrom ( value . getClass ( ) ) ) { return enumType . cast ( value ) ; } else if ( value instanceof String ) { final String presentation = value . toString ( ) ; return Enum . valueOf ( enumType , presentation ) ; } else { throw new ClassCastException ( "Value " + value + " can not be cast to enumeration " + enumType . getSimpleName ( ) ) ; }


signature:
public class OIndexChangesWrapper { /** * Wraps courser only if it is not already wrapped .
 * @ param source Index which is used to create given cursor .
 * @ param cursor Cursor to wrap .
 * @ param indexRebuildVersion Rebuild version of index < b > before < / b > cursor was created .
 * @ return Wrapped cursor .
 * @ see OIndex # getRebuildVersion ( ) */
public static OIndexCursor wrap ( OIndex < ? > source , OIndexCursor cursor , long indexRebuildVersion ) { } }

implementation: if ( cursor instanceof OIndexChangesWrapper ) return cursor ; if ( cursor instanceof OSizeable ) { return new OIndexChangesSizeable ( source , cursor , indexRebuildVersion ) ; } return new OIndexChangesWrapper ( source , cursor , indexRebuildVersion ) ;


signature:
public class OIndexChangesWrapper { /** * { @ inheritDoc } */
@ Override public Map . Entry < Object , OIdentifiable > nextEntry ( ) { } }

implementation: if ( source . isRebuilding ( ) ) throwRebuildException ( ) ; final Map . Entry < Object , OIdentifiable > entry = delegate . nextEntry ( ) ; if ( source . getRebuildVersion ( ) != indexRebuildVersion ) throwRebuildException ( ) ; return entry ;


signature:
public class OIndexChangesWrapper { /** * { @ inheritDoc } */
@ Override public Set < OIdentifiable > toValues ( ) { } }

implementation: if ( source . isRebuilding ( ) ) throwRebuildException ( ) ; final Set < OIdentifiable > values = delegate . toValues ( ) ; if ( source . getRebuildVersion ( ) != indexRebuildVersion ) throwRebuildException ( ) ; return values ;


signature:
public class OIndexChangesWrapper { /** * { @ inheritDoc } */
@ Override public Set < Map . Entry < Object , OIdentifiable > > toEntries ( ) { } }

implementation: if ( source . isRebuilding ( ) ) throwRebuildException ( ) ; final Set < Map . Entry < Object , OIdentifiable > > entries = delegate . toEntries ( ) ; if ( source . getRebuildVersion ( ) != indexRebuildVersion ) throwRebuildException ( ) ; return entries ;


signature:
public class OIndexChangesWrapper { /** * { @ inheritDoc } */
@ Override public Set < Object > toKeys ( ) { } }

implementation: if ( source . isRebuilding ( ) ) throwRebuildException ( ) ; final Set < Object > keys = delegate . toKeys ( ) ; if ( source . getRebuildVersion ( ) != indexRebuildVersion ) throwRebuildException ( ) ; return keys ;


signature:
public class OIndexChangesWrapper { /** * { @ inheritDoc } */
@ Override public boolean hasNext ( ) { } }

implementation: if ( source . isRebuilding ( ) ) throwRebuildException ( ) ; final boolean isNext = delegate . hasNext ( ) ; if ( source . getRebuildVersion ( ) != indexRebuildVersion ) throwRebuildException ( ) ; return isNext ;


signature:
public class OIndexChangesWrapper { /** * { @ inheritDoc } */
@ Override public OIdentifiable next ( ) { } }

implementation: if ( source . isRebuilding ( ) ) throwRebuildException ( ) ; final OIdentifiable next = delegate . next ( ) ; if ( source . getRebuildVersion ( ) != indexRebuildVersion ) throwRebuildException ( ) ; return next ;


signature:
public class OGraphMLReader { /** * Define custom strategy to use for vertex attribute .
 * @ param iAttributeName
 * attribute name
 * @ param iStrategy
 * strategy implementation */
public OGraphMLReader defineVertexAttributeStrategy ( final String iAttributeName , final OGraphMLImportStrategy iStrategy ) { } }

implementation: vertexPropsStrategy . put ( iAttributeName , iStrategy ) ; return this ;


signature:
public class OGraphMLReader { /** * Define custom strategy to use for edge attribute .
 * @ param iAttributeName
 * attribute name
 * @ param iStrategy
 * strategy implementation */
public OGraphMLReader defineEdgeAttributeStrategy ( final String iAttributeName , final OGraphMLImportStrategy iStrategy ) { } }

implementation: edgePropsStrategy . put ( iAttributeName , iStrategy ) ; return this ;


signature:
public class OGraphMLReader { /** * Input the GraphML stream data into the graph . In practice , usually the provided graph is empty .
 * @ param inputGraph
 * the graph to populate with the GraphML data
 * @ param graphMLInputStream
 * an InputStream of GraphML data
 * @ throws IOException
 * thrown when the GraphML data is not correctly formatted */
public void inputGraph ( final Graph inputGraph , final InputStream graphMLInputStream ) throws IOException { } }

implementation: inputGraph ( inputGraph , graphMLInputStream , batchSize , vertexIdKey , edgeIdKey , edgeLabelKey ) ;


signature:
public class OGraphMLReader { /** * Input the GraphML stream data into the graph . In practice , usually the provided graph is empty .
 * @ param inputGraph
 * the graph to populate with the GraphML data
 * @ param filename
 * name of a file containing GraphML data
 * @ throws IOException
 * thrown when the GraphML data is not correctly formatted */
public void inputGraph ( final Graph inputGraph , final String filename ) throws IOException { } }

implementation: inputGraph ( inputGraph , filename , batchSize , vertexIdKey , edgeIdKey , edgeLabelKey ) ;


signature:
public class OGraphMLReader { /** * Input the GraphML stream data into the graph . More control over how data is streamed is provided by this method .
 * @ param inputGraph
 * the graph to populate with the GraphML data
 * @ param filename
 * name of a file containing GraphML data
 * @ param bufferSize
 * the amount of elements to hold in memory before committing a transactions ( only valid for TransactionalGraphs )
 * @ param vertexIdKey
 * if the id of a vertex is a & lt ; data / & gt ; property , fetch it from the data property .
 * @ param edgeIdKey
 * if the id of an edge is a & lt ; data / & gt ; property , fetch it from the data property .
 * @ param edgeLabelKey
 * if the label of an edge is a & lt ; data / & gt ; property , fetch it from the data property .
 * @ throws IOException
 * thrown when the GraphML data is not correctly formatted */
public OGraphMLReader inputGraph ( final Graph inputGraph , final String filename , int bufferSize , String vertexIdKey , String edgeIdKey , String edgeLabelKey ) throws IOException { } }

implementation: FileInputStream fis = new FileInputStream ( filename ) ; try { return inputGraph ( inputGraph , fis , bufferSize , vertexIdKey , edgeIdKey , edgeLabelKey ) ; } finally { fis . close ( ) ; }