• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java KVStoreFactory类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中oracle.kv.KVStoreFactory的典型用法代码示例。如果您正苦于以下问题:Java KVStoreFactory类的具体用法?Java KVStoreFactory怎么用?Java KVStoreFactory使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



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

示例1: setupClient

import oracle.kv.KVStoreFactory; //导入依赖的package包/类
/**
 * Sets the configuration for the client according to the properties
 * and establishes a new connection to the Oracle NoSQL datastore.
 */
private void setupClient(){

  conf = new KVStoreConfig(storeName, hostNamePorts);

  conf.setRequestTimeout(requestTimeout, timeUnit);
  conf.setSocketReadTimeout(readTimeout, timeUnit);
  conf.setSocketOpenTimeout(openTimeout, timeUnit);
  conf.setConsistency(consistency);
  Durability newDurability = new Durability(durabilitySyncPolicy,    // Master sync
          durabilitySyncPolicy, // Replica sync
          durabilityReplicaAckPolicy);
  conf.setDurability(newDurability);

  kvstore = KVStoreFactory.getStore(conf);
}
 
开发者ID:maestros,项目名称:gora-oraclenosql,代码行数:20,代码来源:OracleStore.java


示例2: KVHiveRecordReader

import oracle.kv.KVStoreFactory; //导入依赖的package包/类
public KVHiveRecordReader(InputSplit split, JobConf conf) {
    inputSplit = (KVHiveInputSplit) split;
    majorKeyLabels = conf.get(ConfigProperties.KV_MAJOR_KEYS_MAPPING);
    majorKeyLabelsArray = majorKeyLabels.split(",");
    String kvStoreName = inputSplit.getKVStoreName();
    String[] kvHelperHosts = inputSplit.getKVHelperHosts();
    kvstore = KVStoreFactory.getStore(new KVStoreConfig(kvStoreName, kvHelperHosts));
    KVStoreImpl kvstoreImpl = (KVStoreImpl) kvstore;
    int singlePartId = inputSplit.getKVPart();
    iter = kvstoreImpl.partitionIterator(inputSplit.getDirection(),
        inputSplit.getBatchSize(),
        singlePartId,
        inputSplit.getParentKey(),
        inputSplit.getSubRange(),
        inputSplit.getDepth(),
        inputSplit.getConsistency(),
        inputSplit.getTimeout(),
        inputSplit.getTimeoutUnit());
    AvroCatalog avroCatalog = kvstoreImpl.getAvroCatalog();
    if (avroCatalog != null) {
        Map<String, Schema> currentSchemas = avroCatalog.getCurrentSchemas();
        if (currentSchemas != null && !currentSchemas.isEmpty()) {
            binding = avroCatalog.getJsonMultiBinding(currentSchemas);
        }
    }
}
 
开发者ID:vilcek,项目名称:HiveKVStorageHandler2,代码行数:27,代码来源:KVHiveRecordReader.java


示例3: connect

import oracle.kv.KVStoreFactory; //导入依赖的package包/类
/**
 * Connect to the NoSQL KVStore.
 */
public void connect() {
    // Build KV store config
    KVStoreConfig config = new KVStoreConfig(kvStoreName, kvHost + ":" + kvPort);

    // Set durability configuration
    switch (kvStoreDurability) {
    case "SYNC":
        config.setDurability(Durability.COMMIT_SYNC);
        break;
    case "WRITE_NO_SYNC":
        config.setDurability(Durability.COMMIT_WRITE_NO_SYNC);
        break;
    case "NO_SYNC":
        config.setDurability(Durability.COMMIT_NO_SYNC);
        break;
    default:
        LOG.info("Invalid durability setting: " + kvStoreDurability);
        LOG.info("Proceeding with default WRITE_NO_SYNC");
        config.setDurability(Durability.COMMIT_WRITE_NO_SYNC);
        break;
    }

    // Connect to KV store
    try {
        kvStore = KVStoreFactory.getStore(config);
        LOG.info("Connection to KV store established");
    } catch (FaultException e) {
        LOG.error("Could not establish connection to KV store!");
        LOG.error(e.getMessage());
        // Throw error
        throw e;
    }
}
 
开发者ID:oracle,项目名称:bdglue,代码行数:37,代码来源:NoSQLHelper.java


示例4: getKVStore

import oracle.kv.KVStoreFactory; //导入依赖的package包/类
public static KVStore getKVStore() {
    if (kvStore == null) {
        try {
            kvStore =
                    KVStoreFactory.getStore(new KVStoreConfig(StoreConfig.KVSTORE_NAME, StoreConfig.KVSTORE_URL));
        } catch (Exception e) {
            System.out.println("ERROR: Please make sure Oracle NoSQL Database is up and running at '" +
                               StoreConfig.KVSTORE_URL + "' with store name as: '" + StoreConfig.KVSTORE_NAME +
                               "'");
            //e.printStackTrace();
        }
    } //EOF if

    return kvStore;
}
 
开发者ID:oracle,项目名称:big-data-lite,代码行数:16,代码来源:BaseDAO.java


示例5: initDB

import oracle.kv.KVStoreFactory; //导入依赖的package包/类
@PostConstruct
private void initDB() {
    // bootstrap
    store = KVStoreFactory.getStore(new KVStoreConfig("kvstore", "localhost:5000"));
}
 
开发者ID:ftomassetti,项目名称:JavaIncrementalParser,代码行数:6,代码来源:PersonSessionBean.java


示例6: initKvStore

import oracle.kv.KVStoreFactory; //导入依赖的package包/类
private KVStore initKvStore(OracleNoSqlConfig configuration) throws Exception {
  List<KvStoreNode> kvStoreNodes = configuration.getKvStoreNodes();
  String[] helperHostPorts = new String[kvStoreNodes.size()];
  for (int i = 0; i < kvStoreNodes.size(); i++) {
    KvStoreNode node = kvStoreNodes.get(i);
    helperHostPorts[i] = node.getHost() + ":" + node.getPort();
  }

  Properties securityProperties = new Properties();
  if (configuration.getUsername() != null) {
    username = configuration.getUsername();
    securityProperties.put(KVSecurityConstants.AUTH_USERNAME_PROPERTY, configuration.getUsername());
  } else {
    username = "";
  }
  if (configuration.getWalletDir() != null) {
    securityProperties.put(KVSecurityConstants.AUTH_WALLET_PROPERTY, configuration.getWalletDir());
  }
  if (configuration.getPwdFile() != null) {
    securityProperties.put(KVSecurityConstants.AUTH_PWDFILE_PROPERTY, configuration.getPwdFile());
  }
  if (configuration.getSecurityFile() != null) {
    securityProperties.put(KVSecurityConstants.SECURITY_FILE_PROPERTY, configuration.getSecurityFile());
  }
  if (configuration.getTransport() != null) {
    securityProperties.put(KVSecurityConstants.TRANSPORT_PROPERTY, configuration.getTransport());
  }
  if (configuration.getSsl() != null) {
    securityProperties.put(KVSecurityConstants.SSL_TRANSPORT_NAME, configuration.getSsl());
  }
  if (configuration.getSslCipherSuites() != null) {
    securityProperties.put(KVSecurityConstants.SSL_CIPHER_SUITES_PROPERTY, configuration.getSslCipherSuites());
  }
  if (configuration.getSslProtocols() != null) {
    securityProperties.put(KVSecurityConstants.SSL_PROTOCOLS_PROPERTY, configuration.getSslProtocols());
  }
  if (configuration.getSslHostnameVerifier() != null) {
    securityProperties.put(KVSecurityConstants.SSL_HOSTNAME_VERIFIER_PROPERTY, configuration.getSslHostnameVerifier());
  }
  if (configuration.getSslTrustStore() != null) {
    securityProperties.put(KVSecurityConstants.SSL_TRUSTSTORE_FILE_PROPERTY, configuration.getSslTrustStore());
  }
  if (configuration.getSslTrustStoreType() != null) {
    securityProperties.put(KVSecurityConstants.SSL_TRUSTSTORE_TYPE_PROPERTY, configuration.getSslTrustStoreType());
  }

  KVStoreConfig config = new KVStoreConfig(configuration.getStoreName(), helperHostPorts);
  config.setSecurityProperties(securityProperties);

  KVStore kvStore = KVStoreFactory.getStore(config);

  return kvStore;
}
 
开发者ID:kaaproject,项目名称:kaa,代码行数:54,代码来源:OracleNoSqlLogAppender.java


示例7: connectToStore

import oracle.kv.KVStoreFactory; //导入依赖的package包/类
private static KVStore connectToStore() {
  KVStoreConfig config = new KVStoreConfig(STORE_NAME, STORE_HOST + ":" + STORE_PORT);
  return KVStoreFactory.getStore(config);
}
 
开发者ID:kaaproject,项目名称:kaa,代码行数:5,代码来源:OracleNoSqlLogAppenderTest.java



注:本文中的oracle.kv.KVStoreFactory类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java SessionIndex类代码示例发布时间:2022-05-23
下一篇:
Java TelemetryClient类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap