package com.kylinolap.common.util;

/**
 * Created by honma on 11/11/14.
 */
public class BasicHadoopTest {
}

@@ -33,78 +33,2095 @@
 l;%0A%0A
-/**%0A * Created by honma on 11/11/14.%0A */%0Apublic class BasicHadoopTest %7B
+import org.apache.hadoop.conf.Configuration;%0Aimport org.apache.hadoop.hbase.HBaseConfiguration;%0Aimport org.apache.hadoop.hbase.HColumnDescriptor;%0Aimport org.apache.hadoop.hbase.HTableDescriptor;%0Aimport org.apache.hadoop.hbase.TableName;%0Aimport org.apache.hadoop.hbase.client.HBaseAdmin;%0Aimport org.junit.BeforeClass;%0Aimport org.junit.Ignore;%0Aimport org.junit.Test;%0A%0Aimport java.io.File;%0Aimport java.io.IOException;%0A%0A/**%0A * Created by honma on 11/11/14.%0A *%0A * development concept proving use%0A */%0A@Ignore%0Apublic class BasicHadoopTest %7B%0A%0A    @BeforeClass%0A    public static void setup() throws Exception %7B%0A        ClasspathUtil.addClasspath(new File(%22../examples/test_case_data/hadoop-site%22).getAbsolutePath());%0A    %7D%0A%0A    @Test%0A    public void testCreateHtable() throws IOException %7B%0A        HTableDescriptor tableDesc = new HTableDescriptor(TableName.valueOf(%22testhbase%22));%0A        tableDesc.setValue(%22KYLIN_HOST%22, %22dev01%22);%0A%0A        HColumnDescriptor cf = new HColumnDescriptor(%22f%22);%0A        cf.setMaxVersions(1);%0A%0A        cf.setInMemory(true);%0A        cf.setBlocksize(4 * 1024 * 1024); // set to 4MB%0A        tableDesc.addFamily(cf);%0A%0A        Configuration conf = HBaseConfiguration.create();%0A        HBaseAdmin admin = new HBaseAdmin(conf);%0A        admin.createTable(tableDesc);%0A    %7D%0A%0A    @Test%0A    public void testRetriveHtableHost() throws IOException %7B%0A        Configuration conf = HBaseConfiguration.create();%0A        HBaseAdmin hbaseAdmin = new HBaseAdmin(conf);%0A        HTableDescriptor%5B%5D tableDescriptors = hbaseAdmin.listTables();%0A        for (HTableDescriptor table : tableDescriptors) %7B%0A            String value = table.getValue(%22KYLIN_HOST%22);%0A            if (value != null) %7B%0A                System.out.println(table.getTableName());%0A                System.out.println(%22host is %22 + value);%0A                hbaseAdmin.disableTable(table.getTableName());%0A                table.setValue(%22KYLIN_HOST_ANOTHER%22, %22dev02%22);%0A                hbaseAdmin.modifyTable(table.getTableName(), table);%0A                hbaseAdmin.enableTable(table.getTableName());%0A            %7D%0A        %7D%0A    %7D
 %0A%7D%0A

add hadoop test case