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


Java Value类代码示例

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


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

示例1: getValue

import oracle.kv.Value; //导入依赖的package包/类
/**
 * Store the body of the event as the value of the key. The assumption
 * is that the event body will already be serialized as an Avro record
 * or in another suitable format.
 *
 * @param tableName the name of the table
 * @param avroBody the encoded event body
 * @return the body of the event as a Value object.
 */
protected Value getValue(String tableName, byte[] avroBody) {
    RawRecord raw;
    Schema schema;
    
    LOG.debug("getValue(): tableName={}", tableName);

    
    schema = schemas.get(tableName);
    if (schema == null) {
        throw new RuntimeException("Avro schema not found: " + tableName);
    }
    raw = new RawRecord(avroBody, schema);
    
    return binding.toValue(raw);
}
 
开发者ID:oracle,项目名称:bdglue,代码行数:25,代码来源:NoSQLKVHelper.java

示例2: toOracleLoaderFormat

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

import oracle.kv.Value; //导入依赖的package包/类
/**
 * This method returns CrewTO when crewId is passed
 * @param crewId uniue Cast Id
 * @return CrewTO
 */
public CrewTO getCrewById(int crewId) {
    CrewTO crewTO = null;
    ValueVersion vv = null;
    Value crewTOValue = null;

    if (crewId > 0) {

        /**
     * Insert cast json string to the crewId
     * Key=/CW/crewId/-/info
     */
        Key key = KeyUtil.getCrewInfoKey(crewId);
        vv = getKVStore().get(key);

        if (vv != null) {
            crewTOValue = vv.getValue();
            crewTO = this.getCrewTO(crewTOValue);
        } //if(StringUtil.isNotEmpty(jsonTxt))
    } //if (castId > 0)
    return crewTO;
}
 
开发者ID:oracle,项目名称:big-data-lite,代码行数:27,代码来源:CrewDAO.java

示例4: toValue

import oracle.kv.Value; //导入依赖的package包/类
/**
 * This method takes CrewTO object and serialize it to Value object.
 * @param crewTO
 * @return Value
 */
public Value toValue(CrewTO crewTO) {
    ObjectNode crewNode = null;
    JsonRecord jsonRecord = null;
    Value value = null;

    if (crewTO != null) {
        crewNode = crewTO.getCrewJson();
        jsonRecord = new JsonRecord(crewNode, crewSchema);
        // serialize CrewTO to byte array using JSONAvroBinding
        value = crewBinding.toValue(jsonRecord);
    }

    return value;

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

示例5: getCrewTO

import oracle.kv.Value; //导入依赖的package包/类
/**
 * This method takes Value object as input and deserialize it into CrewTO. The assumption here is that
 * Value that is passed as argument is serialized CrewTO JSON object.
 * @param crewTOValue
 * @return CrewTO
 */
public CrewTO getCrewTO(Value crewTOValue) {

    CrewTO crewTO = null;
    ObjectNode crewNode = null;
    JsonRecord jsonRecord = null;

    if (crewTOValue != null) {
        jsonRecord = crewBinding.toObject(crewTOValue);
        crewNode = (ObjectNode)jsonRecord.getJsonNode();
        crewTO = new CrewTO(crewNode);
    }

    return crewTO;

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

示例6: getCastById

import oracle.kv.Value; //导入依赖的package包/类
/**
 * This method returns CastTO when castId is passed
 * @param castId uniue Cast Id
 * @return CastTO
 */
public CastTO getCastById(int castId) {
    CastTO castTO = null;
    Value castTOValue = null;

    if (castId > 0) {
        /**
     * Insert cast json string to the castId
     * Key=/CT/castId/-/info
     */
        Key key = KeyUtil.getCastInfoKey(castId);
        ValueVersion vv = getKVStore().get(key);
        if (vv != null) {
            castTOValue = vv.getValue();
            castTO = this.getCastTO(castTOValue);

        } //if (vv != null)

    } //if (castId > 0)
    return castTO;
}
 
开发者ID:oracle,项目名称:big-data-lite,代码行数:26,代码来源:CastDAO.java

示例7: toValue

import oracle.kv.Value; //导入依赖的package包/类
/**
 * This method takes CastTO object and serialize it to Value object.
 * @param castTO
 * @return Value
 */
protected Value toValue(CastTO castTO) {
    ObjectNode castNode = null;
    JsonRecord jsonRecord = null;
    Value value = null;

    if (castTO != null) {
        castNode = castTO.geCastJson();
        jsonRecord = new JsonRecord(castNode, castSchema);
        // serialize CastTO to byte array using JSONAvroBinding
        value = castBinding.toValue(jsonRecord);
    }

    return value;

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

示例8: getCastTO

import oracle.kv.Value; //导入依赖的package包/类
/**
 * This method takes Value object as input and deserialize it into CastTO. The assumption here is that
 * Value that is passed as argument is serialized CastTO JSON object.
 * @param castTOValue
 * @return CastTO
 */
protected CastTO getCastTO(Value castTOValue) {

    CastTO castTO = null;
    ObjectNode castNode = null;
    JsonRecord jsonRecord = null;

    if (castTOValue != null) {
        jsonRecord = castBinding.toObject(castTOValue);
        castNode = (ObjectNode)jsonRecord.getJsonNode();
        castTO = new CastTO(castNode);
    }

    return castTO;

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

示例9: getGenres

import oracle.kv.Value; //导入依赖的package包/类
/**
 * This method returns all different Genres available in the store
 * @return List of GenreTO
 */
public List<GenreTO> getGenres() {

    KeyValueVersion keyValue = null;
    Value genreTOValue = null;        
    GenreTO genreTO = null;

    List<GenreTO> genreList = new ArrayList<GenreTO>();
    Key key = Key.createKey(KeyConstant.GENRE_TABLE);
    Iterator<KeyValueVersion> keyValueIter = getKVStore().storeIterator(Direction.UNORDERED, 0, key, null, null);

    while (keyValueIter.hasNext()) {
        keyValue = keyValueIter.next();
        genreTOValue = keyValue.getValue();
        
        genreTO = this.getGenreTO(genreTOValue);
        //Add TO to the list
        genreList.add(genreTO);

        //System.out.println(genreTO.getId() + " " + genreTO.getGenreJsonTxt());
    } //EOF while

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

示例10: getGenreByName

import oracle.kv.Value; //导入依赖的package包/类
/**
 * This method returns GenreTO for the genreName
 * @param genreName
 * @return GenreTO
 */
public GenreTO getGenreByName(String genreName) {

    GenreTO genreTO = null;
    Value genreTOValue = null;

    if (StringUtil.isNotEmpty(genreName)) {
        Key key = KeyUtil.getGenreNameKey(genreName);
        ValueVersion vv = getKVStore().get(key);
        if (vv != null) {
            genreTOValue = vv.getValue();
            genreTO = this.getGenreTO(genreTOValue);

        } //if (key != null)
    }
    return genreTO;

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

示例11: toValue

import oracle.kv.Value; //导入依赖的package包/类
/**
 * This method takes CustomerTO object and serialize it to Value object.
 * @param genreTO
 * @return Value
 */
public Value toValue(GenreTO genreTO) {
    ObjectNode genreNode = null;
    JsonRecord jsonRecord = null;
    Value value = null;

    if (genreTO != null) {
        genreNode = genreTO.getGenreJson();
        jsonRecord = new JsonRecord(genreNode, genreSchema);
        // serialize CustomerTO to byte array using JSONAvroBinding
        value = genreBinding.toValue(jsonRecord);
    }

    return value;

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

示例12: getGenreTO

import oracle.kv.Value; //导入依赖的package包/类
/**
 * This method takes Value object as input and deserialize it into GenreTO. The assumption here is that
 * Value that is passed as argument is serialized GenreTO JSON object.
 * @param genreTOValue
 * @return GenreTO
 */
public GenreTO getGenreTO(Value genreTOValue) {

    GenreTO genreTO = null;
    ObjectNode genreNode = null;
    JsonRecord jsonRecord = null;

    if (genreTOValue != null) {
        jsonRecord = genreBinding.toObject(genreTOValue);
        genreNode = (ObjectNode)jsonRecord.getJsonNode();
        genreTO = new GenreTO(genreNode);
    }

    return genreTO;

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

示例13: insertCustomerProfile

import oracle.kv.Value; //导入依赖的package包/类
/**
 * This method inserts customer profile information into the store if it
 * does not exist already.
 * @param customerTO contains customer's name, email, username, password &
 * customer ID information.
 * @return Version of the new value, or null if an existing value is present
 * and the put is unsuccessful.
 */
public Version insertCustomerProfile(CustomerTO customerTO, boolean force) {

    Key key = null;
    Value value = null;
    Version version = null;
   
    if (customerTO != null) {            
        // key=/CUST/userName
        key = KeyUtil.getCustomerKey(customerTO.getUserName());
        // serialize CustomerTO to byte array using JSONAvroBinding
        value = this.toValue(customerTO);

        if (force) {
            //Insert profile no matter it already existed
            version = getKVStore().put(key, value);
        } else {
            //Insert if profile by same userName & password doesn't exist
            version = getKVStore().putIfAbsent(key, value);
        }
    } //if(customerTO!=null){
    return version;
}
 
开发者ID:oracle,项目名称:big-data-lite,代码行数:31,代码来源:CustomerDAO.java

示例14: toValue

import oracle.kv.Value; //导入依赖的package包/类
/**
 * This method takes CustomerTO object and serialize it to Value object.
 * @param customerTO
 * @return
 */
public Value toValue(CustomerTO customerTO){
    ObjectNode customerNode = null;
    JsonRecord jsonRecord = null;
    Value value = null;
    
    if (customerTO != null) {
        customerNode = customerTO.geCustomertJson();
        jsonRecord = new JsonRecord(customerNode, customerSchema);            
        // serialize CustomerTO to byte array using JSONAvroBinding
        value = customerBinding.toValue(jsonRecord);
    }
    
    return value;

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

示例15: getCustomerTO

import oracle.kv.Value; //导入依赖的package包/类
/**
 * This method takes Value object as input and deserialize it into CustomerTO. The assumption here is that
 * Value that is passed as argument is serialized CustomerTO JSON object.
 * @param custTOValue
 * @return CustomerTO
 */
public CustomerTO getCustomerTO(Value custTOValue){
    
    CustomerTO custTO = null;
    ObjectNode customerNode = null;
    JsonRecord jsonRecord = null;
    
    if(custTOValue!=null){
        jsonRecord = customerBinding.toObject(custTOValue);
        customerNode = (ObjectNode) jsonRecord.getJsonNode();
        custTO = new CustomerTO(customerNode);
    }
    
    return custTO; 
    
}
 
开发者ID:oracle,项目名称:big-data-lite,代码行数:22,代码来源:CustomerDAO.java


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