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

Java KVStore类代码示例

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

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



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

示例1: toOracleLoaderFormat

import oracle.kv.KVStore; //导入依赖的package包/类
public String toOracleLoaderFormat(KeyValueVersion kvv, KVStore kvStore) {
    final Key key = kvv.getKey();
    String returnStr = null;
    String movieIdStr = null;
    String genreIdStr = null;
    GenreMovieTO genreMovieTO = new GenreMovieTO();

    if (key != null) {
        movieIdStr = key.getMinorPath().get(0);
        genreIdStr = key.getMajorPath().get(1);

        genreMovieTO.setMovieId(Integer.parseInt(movieIdStr));
        genreMovieTO.setGenreId(Integer.parseInt(genreIdStr));
        returnStr = genreMovieTO.toString();

    }

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


示例2: toOracleLoaderFormat

import oracle.kv.KVStore; //导入依赖的package包/类
public String toOracleLoaderFormat(KeyValueVersion kvv,
                                   KVStore kvStore) {
    final Value value = kvv.getValue();

    String movieJsonTxt = null;
    MovieTO movieTO = null;
    String returnStr = null;

    if (value!=null) {
        movieTO = movieDAO.getMovieTO(value);
        
        returnStr = movieTO.toString();
    }

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


示例3: toOracleLoaderFormat

import oracle.kv.KVStore; //导入依赖的package包/类
public String toOracleLoaderFormat(KeyValueVersion kvv, KVStore kvStore) {
//
//        final Value value = kvv.getValue();
//
//        GenreTO genreTO = null;
//        String returnStr = null;
//
//        if (value!=null) {
//            
//            genreTO = genreDAO.getGenreTO(value);
//            returnStr = genreTO.toString();
//        }
//
//        return returnStr;
       return null;
    }
 
开发者ID:oracle,项目名称:big-data-lite,代码行数:17,代码来源:GenreFormatter.java


示例4: after

import oracle.kv.KVStore; //导入依赖的package包/类
@After
public void after() throws Exception {
  LOG.info("Deleting data from Oracle No SQL database");
  KVStore kvStore = connectToStore();
  if (kvStore != null) {
    Iterator<Key> it = kvStore.storeKeysIterator(Direction.UNORDERED, 100, null, null, null);
    int numdeleted = 0;
    while (it.hasNext()) {
      if (kvStore.delete(it.next())) {
        numdeleted++;
      }
    }
    LOG.info("Deleted {} key/value pairs", numdeleted);
  }
  kvStore.close();
}
 
开发者ID:kaaproject,项目名称:kaa,代码行数:17,代码来源:OracleNoSqlLogAppenderTest.java


示例5: getPrimaryKeys

import oracle.kv.KVStore; //导入依赖的package包/类
/**
 * Gets the primary keys from the PrimaryKeys table
 * that match the range specified from the query.
 * @param kvStore the Oracle KVStore to get the keys
 * @param query the query that contains the start and end key
 * @param tableName the name of the table of the datastore
 * @return an iterator of the returned primary keys
 */
public static Iterator<Key> getPrimaryKeys(KVStore kvStore, Query query, String tableName){

  String startkey = (String)query.getStartKey();
  String endkey = (String)query.getEndKey();

  Key primaryKey = OracleUtil.keyFromString(OracleStore.getPrimaryKeyTable()+"/"+tableName);
  LOG.debug("PrimaryKey:" + primaryKey.toString());

  KeyRange keyRange;
  if ( (startkey==null) && (endkey==null) )
    keyRange = null;  //in case both keys are null, do not create a keyrange in order to get all keys
  else
    keyRange = new KeyRange(startkey, true, endkey, true); //inclusive

  Iterator<Key> iter = kvStore.multiGetKeysIterator(Direction.FORWARD, 20, primaryKey, keyRange, Depth.CHILDREN_ONLY);

  return iter;
}
 
开发者ID:maestros,项目名称:gora-oraclenosql,代码行数:27,代码来源:OracleUtil.java


示例6: getKVStore

import oracle.kv.KVStore; //导入依赖的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


示例7: getKeyValuesCount

import oracle.kv.KVStore; //导入依赖的package包/类
public int getKeyValuesCount() throws Exception {
  int numvalues = 0;
  KVStore kvStore = connectToStore();
  if (kvStore != null) {
    Iterator<Key> it = kvStore.storeKeysIterator(Direction.UNORDERED, 100, null, null, null);
    while (it.hasNext()) {
      it.next();
      numvalues++;
    }
  }
  kvStore.close();
  return numvalues;
}
 
开发者ID:kaaproject,项目名称:kaa,代码行数:14,代码来源:OracleNoSqlLogAppenderTest.java


示例8: doPost

import oracle.kv.KVStore; //导入依赖的package包/类
public void doPost(HttpServletRequest request,
                   HttpServletResponse response) throws ServletException,
                                                        IOException {
    BaseDAO base = new BaseDAO();
    CustomerRatingDAO custRatingDAO = new CustomerRatingDAO();
    
    KVStore store = null;
    String message =
        "<h1>Please make sure your Oracle NoSQL Database instance is up and running</h1>";
    PrintWriter out = response.getWriter();

    try {
        store = base.getKVStore();

        if (store != null) {
            String username = request.getParameter("username");
            String password = request.getParameter("password");
            boolean useMoviePosters = request.getParameter("useMoviePosters") == null? false : true;
            
            CustomerDAO cdao = new CustomerDAO();
            CustomerTO cto =
                cdao.getCustomerByCredential(username, password);
            Date date = new Date();

            if (cto != null) {

                // Delete all the previous ratings of the customers from the DB
                custRatingDAO.deleteCustomerRating(cto.getId());
                
                /////// ACTIVITY ////////
                ActivityTO activityTO = new ActivityTO();
                activityTO.setActivity(ActivityType.LOGIN);
                activityTO.setCustId(cto.getId());
                ActivityDAO aDAO = new ActivityDAO();
                aDAO.insertCustomerActivity(activityTO);
                
                activityTO.setActivity(ActivityType.LIST_MOVIES);
                aDAO.insertCustomerActivity(activityTO);
                
                HttpSession session = request.getSession();
                session.setAttribute("username", username);
                session.setAttribute("time", date);
                session.setAttribute("userId", cto.getId());
                session.setAttribute("name", cto.getName());
                session.setAttribute("useMoviePosters", useMoviePosters);

                //Ashok
                System.out.println(" setting session and redirecting " + activityTO.toJsonString());
                response.sendRedirect(indexPage);
                
            } else {
                response.sendRedirect(loginPage + "?error=1");
            }
        } else {
            out.println(message);
        }

    } catch (Exception e) {
        out.println(store);
    } //try/catch


}
 
开发者ID:oracle,项目名称:big-data-lite,代码行数:64,代码来源:logIn.java


示例9: initKvStore

import oracle.kv.KVStore; //导入依赖的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


示例10: connectToStore

import oracle.kv.KVStore; //导入依赖的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


示例11: toOracleLoaderFormat

import oracle.kv.KVStore; //导入依赖的package包/类
public String toOracleLoaderFormat(KeyValueVersion kvv, KVStore kvStore) {

        final Value value = kvv.getValue();

        GenreTO genreTO = null;
        String returnStr = null;

        if (value!=null) {
            
            genreTO = genreDAO.getGenreTO(value);
            returnStr = genreTO.toString();
        }

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


示例12: getKVStore

import oracle.kv.KVStore; //导入依赖的package包/类
/**
 *
 * @return  handle to the NoSQL KVStore
 */
public KVStore getKVStore() {
    return kvStore;
}
 
开发者ID:oracle,项目名称:bdglue,代码行数:8,代码来源:NoSQLHelper.java



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
Java FacetsProvider类代码示例发布时间:2022-05-23
下一篇:
Java After类代码示例发布时间: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