Interface Database

    • Method Detail

      • isOpen

        boolean isOpen()
      • drop

        void drop()
      • getDatabasePath

        String getDatabasePath()
      • isTransactionActive

        boolean isTransactionActive()
      • checkTransactionIsActive

        boolean checkTransactionIsActive​(boolean createTx)
      • transaction

        void transaction​(Database.TransactionScope txBlock)
        Executes a lambda in the transaction scope. If there is an active transaction, then the current transaction is parked and a new sub-transaction is begun.
        Parameters:
        txBlock - Transaction lambda to execute
      • transaction

        boolean transaction​(Database.TransactionScope txBlock,
                            boolean joinCurrentTx)
        Executes a lambda in the transaction scope. If there is an active transaction, then the current transaction is parked and a new sub-transaction is begun if joinCurrentTx is true, otherwise the current active transaction is joined.
        Parameters:
        txBlock - Transaction lambda to execute
        joinCurrentTx - if active joins the current transaction, otherwise always create a new one
        Returns:
        true if a new transaction has been created or false if an existent transaction has been joined
      • transaction

        boolean transaction​(Database.TransactionScope txBlock,
                            boolean joinCurrentTx,
                            int retries)
        Executes a lambda in the transaction scope. If there is an active transaction, then the current transaction is parked and a new sub-transaction is begun if joinCurrentTx is true, otherwise the current active transaction is joined. The difference with the method transaction(TransactionScope) is that in case the NeedRetryException exception is thrown, the transaction is re-executed for a number of retries.
        Parameters:
        txBlock - Transaction lambda to execute
        joinCurrentTx - if active joins the current transaction, otherwise always create a new one
        retries - number of retries in case the NeedRetryException exception is thrown
        Returns:
        true if a new transaction has been created or false if an existent transaction has been joined
      • transaction

        boolean transaction​(Database.TransactionScope txBlock,
                            boolean joinCurrentTx,
                            int retries,
                            OkCallback ok,
                            ErrorCallback error)
        Executes a lambda in the transaction scope. If there is an active transaction, then the current transaction is parked and a new sub-transaction is begun if joinCurrentTx is true, otherwise the current active transaction is joined. The difference with the method transaction(TransactionScope) is that in case the NeedRetryException exception is thrown, the transaction is re-executed for a number of retries.
        Parameters:
        txBlock - Transaction lambda to execute
        joinCurrentTx - if active joins the current transaction, otherwise always create a new one
        retries - number of retries in case the NeedRetryException exception is thrown
        ok - callback invoked if the transaction completes the commit
        error - callback invoked if the transaction cannot complete the commit, after the rollback
        Returns:
        true if a new transaction has been created or false if an existent transaction has been joined
      • isAutoTransaction

        boolean isAutoTransaction()
      • setAutoTransaction

        void setAutoTransaction​(boolean autoTransaction)
      • begin

        void begin()
        Begins a new transaction. If a transaction is already begun, the current transaction is parked and a new sub-transaction is begun. The new sub-transaction does not access to the content of the previous transaction. Sub transactions are totally isolated.
      • commit

        void commit()
        Commits the current transaction. If it was a sub-transaction, then the previous in the stack becomes active again.
      • rollback

        void rollback()
        Rolls back the current transaction. If it was a sub-transaction, then the previous in the stack becomes active again.
      • rollbackAllNested

        void rollbackAllNested()
        Rolls back all the nested transactions if any.
      • lookupByRID

        Record lookupByRID​(RID rid,
                           boolean loadContent)
      • deleteRecord

        void deleteRecord​(Record record)
      • countType

        long countType​(String typeName,
                       boolean polymorphic)
      • countBucket

        long countBucket​(String bucketName)
      • newEdgeByKeys

        Edge newEdgeByKeys​(String sourceVertexType,
                           String[] sourceVertexKeyNames,
                           Object[] sourceVertexKeyValues,
                           String destinationVertexType,
                           String[] destinationVertexKeyNames,
                           Object[] destinationVertexKeyValues,
                           boolean createVertexIfNotExist,
                           String edgeType,
                           boolean bidirectional,
                           Object... properties)
      • newEdgeByKeys

        Edge newEdgeByKeys​(Vertex sourceVertex,
                           String destinationVertexType,
                           String[] destinationVertexKeyNames,
                           Object[] destinationVertexKeyValues,
                           boolean createVertexIfNotExist,
                           String edgeType,
                           boolean bidirectional,
                           Object... properties)
      • getSchema

        Schema getSchema()
      • executeInReadLock

        <RET> RET executeInReadLock​(Callable<RET> callable)
      • executeInWriteLock

        <RET> RET executeInWriteLock​(Callable<RET> callable)
      • isReadYourWrites

        boolean isReadYourWrites()
      • setReadYourWrites

        void setReadYourWrites​(boolean value)
      • setEdgeListSize

        void setEdgeListSize​(int size)