Search in sources :

Example 1 with LindenConfig

use of com.xiaomi.linden.core.LindenConfig in project linden by XiaoMi.

the class LindenConfigBuilder method build.

public static LindenConfig build() throws IOException {
    File lindenProperties = new File("lindenProperties");
    Preconditions.checkArgument(lindenProperties.exists(), "can not find linden properties file.");
    try {
        LindenConfig lindenConf = com.xiaomi.linden.core.LindenConfigBuilder.build(lindenProperties);
        File lindenSchema = new File("lindenSchema");
        Preconditions.checkArgument(lindenSchema.exists(), "can not find linden schema file.");
        LindenSchema schema;
        try {
            schema = LindenSchemaBuilder.build(lindenSchema);
        } catch (Exception e) {
            logger.error("Linden schema builder exception", e);
            throw new IOException(e);
        }
        lindenConf.setSchema(schema);
        lindenConf.setIndexType(LindenConfig.IndexType.RAM);
        return lindenConf;
    } catch (Exception e) {
        logger.error("Linden search config builder exception", e);
        throw new IOException(e);
    }
}
Also used : LindenConfig(com.xiaomi.linden.core.LindenConfig) LindenSchema(com.xiaomi.linden.thrift.common.LindenSchema) IOException(java.io.IOException) File(java.io.File) IOException(java.io.IOException)

Aggregations

LindenConfig (com.xiaomi.linden.core.LindenConfig)1 LindenSchema (com.xiaomi.linden.thrift.common.LindenSchema)1 File (java.io.File)1 IOException (java.io.IOException)1