类 DatabaseController


  • public class DatabaseController
    extends java.lang.Object
    The wrapper class is to access the database module of the hive node.
    • 方法概要

      所有方法 实例方法 具体方法 
      修饰符和类型 方法 说明
      long countDocuments​(java.lang.String collectionName, com.fasterxml.jackson.databind.JsonNode filter, CountOptions options)
      Count the documents by filter.
      void createCollection​(java.lang.String collectionName)
      Create the collection.
      void deleteCollection​(java.lang.String collectionName)
      Delete the collection by name.
      int deleteMany​(java.lang.String collectionName, com.fasterxml.jackson.databind.JsonNode filter, DeleteOptions options)
      Delete all matched document by the filter.
      int deleteOne​(java.lang.String collectionName, com.fasterxml.jackson.databind.JsonNode filter, DeleteOptions options)
      Delete the first matched document by the filter.
      java.util.List<com.fasterxml.jackson.databind.JsonNode> find​(java.lang.String collectionName, com.fasterxml.jackson.databind.JsonNode filter, FindOptions options)
      Find all matched document by filter.
      com.fasterxml.jackson.databind.JsonNode findOne​(java.lang.String collectionName, com.fasterxml.jackson.databind.JsonNode filter, FindOptions options)
      Find the first matched document by filter.
      java.util.List<Collection> getCollections()
      Get user's collections.
      InsertResult insertMany​(java.lang.String collectionName, java.util.List<com.fasterxml.jackson.databind.JsonNode> documents, InsertOptions options)
      Insert many documents.
      InsertResult insertOne​(java.lang.String collectionName, com.fasterxml.jackson.databind.JsonNode document, InsertOptions options)
      Insert one document.
      java.util.List<com.fasterxml.jackson.databind.JsonNode> query​(java.lang.String collectionName, com.fasterxml.jackson.databind.JsonNode filter, QueryOptions options)
      Query the documents by filter and options.
      UpdateResult updateMany​(java.lang.String collectionName, com.fasterxml.jackson.databind.JsonNode filter, com.fasterxml.jackson.databind.JsonNode update, UpdateOptions options)
      Update all matched documents by the filter.
      UpdateResult updateOne​(java.lang.String collectionName, com.fasterxml.jackson.databind.JsonNode filter, com.fasterxml.jackson.databind.JsonNode update, UpdateOptions options)
      Update the first matched document by the filter.
      • 从类继承的方法 java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • 构造器详细资料

      • DatabaseController

        public DatabaseController​(NodeRPCConnection connection)
        Create by the RPC connection.
        参数:
        connection - The RPC connection.
    • 方法详细资料

      • createCollection

        public void createCollection​(java.lang.String collectionName)
                              throws HiveException
        Create the collection.
        参数:
        collectionName - The name of the collection.
        抛出:
        HiveException - The error comes from the hive node.
      • deleteCollection

        public void deleteCollection​(java.lang.String collectionName)
                              throws HiveException
        Delete the collection by name.
        参数:
        collectionName - The name of the collection.
        抛出:
        HiveException - The error comes from the hive node.
      • getCollections

        public java.util.List<Collection> getCollections()
                                                  throws HiveException
        Get user's collections.
        返回:
        Collection list.
        抛出:
        HiveException - The error comes from the hive node.
      • insertOne

        public InsertResult insertOne​(java.lang.String collectionName,
                                      com.fasterxml.jackson.databind.JsonNode document,
                                      InsertOptions options)
                               throws HiveException
        Insert one document.
        参数:
        collectionName - The name of the collection.
        document - The document.
        options - Insert options.
        返回:
        The details of the insert operation.
        抛出:
        HiveException - The error comes from the hive node.
      • insertMany

        public InsertResult insertMany​(java.lang.String collectionName,
                                       java.util.List<com.fasterxml.jackson.databind.JsonNode> documents,
                                       InsertOptions options)
                                throws HiveException
        Insert many documents.
        参数:
        collectionName - The name of the collection.
        documents - The document.
        options - Insert options.
        返回:
        The details of the insert operation.
        抛出:
        HiveException - The error comes from the hive node.
      • updateOne

        public UpdateResult updateOne​(java.lang.String collectionName,
                                      com.fasterxml.jackson.databind.JsonNode filter,
                                      com.fasterxml.jackson.databind.JsonNode update,
                                      UpdateOptions options)
                               throws HiveException
        Update the first matched document by the filter.
        参数:
        collectionName - The name of the collection.
        filter - The filter to filter the matched document.
        update - The update data.
        options - The update options.
        返回:
        The details of the update operation.
        抛出:
        HiveException - The error comes from the hive node.
      • updateMany

        public UpdateResult updateMany​(java.lang.String collectionName,
                                       com.fasterxml.jackson.databind.JsonNode filter,
                                       com.fasterxml.jackson.databind.JsonNode update,
                                       UpdateOptions options)
                                throws HiveException
        Update all matched documents by the filter.
        参数:
        collectionName - The name of the collection.
        filter - The filter to filter the matched document.
        update - The update data.
        options - The update options.
        返回:
        The details of the update operation.
        抛出:
        HiveException - The error comes from the hive node.
      • deleteOne

        public int deleteOne​(java.lang.String collectionName,
                             com.fasterxml.jackson.databind.JsonNode filter,
                             DeleteOptions options)
                      throws HiveException
        Delete the first matched document by the filter.
        参数:
        collectionName - The name of the collection.
        filter - The filter to filter the matched document.
        options - The delete options.
        返回:
        The details of the delete operation.
        抛出:
        HiveException - The error comes from the hive node.
      • deleteMany

        public int deleteMany​(java.lang.String collectionName,
                              com.fasterxml.jackson.databind.JsonNode filter,
                              DeleteOptions options)
                       throws HiveException
        Delete all matched document by the filter.
        参数:
        collectionName - The name of the collection.
        filter - The filter to filter the matched documents.
        options - The delete options.
        返回:
        The details of the delete operation.
        抛出:
        HiveException - The error comes from the hive node.
      • countDocuments

        public long countDocuments​(java.lang.String collectionName,
                                   com.fasterxml.jackson.databind.JsonNode filter,
                                   CountOptions options)
                            throws HiveException
        Count the documents by filter.
        参数:
        collectionName - The name of the collection.
        filter - The filter to match the documents.
        options - Count options.
        返回:
        The number of the matched documents.
        抛出:
        HiveException - The error comes from the hive node.
      • findOne

        public com.fasterxml.jackson.databind.JsonNode findOne​(java.lang.String collectionName,
                                                               com.fasterxml.jackson.databind.JsonNode filter,
                                                               FindOptions options)
                                                        throws HiveException
        Find the first matched document by filter.
        参数:
        collectionName - The name of the collection.
        filter - The filter to match the document.
        options - The find options.
        返回:
        The first matched document for the find operation.
        抛出:
        HiveException - The error comes from the hive node.
      • find

        public java.util.List<com.fasterxml.jackson.databind.JsonNode> find​(java.lang.String collectionName,
                                                                            com.fasterxml.jackson.databind.JsonNode filter,
                                                                            FindOptions options)
                                                                     throws HiveException
        Find all matched document by filter.
        参数:
        collectionName - The name of the collection.
        filter - The filter to match the documents.
        options - The find options.
        返回:
        All matched documents for the find operation.
        抛出:
        HiveException - The error comes from the hive node.
      • query

        public java.util.List<com.fasterxml.jackson.databind.JsonNode> query​(java.lang.String collectionName,
                                                                             com.fasterxml.jackson.databind.JsonNode filter,
                                                                             QueryOptions options)
                                                                      throws HiveException
        Query the documents by filter and options.
        参数:
        collectionName - The name of the collection.
        filter - The filter to match the documents.
        options - The query options.
        返回:
        All matched documents for the query operation.
        抛出:
        HiveException - The error comes from the hive node.