Package voldemort.store.readonly.mr.utils

Examples of voldemort.store.readonly.mr.utils.JsonSchema


                                                       String url,
                                                       Path inputPath,
                                                       AdminClient adminClient) throws IOException {
        // create new json store def with schema from the metadata in the input
        // path
        JsonSchema schema = HadoopUtils.getSchemaFromPath(inputPath);
        int replicationFactor = props.getInt("build.replication.factor." + storeName,
                                             props.getInt("build.replication.factor", 2));
        int requiredReads = props.getInt("build.required.reads." + storeName,
                                         props.getInt("build.required.reads", 1));
        int requiredWrites = props.getInt("build.required.writes." + storeName,
                                          props.getInt("build.required.writes", 1));

        int preferredReads = props.getInt("build.preferred.reads." + storeName,
                                          props.getInt("build.preferred.reads", -1));
        int preferredWrites = props.getInt("build.preferred.writes." + storeName,
                                           props.getInt("build.preferred.writes", -1));

        String description = props.getString("push.store.description." + storeName,
                                             props.getString("push.store.description", ""));
        String owners = props.getString("push.store.owners." + storeName,
                                        props.getString("push.store.owners", ""));

        // Generate the key and value schema
        String keySchema = "\n\t\t<type>json</type>\n\t\t<schema-info version=\"0\">"
                           + schema.getKeyType() + "</schema-info>\n\t";
        String valSchema = "\n\t\t<type>json</type>\n\t\t<schema-info version=\"0\">"
                           + schema.getValueType() + "</schema-info>\n\t";

        String keySchemaCompression = "";
        if(props.containsKey("build.compress.key." + storeName)
           || (storeNames.size() == 1 && props.containsKey("build.compress.key"))) {
            keySchemaCompression = "\t<compression><type>gzip</type></compression>\n\t";
View Full Code Here


     * @return
     *
     */
    private void verifyOrAddStore(String url) throws Exception {
        // create new json store def with schema from the metadata in the input path
        JsonSchema schema = HadoopUtils.getSchemaFromPath(getInputPath());
        int replicationFactor = props.getInt("build.replication.factor", 2);
        int requiredReads = props.getInt("build.required.reads", 1);
        int requiredWrites = props.getInt("build.required.writes", 1);
        String description = props.getString("push.store.description", "");
        String owners = props.getString("push.store.owners", "");
        String keySchema = "\n\t\t<type>json</type>\n\t\t<schema-info version=\"0\">"
                           + schema.getKeyType() + "</schema-info>\n\t";

        if(jsonKeyField != null && jsonKeyField.length() > 0) {
            keySchema = "\n\t\t<type>json</type>\n\t\t<schema-info version=\"0\">"
                        + schema.getKeyType().subtype(jsonKeyField) + "</schema-info>\n\t";
        }

        String valSchema = "\n\t\t<type>json</type>\n\t\t<schema-info version=\"0\">"
                           + schema.getValueType() + "</schema-info>\n\t";

        if (jsonValueField != null && jsonValueField.length() > 0) {
            valSchema = "\n\t\t<type>json</type>\n\t\t<schema-info version=\"0\">"
                        + schema.getValueType().subtype(jsonValueField) + "</schema-info>\n\t";
        }

        boolean hasCompression = false;
        if (props.containsKey("build.compress.value")) {
            hasCompression = true;
View Full Code Here

TOP

Related Classes of voldemort.store.readonly.mr.utils.JsonSchema

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.