public void initalize()

in src/main/java/com/netflix/bdp/s3mper/metastore/impl/BigTableMetastore.java [45:71]


    public void initalize(URI uri, Configuration conf) throws Exception {
        try {
            tableName = TableName.valueOf(conf.get("s3mper.metastore.name", "metadata"));
            retryCount = conf.getInt("s3mper.metastore.retry", retryCount);
            timeout = conf.getInt("s3mper.metastore.timeout", timeout);

            connection = BigtableConfiguration.connect(projectId, zone, clusterId);

            Admin admin = connection.getAdmin();

            // Create a table with a single column family
            HTableDescriptor descriptor = new HTableDescriptor(tableName);
            descriptor.addFamily(new HColumnDescriptor(COLUMN_FAMILY_NAME));
            try {
                admin.createTable(descriptor);
            }
            catch(IOException e) {
                log.error("Error while creating table", e);
                // Ignore existing table
                // Fixme: Ignores a bunch of other crap as well. :-/
            }
        }
        catch (Exception e) {
            log.error("Error while initializing metastore", e);
            throw new RuntimeException(e);
        }
    }