当前位置: 首页>>代码示例>>Java>>正文


Java ConnectorClusterConfig.setDataStoreName方法代码示例

本文整理汇总了Java中com.stratio.crossdata.common.connector.ConnectorClusterConfig.setDataStoreName方法的典型用法代码示例。如果您正苦于以下问题:Java ConnectorClusterConfig.setDataStoreName方法的具体用法?Java ConnectorClusterConfig.setDataStoreName怎么用?Java ConnectorClusterConfig.setDataStoreName使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.stratio.crossdata.common.connector.ConnectorClusterConfig的用法示例。


在下文中一共展示了ConnectorClusterConfig.setDataStoreName方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: prepareConfiguration

import com.stratio.crossdata.common.connector.ConnectorClusterConfig; //导入方法依赖的package包/类
/**
 * Create the configuration object to config the connector cluster information
 *
 * @return Cluster configuration object
 */
public static ConnectorClusterConfig prepareConfiguration() {

    Map<String, String> options = new HashMap<>();
    options.put(ExtractorConstants.HOST, HOST);
    options.put(ExtractorConstants.HOSTS, HOST);
    options.put(ExtractorConstants.PORTS, PORT);
    options.put(ExtractorConstants.INNERCLASS, HDFS);

    options.put(ExtractorConstants.FS_FILE_SEPARATOR, ",");
    options.put(ExtractorConstants.FS_FILE_PATH, "/");

    // options.put(ExtractorConstants.FS_SCHEMA,"[id:java.lang.String,author:java.lang.String," +
    // "title:java.lang.String,year:java.lang.Integer,length:java.lang.Integer,single:java.lang.String]");
    options.put(ExtractorConstants.TYPE, ExtractorConstants.HDFS_TYPE);
    options.put(ExtractorConstants.TABLE, "songs");
    options.put(ExtractorConstants.CATALOG, "test");
    options.put(ExtractorConstants.HDFS_FILE_EXTENSION, ".csv");
    Map<String, String> connectorOptions = new HashMap<>();
    connectorOptions.put(DeepConnectorConstants.PROPERTY_DEFAULT_LIMIT,
                    String.valueOf(DeepConnectorConstants.DEFAULT_RESULT_SIZE));
    ConnectorClusterConfig configuration = new ConnectorClusterConfig(CLUSTERNAME_CONSTANT, connectorOptions,
                    options);
    configuration.setDataStoreName(new DataStoreName("hdfs"));
    return configuration;
}
 
开发者ID:Stratio,项目名称:stratio-connector-deep,代码行数:31,代码来源:HDFSConnectionConfigurationBuilder.java

示例2: prepareConfiguration

import com.stratio.crossdata.common.connector.ConnectorClusterConfig; //导入方法依赖的package包/类
/**
 * Create the configuration object to config the connector cluster information
 *
 * @return Cluster configuration object
 */
public static ConnectorClusterConfig prepareConfiguration() {

    Map<String, String> options = new HashMap<>();
    options.put(ExtractorConstants.HOST, HOST);
    options.put(ExtractorConstants.PORT, PORT);
    options.put(ExtractorConstants.PORT, PORT);
    options.put(ExtractorConstants.INNERCLASS, ES_CELL_CLASS);
    Map<String, String> connectorOptions = new HashMap<>();
    connectorOptions.put(DeepConnectorConstants.PROPERTY_DEFAULT_LIMIT,
                    String.valueOf(DeepConnectorConstants.DEFAULT_RESULT_SIZE));
    ConnectorClusterConfig configuration = new ConnectorClusterConfig(CLUSTERNAME_CONSTANT, connectorOptions,
                    options);
    configuration.setDataStoreName(new DataStoreName("elasticsearch"));
    return configuration;
}
 
开发者ID:Stratio,项目名称:stratio-connector-deep,代码行数:21,代码来源:ESConnectionConfigurationBuilder.java

示例3: prepareConfiguration

import com.stratio.crossdata.common.connector.ConnectorClusterConfig; //导入方法依赖的package包/类
/**
 * Create the configuration object to config the connector cluster information
 * 
 * @return Cluster configuration object
 */
public static ConnectorClusterConfig prepareConfiguration() {

    Map<String, String> options = new HashMap<>();
    options.put(ExtractorConstants.HOST, HOST);
    options.put(ExtractorConstants.PORT, CQLPORT);
    options.put(ExtractorConstants.RPCPORT, RPCPORT);
    options.put(ExtractorConstants.INNERCLASS, CASSANDRA_CELL_CLASS);
    Map<String, String> connectorOptions = new HashMap<>();
    connectorOptions.put(DeepConnectorConstants.PROPERTY_DEFAULT_LIMIT,
                    String.valueOf(DeepConnectorConstants.DEFAULT_RESULT_SIZE));
    ConnectorClusterConfig configuration = new ConnectorClusterConfig(CLUSTERNAME_CONSTANT, connectorOptions,
                    options);
    configuration.setDataStoreName(new DataStoreName("cassandra"));
    return configuration;
}
 
开发者ID:Stratio,项目名称:stratio-connector-deep,代码行数:21,代码来源:CassandraConnectionConfigurationBuilder.java

示例4: testConnect

import com.stratio.crossdata.common.connector.ConnectorClusterConfig; //导入方法依赖的package包/类
/**
 * Establish the connection with DeepSparkContext in order to be able to retrieve metadata from the system columns
 * with the connection config.
 * 
 * @param
 * @return Whether the connection has been established or not.
 */

@Test
public void testConnect() throws Exception {

    ICredentials iCredentials = mock(ICredentials.class);
    ClusterName clusterName = new ClusterName(CLUSTER_NAME);
    Map<String, String> options = new HashMap<>();
    ConnectorClusterConfig config = new ConnectorClusterConfig(clusterName, options, options);
    config.setDataStoreName(new DataStoreName(DATASTORE_NAME));

    DeepConnectionHandler connectionHandler = mock(DeepConnectionHandler.class);
    Whitebox.setInternalState(deepConnector, "connectionHandler", connectionHandler);

    deepConnector.connect(iCredentials, config);

    verify(connectionHandler, times(1)).createConnection(iCredentials, config);
}
 
开发者ID:Stratio,项目名称:stratio-connector-deep,代码行数:25,代码来源:DeepContextConnectorTest.java

示例5: testClose

import com.stratio.crossdata.common.connector.ConnectorClusterConfig; //导入方法依赖的package包/类
@Test
public void testClose() throws ConnectionException, ExecutionException {

    ICredentials iCredentials = mock(ICredentials.class);
    ClusterName clusterName = new ClusterName(CLUSTER_NAME);

    Map<String, String> options = new HashMap<>();
    ConnectorClusterConfig config = new ConnectorClusterConfig(clusterName, options, options);
    config.setDataStoreName(new DataStoreName(DATASTORE_NAME));
    DeepConnectionHandler connectionHandler = mock(DeepConnectionHandler.class);
    Whitebox.setInternalState(deepConnector, "connectionHandler", connectionHandler);

    deepConnector.connect(iCredentials, config);

    connectionHandler.closeConnection(clusterName.getName());

    DeepConnection conn = (DeepConnection) connectionHandler.getConnection(clusterName.getName());
    assertNull(conn);

}
 
开发者ID:Stratio,项目名称:stratio-connector-deep,代码行数:21,代码来源:DeepContextConnectorTest.java

示例6: prepareConfiguration

import com.stratio.crossdata.common.connector.ConnectorClusterConfig; //导入方法依赖的package包/类
/**
 * Create the configuration object to config the connector cluster information
 * 
 * @return Cluster configuration object
 */
public static ConnectorClusterConfig prepareConfiguration() {

    Map<String, String> options = new HashMap<>();
    options.put(ExtractorConstants.HOST, HOST);
    options.put(ExtractorConstants.PORT, PORT);
    options.put(ExtractorConstants.INNERCLASS, MONGO_CELL_CLASS);
    Map<String, String> connectorOptions = new HashMap<>();
    connectorOptions.put(DeepConnectorConstants.PROPERTY_DEFAULT_LIMIT,
                    String.valueOf(DeepConnectorConstants.DEFAULT_RESULT_SIZE));
    ConnectorClusterConfig configuration = new ConnectorClusterConfig(CLUSTERNAME_CONSTANT, connectorOptions,
                    options);
    configuration.setDataStoreName(new DataStoreName("mongo"));
    return configuration;
}
 
开发者ID:Stratio,项目名称:stratio-connector-deep,代码行数:20,代码来源:MongoConnectionConfigurationBuilder.java

示例7: testCreateConnection

import com.stratio.crossdata.common.connector.ConnectorClusterConfig; //导入方法依赖的package包/类
/**
 * Method: createConnection(String clusterName, Connection connection)
 */
@Test
public void testCreateConnection() throws Exception {

    ICredentials credentials = mock(ICredentials.class);
    Map<String, String> options = new HashMap<>();
    options.put(ExtractorConstants.HOST, "127.0.0.1");
    options.put(ExtractorConstants.HOSTS, "127.0.0.1 , 127.0.0.2");
    options.put(ExtractorConstants.PORT, "PORT");
    options.put(DeepConnectorConstants.EXTRACTOR_IMPL_CLASS, "PORT");

    ConnectorClusterConfig config = new ConnectorClusterConfig(new ClusterName(CLUSTER_NAME), options, options);
    config.setDataStoreName(new DataStoreName("cassandra"));

    DeepConnection connection = mock(DeepConnection.class);
    whenNew(DeepConnection.class).withArguments(credentials, config).thenReturn(connection);

    connectionHandler.createConnection(credentials, config);

    Map<String, DeepConnection> mapConnection = (Map<String, DeepConnection>) Whitebox.getInternalState(
            connectionHandler, "connections");

    DeepConnection recoveredConnection = mapConnection.get(CLUSTER_NAME);

    assertNotNull("The connection is not null", recoveredConnection);
    // assertEquals("The recoveredConnection is correct", connection, recoveredConnection);
}
 
开发者ID:Stratio,项目名称:stratio-connector-deep,代码行数:30,代码来源:ConnectionHandlerTest.java

示例8: prepareConfiguration

import com.stratio.crossdata.common.connector.ConnectorClusterConfig; //导入方法依赖的package包/类
/**
 * Create the configuration object to config the connector cluster information
 * 
 * @return Cluster configuration object
 */
public static ConnectorClusterConfig prepareConfiguration() {

    Map<String, String> options = new HashMap<>();
    options.put(ExtractorConstants.HOST, HOST);
    options.put(ExtractorConstants.PORT, PORT);
    options.put(ExtractorConstants.INNERCLASS, AEROSPIKE_CELL_CLASS);
    Map<String, String> connectorOptions = new HashMap<>();
    connectorOptions.put(DeepConnectorConstants.PROPERTY_DEFAULT_LIMIT,
                    String.valueOf(DeepConnectorConstants.DEFAULT_RESULT_SIZE));
    ConnectorClusterConfig configuration = new ConnectorClusterConfig(CLUSTERNAME_CONSTANT, connectorOptions,
                    options);
    configuration.setDataStoreName(new DataStoreName("aerospike"));
    return configuration;
}
 
开发者ID:Stratio,项目名称:stratio-connector-deep,代码行数:20,代码来源:AerospikeConnectionConfigurationBuilder.java


注:本文中的com.stratio.crossdata.common.connector.ConnectorClusterConfig.setDataStoreName方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。