Search in sources :

Example 11 with DataStoreConnection

use of com.creditease.uav.datastore.api.DataStoreConnection in project uavstack by uavorg.

the class DoTestNotifyData4Mongo method testInsertNotifyMongoDB.

@SuppressWarnings({ "rawtypes" })
public static void testInsertNotifyMongoDB() {
    DataStoreMsg msg = new DataStoreMsg();
    // MongoDBHandler
    String rawData = DataStoreUnitTest.getData(insertJson);
    msg.put(MonitorDataFrame.MessageType.Notification.toString(), rawData);
    msg.put(DataStoreProtocol.MONGO_COLLECTION_NAME, HealthManagerConstants.MONGO_COLLECTION_NOTIFY);
    DataStoreConnection obj = new DataStoreConnection(userName, password, dbName, serverlist, DataStoreType.MONGODB);
    AbstractDataStore store = DataStoreFactory.getInstance().build(HealthManagerConstants.DataStore_Notification, obj, new NotifyDataAdpater(), "");
    store.start();
    boolean rst = store.doInsert(msg);
    store.stop();
    DataStoreUnitTest.printTestResult("testInsertNotifyMongoDB", rst);
}
Also used : DataStoreConnection(com.creditease.uav.datastore.api.DataStoreConnection) NotifyDataAdpater(com.creditease.uav.feature.healthmanager.datastore.adaptors.NotifyDataAdpater) DataStoreMsg(com.creditease.uav.datastore.api.DataStoreMsg) AbstractDataStore(com.creditease.uav.datastore.core.AbstractDataStore)

Aggregations

DataStoreConnection (com.creditease.uav.datastore.api.DataStoreConnection)11 DataStoreMsg (com.creditease.uav.datastore.api.DataStoreMsg)7 AbstractDataStore (com.creditease.uav.datastore.core.AbstractDataStore)5 IOException (java.io.IOException)4 ProfileDataAdpater (com.creditease.uav.feature.healthmanager.datastore.adaptors.ProfileDataAdpater)3 LogDataAdapter (com.creditease.uav.feature.healthmanager.datastore.adaptors.LogDataAdapter)2 NotifyDataAdpater (com.creditease.uav.feature.healthmanager.datastore.adaptors.NotifyDataAdpater)2 Connection (org.apache.hadoop.hbase.client.Connection)2 BasicDBObject (com.mongodb.BasicDBObject)1 ArrayList (java.util.ArrayList)1 LinkedHashMap (java.util.LinkedHashMap)1 List (java.util.List)1 Map (java.util.Map)1 NavigableMap (java.util.NavigableMap)1 Result (org.apache.hadoop.hbase.client.Result)1 ResultScanner (org.apache.hadoop.hbase.client.ResultScanner)1 Scan (org.apache.hadoop.hbase.client.Scan)1 Table (org.apache.hadoop.hbase.client.Table)1 FilterList (org.apache.hadoop.hbase.filter.FilterList)1 PageFilter (org.apache.hadoop.hbase.filter.PageFilter)1