You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@kylin.apache.org by li...@apache.org on 2015/07/22 06:13:30 UTC
[40/47] incubator-kylin git commit: KYLIN-875 rename modules:
core-common, core-cube, core-dictionary, core-cube
http://git-wip-us.apache.org/repos/asf/incubator-kylin/blob/7e8896ac/common/src/test/java/org/apache/kylin/common/util/HbaseImporter.java
----------------------------------------------------------------------
diff --git a/common/src/test/java/org/apache/kylin/common/util/HbaseImporter.java b/common/src/test/java/org/apache/kylin/common/util/HbaseImporter.java
deleted file mode 100644
index 1647d54..0000000
--- a/common/src/test/java/org/apache/kylin/common/util/HbaseImporter.java
+++ /dev/null
@@ -1,121 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
-*/
-
-package org.apache.kylin.common.util;
-
-import java.io.File;
-import java.io.IOException;
-
-import org.apache.commons.io.FileUtils;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.apache.hadoop.conf.Configuration;
-import org.apache.hadoop.fs.FileUtil;
-import org.apache.hadoop.hbase.HBaseConfiguration;
-import org.apache.hadoop.hbase.mapreduce.Import;
-import org.apache.hadoop.mapreduce.Job;
-import org.apache.hadoop.util.GenericOptionsParser;
-import org.apache.kylin.common.KylinConfig;
-import org.apache.kylin.common.persistence.HBaseConnection;
-
-import com.google.common.base.Preconditions;
-
-/**
- */
-public class HbaseImporter {
-
- private static final Log logger = LogFactory.getLog(HbaseImporter.class);
-
- public static void importHBaseData(String hbaseTarLocation, Configuration conf) throws IOException, ClassNotFoundException, InterruptedException {
-
- if (System.getenv("JAVA_HOME") == null) {
- logger.error("Didn't find $JAVA_HOME, this will cause HBase data import failed. Please set $JAVA_HOME.");
- logger.error("Skipping table import...");
- return;
- }
-
- File exportFile = new File(hbaseTarLocation);
- if (!exportFile.exists()) {
- logger.error("Didn't find the export achieve file on " + exportFile.getAbsolutePath());
- return;
- }
-
- File folder = new File("/tmp/hbase-export/");
- if (folder.exists()) {
- FileUtils.deleteDirectory(folder);
- }
- folder.mkdirs();
- folder.deleteOnExit();
-
- //TarGZUtil.uncompressTarGZ(exportFile, folder);
- FileUtil.unTar(exportFile, folder);
- String[] child = folder.list();
- Preconditions.checkState(child.length == 1);
- String backupFolderName = child[0];
- File backupFolder = new File(folder, backupFolderName);
- String[] tableNames = backupFolder.list();
-
- for (String table : tableNames) {
-
- if (!(table.equalsIgnoreCase(HBaseMiniclusterHelper.TEST_METADATA_TABLE) || table.startsWith(HBaseMiniclusterHelper.SHARED_STORAGE_PREFIX))) {
- continue;
- }
-
- // create the htable; otherwise the import will fail.
- if (table.startsWith(HBaseMiniclusterHelper.II_STORAGE_PREFIX)) {
- HBaseConnection.createHTableIfNeeded(KylinConfig.getInstanceFromEnv().getStorageUrl(), table, "f");
- } else if (table.startsWith(HBaseMiniclusterHelper.CUBE_STORAGE_PREFIX)) {
- HBaseConnection.createHTableIfNeeded(KylinConfig.getInstanceFromEnv().getStorageUrl(), table, "F1", "F2");
- }
-
- // directly import from local fs, no need to copy to hdfs
- String importLocation = "file://" + backupFolder.getAbsolutePath() + "/" + table;
- String[] args = new String[] { table, importLocation };
- boolean result = runImport(args, conf);
- logger.info("importing table '" + table + "' with result:" + result);
-
- if (!result)
- break;
- }
-
- }
-
- private static boolean runImport(String[] args, Configuration configuration) throws IOException, InterruptedException, ClassNotFoundException {
- // need to make a copy of the configuration because to make sure different temp dirs are used.
- GenericOptionsParser opts = new GenericOptionsParser(new Configuration(configuration), args);
- Configuration newConf = opts.getConfiguration();
- args = opts.getRemainingArgs();
- Job job = Import.createSubmittableJob(newConf, args);
- job.waitForCompletion(false);
- return job.isSuccessful();
- }
-
- public static void main(String[] args) throws IOException, InterruptedException, ClassNotFoundException {
- if (args.length != 1) {
- logger.error("Usage: HbaseImporter hbase_tar_lcoation");
- System.exit(-1);
- }
-
- logger.info("The KylinConfig being used:");
- logger.info("=================================================");
- KylinConfig.getInstanceFromEnv().printProperties();
- logger.info("=================================================");
-
- importHBaseData(args[0], HBaseConfiguration.create());
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-kylin/blob/7e8896ac/common/src/test/java/org/apache/kylin/common/util/HyperLogLogCounterTest.java
----------------------------------------------------------------------
diff --git a/common/src/test/java/org/apache/kylin/common/util/HyperLogLogCounterTest.java b/common/src/test/java/org/apache/kylin/common/util/HyperLogLogCounterTest.java
deleted file mode 100644
index 9c2d559..0000000
--- a/common/src/test/java/org/apache/kylin/common/util/HyperLogLogCounterTest.java
+++ /dev/null
@@ -1,247 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
-*/
-
-package org.apache.kylin.common.util;
-
-import static org.junit.Assert.*;
-
-import java.io.IOException;
-import java.nio.ByteBuffer;
-import java.util.HashSet;
-import java.util.Random;
-import java.util.Set;
-
-import org.apache.kylin.common.util.Bytes;
-import org.apache.kylin.common.hll.HyperLogLogPlusCounter;
-import org.junit.Assert;
-import org.junit.Test;
-
-/**
- * @author yangli9
- *
- */
-public class HyperLogLogCounterTest {
-
- ByteBuffer buf = ByteBuffer.allocate(1024 * 1024);
- Random rand1 = new Random(1);
- Random rand2 = new Random(2);
- Random rand3 = new Random(3);
- int errorCount1 = 0;
- int errorCount2 = 0;
- int errorCount3 = 0;
-
- @Test
- public void testPeekLength() throws IOException {
- HyperLogLogPlusCounter hllc = new HyperLogLogPlusCounter(10);
- HyperLogLogPlusCounter copy = new HyperLogLogPlusCounter(10);
- byte[] value = new byte[10];
- for (int i = 0; i < 200000; i++) {
- rand1.nextBytes(value);
- hllc.add(value);
-
- buf.clear();
- hllc.writeRegisters(buf);
-
- int len = buf.position();
- buf.position(0);
- assertEquals(len, hllc.peekLength(buf));
-
- copy.readRegisters(buf);
- assertEquals(len, buf.position());
- assertEquals(hllc, copy);
- }
- buf.clear();
- }
-
- private Set<String> generateTestData(int n) {
- Set<String> testData = new HashSet<String>();
- for (int i = 0; i < n; i++) {
- String[] samples = generateSampleData();
- for (String sample : samples) {
- testData.add(sample);
- }
- }
- return testData;
- }
-
- // simulate the visit (=visitor+id)
- private String[] generateSampleData() {
-
- StringBuilder buf = new StringBuilder();
- for (int i = 0; i < 19; i++) {
- buf.append(Math.abs(rand1.nextInt()) % 10);
- }
- String header = buf.toString();
-
- int size = Math.abs(rand3.nextInt()) % 9 + 1;
- String[] samples = new String[size];
- for (int k = 0; k < size; k++) {
- buf = new StringBuilder(header);
- buf.append("-");
- for (int i = 0; i < 10; i++) {
- buf.append(Math.abs(rand3.nextInt()) % 10);
- }
- samples[k] = buf.toString();
- }
-
- return samples;
- }
-
- @Test
- public void countTest() throws IOException {
- int n = 10;
- for (int i = 0; i < 5; i++) {
- count(n);
- n *= 10;
- }
- }
-
- private void count(int n) throws IOException {
- Set<String> testSet = generateTestData(n);
-
- HyperLogLogPlusCounter hllc = newHLLC();
- for (String testData : testSet) {
- hllc.add(Bytes.toBytes(testData));
- }
- long estimate = hllc.getCountEstimate();
- double errorRate = hllc.getErrorRate();
- double actualError = (double) Math.abs(testSet.size() - estimate) / testSet.size();
- System.out.println(estimate);
- System.out.println(testSet.size());
- System.out.println(errorRate);
- System.out.println("=" + actualError);
- Assert.assertTrue(actualError < errorRate * 3.0);
-
- checkSerialize(hllc);
- }
-
- private void checkSerialize(HyperLogLogPlusCounter hllc) throws IOException {
- long estimate = hllc.getCountEstimate();
- buf.clear();
- hllc.writeRegisters(buf);
- buf.flip();
- hllc.readRegisters(buf);
- Assert.assertEquals(estimate, hllc.getCountEstimate());
- }
-
- @Test
- public void mergeTest() throws IOException {
- double error = 0;
- double absError = 0;
- int n = 100;
- for (int i = 0; i < n; i++) {
- System.out.println("============" + i);
- double e = merge();
- error += e;
- absError += Math.abs(e);
- }
- System.out.println("Total average error is " + error / n + " and absolute error is " + absError / n);
-
- System.out.println("errorCount1 is " + errorCount1 + "!");
- System.out.println("errorCount2 is " + errorCount2 + "!");
- System.out.println("errorCount3 is " + errorCount3 + "!");
-
- Assert.assertTrue(errorCount1 <= n * 0.40);
- Assert.assertTrue(errorCount2 <= n * 0.08);
- Assert.assertTrue(errorCount3 <= n * 0.02);
- }
-
- private double merge() throws IOException {
-
- int ln = 50;
- int dn = 300;
- Set<String> testSet = new HashSet<String>();
- HyperLogLogPlusCounter[] hllcs = new HyperLogLogPlusCounter[ln];
- for (int i = 0; i < ln; i++) {
- hllcs[i] = newHLLC();
- for (int k = 0; k < dn; k++) {
- String[] samples = generateSampleData();
- for (String data : samples) {
- testSet.add(data);
- hllcs[i].add(Bytes.toBytes(data));
- }
- }
- }
- HyperLogLogPlusCounter mergeHllc = newHLLC();
- for (HyperLogLogPlusCounter hllc : hllcs) {
- mergeHllc.merge(hllc);
- checkSerialize(mergeHllc);
- }
-
- double errorRate = mergeHllc.getErrorRate();
- long estimate = mergeHllc.getCountEstimate();
- double actualError = (double) (testSet.size() - estimate) / testSet.size();
-
- System.out.println(testSet.size() + "-" + estimate);
-
- System.out.println("=" + actualError);
- if (Math.abs(actualError) > errorRate) {
- errorCount1++;
- }
- if (Math.abs(actualError) > 2 * errorRate) {
- errorCount2++;
- }
- if (Math.abs(actualError) > 3 * errorRate) {
- errorCount3++;
- }
-
- return actualError;
- }
-
- @Test
- public void testPerformance() throws IOException {
- int N = 3; // reduce N HLLC into one
- int M = 1000; // for M times, use 100000 for real perf test
-
- HyperLogLogPlusCounter samples[] = new HyperLogLogPlusCounter[N];
- for (int i = 0; i < N; i++) {
- samples[i] = newHLLC();
- for (String str : generateTestData(10000))
- samples[i].add(str);
- }
-
- System.out.println("Perf test running ... ");
- long start = System.currentTimeMillis();
- HyperLogLogPlusCounter sum = newHLLC();
- for (int i = 0; i < M; i++) {
- sum.clear();
- for (int j = 0; j < N; j++) {
- sum.merge(samples[j]);
- checkSerialize(sum);
- }
- }
- long duration = System.currentTimeMillis() - start;
- System.out.println("Perf test result: " + duration / 1000 + " seconds");
- }
-
- @Test
- public void testEquivalence() {
- byte[] a = new byte[] { 0, 3, 4, 42, 2, 2 };
- byte[] b = new byte[] { 3, 4, 42 };
- HyperLogLogPlusCounter ha = new HyperLogLogPlusCounter();
- HyperLogLogPlusCounter hb = new HyperLogLogPlusCounter();
- ha.add(a, 1, 3);
- hb.add(b);
-
- Assert.assertTrue(ha.getCountEstimate()==hb.getCountEstimate());
- }
-
- private HyperLogLogPlusCounter newHLLC() {
- return new HyperLogLogPlusCounter(16);
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-kylin/blob/7e8896ac/common/src/test/java/org/apache/kylin/common/util/ITMockHTableTest.java
----------------------------------------------------------------------
diff --git a/common/src/test/java/org/apache/kylin/common/util/ITMockHTableTest.java b/common/src/test/java/org/apache/kylin/common/util/ITMockHTableTest.java
deleted file mode 100644
index 74caa4a..0000000
--- a/common/src/test/java/org/apache/kylin/common/util/ITMockHTableTest.java
+++ /dev/null
@@ -1,158 +0,0 @@
-//package org.apache.kylin.common.util;
-//
-//import com.google.common.collect.Iterables;
-//import com.google.common.collect.Lists;
-//import org.apache.hadoop.hbase.client.*;
-//import org.apache.hadoop.hbase.filter.CompareFilter;
-//import org.apache.hadoop.hbase.filter.SingleColumnValueFilter;
-//import org.apache.kylin.common.KylinConfig;
-//import org.apache.kylin.common.persistence.HBaseConnection;
-//import org.junit.AfterClass;
-//import org.junit.BeforeClass;
-//import org.junit.Test;
-//import org.slf4j.Logger;
-//import org.slf4j.LoggerFactory;
-//
-//import java.io.IOException;
-//
-//import static org.hamcrest.MatcherAssert.assertThat;
-//import static org.hamcrest.Matchers.is;
-//
-///**
-// * MockHTable Test.
-// *
-// * compare to real HTable.
-// */
-//
-//public class ITMockHTableTest extends HBaseMetadataTestCase {
-// private final Logger logger = LoggerFactory.getLogger(this.getClass());
-//
-// private static HTableInterface mock;
-// private static HTableInterface real;
-// private static String emailCF = "EMAIL";
-// private static String addressCF = "ADDRESS";
-// private static String emailCQ = "email";
-// private static String addressCQ = "address";
-// private static String tableName = "MockHTable-TEST";
-//
-// @BeforeClass
-// public static void setUp() throws Exception {
-//
-// staticCreateTestMetadata();
-//
-// HBaseConnection.deleteTable(KylinConfig.getInstanceFromEnv().getStorageUrl(), tableName);
-// HBaseConnection.createHTableIfNeeded(KylinConfig.getInstanceFromEnv().getStorageUrl(), tableName, emailCF, addressCF);
-// real = HBaseConnection.get(KylinConfig.getInstanceFromEnv().getStorageUrl()).getTable(tableName);
-// mock = new MockHTable(tableName, emailCF, addressCF);
-//
-// setupDefaultData();
-// }
-//
-// @AfterClass
-// public static void tearDown() throws Exception {
-// HBaseConnection.deleteTable(KylinConfig.getInstanceFromEnv().getStorageUrl(), tableName);
-// staticCleanupTestMetadata();
-// }
-//
-// private static void setupDefaultData() throws IOException, InterruptedException {
-// Put john = createPutForPerson("John Doe", "john.doe@email.com", "US");
-// Put jane = createPutForPerson("Jane Doe", "jane.doe@other.email.com", "US");
-// Put me = createPutForPerson("Yunsang Choi", "oddpoet@gmail", "jeju");
-// mutateAll(john, jane, me);
-// }
-//
-// private static Put createPutForPerson(String name, String email, String address) {
-// Put person = new Put(name.getBytes());
-// person.add(emailCF.getBytes(), emailCQ.getBytes(), email.getBytes());
-// person.add(addressCF.getBytes(), addressCQ.getBytes(), address.getBytes());
-// return person;
-// }
-//
-// private static <R extends Row> void mutateAll(R... rows) throws IOException, InterruptedException, IOException {
-// real.batch(Lists.newArrayList(rows));
-// mock.batch(Lists.newArrayList(rows));
-// }
-//
-// @Test
-// public void test_get() throws Exception {
-// Get get = new Get("John Doe".getBytes());
-//
-// Result realResult = real.get(get);
-// Result mockResult = mock.get(get);
-//
-// assertThat(realResult.isEmpty(), is(false));
-// assertThat(mockResult.isEmpty(), is(realResult.isEmpty()));
-// }
-//
-// @Test
-// public void test_get_with_filter() throws Exception {
-// Get get = new Get("John Doe".getBytes());
-// get.setFilter(new SingleColumnValueFilter(emailCF.getBytes(), emailCQ.getBytes(), CompareFilter.CompareOp.EQUAL, "WRONG EMAIL".getBytes()
-//
-// ));
-//
-// Result realResult = real.get(get);
-// Result mockResult = mock.get(get);
-//
-// assertThat(realResult.isEmpty(), is(true));
-// assertThat(mockResult.isEmpty(), is(realResult.isEmpty()));
-// }
-//
-// @Test
-// public void test_exists() throws IOException {
-// Get get = new Get("John Doe".getBytes());
-// boolean realResult = real.exists(get);
-// boolean mockResult = mock.exists(get);
-//
-// assertThat(realResult, is(true));
-// assertThat(realResult, is(mockResult));
-// }
-//
-// @Test
-// public void test_exists_include_not_exist_column() throws IOException {
-// Get get = new Get("John Doe".getBytes());
-// get.addColumn(emailCF.getBytes(), emailCQ.getBytes());
-// get.addColumn(emailCF.getBytes(), "NOT_EXIST_COLUMN".getBytes());
-// boolean realResult = real.exists(get);
-// boolean mockResult = mock.exists(get);
-//
-// assertThat(realResult, is(true));
-// assertThat(realResult, is(mockResult));
-// }
-//
-// @Test
-// public void test_exists_with_only_not_exist_column() throws IOException {
-// Get get = new Get("John Doe".getBytes());
-// get.addColumn(emailCF.getBytes(), "NOT_EXIST_COLUMN".getBytes());
-// boolean realResult = real.exists(get);
-// boolean mockResult = mock.exists(get);
-//
-// assertThat(realResult, is(false));
-// assertThat(realResult, is(mockResult));
-// }
-//
-// @Test
-// public void test_scan_with_filter() throws Exception {
-// Scan scan = new Scan();
-// scan.setFilter(new SingleColumnValueFilter(addressCF.getBytes(), addressCQ.getBytes(), CompareFilter.CompareOp.EQUAL, "US".getBytes()));
-//
-// ResultScanner realResult = real.getScanner(scan);
-// ResultScanner mockResult = mock.getScanner(scan);
-//
-// logger.debug("mock : {}", mockResult);
-//
-// assertThat(Iterables.size(realResult), is(2));
-// assertThat(Iterables.size(mockResult), is(2));
-// }
-//
-// @Test
-// public void test_scan_for_pre_match() throws Exception {
-// Scan scan = new Scan("J".getBytes(), "K".getBytes()); // start with 'J' only
-//
-// ResultScanner realResult = real.getScanner(scan);
-// ResultScanner mockResult = mock.getScanner(scan);
-//
-// assertThat(Iterables.size(realResult), is(2));
-// assertThat(Iterables.size(mockResult), is(2));
-// }
-//}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-kylin/blob/7e8896ac/common/src/test/java/org/apache/kylin/common/util/IdentityUtilTest.java
----------------------------------------------------------------------
diff --git a/common/src/test/java/org/apache/kylin/common/util/IdentityUtilTest.java b/common/src/test/java/org/apache/kylin/common/util/IdentityUtilTest.java
deleted file mode 100644
index 7e802a4..0000000
--- a/common/src/test/java/org/apache/kylin/common/util/IdentityUtilTest.java
+++ /dev/null
@@ -1,29 +0,0 @@
-package org.apache.kylin.common.util;
-
-import com.google.common.collect.Lists;
-import org.apache.commons.collections.CollectionUtils;
-import org.junit.Assert;
-import org.junit.Test;
-
-import java.util.List;
-
-/**
- */
-public class IdentityUtilTest {
- @Test
- public void basicTest()
- {
- String s1 = new String("hi");
- String s2 = new String("hi");
-
- List<String> c1 = Lists.newArrayList(s1);
- List<String> c2 = Lists.newArrayList(s2);
- List<String> c3 = Lists.newArrayList(s2);
-
- Assert.assertTrue(CollectionUtils.isEqualCollection(c1,c2));
- Assert.assertTrue(CollectionUtils.isEqualCollection(c3,c2));
-
- Assert.assertFalse(IdentityUtils.collectionReferenceEquals(c1,c2));
- Assert.assertTrue(IdentityUtils.collectionReferenceEquals(c3,c2));
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-kylin/blob/7e8896ac/common/src/test/java/org/apache/kylin/common/util/InstallJarIntoMavenTest.java
----------------------------------------------------------------------
diff --git a/common/src/test/java/org/apache/kylin/common/util/InstallJarIntoMavenTest.java b/common/src/test/java/org/apache/kylin/common/util/InstallJarIntoMavenTest.java
deleted file mode 100644
index 6dcdaf5..0000000
--- a/common/src/test/java/org/apache/kylin/common/util/InstallJarIntoMavenTest.java
+++ /dev/null
@@ -1,62 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
-*/
-
-package org.apache.kylin.common.util;
-
-import java.io.File;
-import java.io.FileWriter;
-import java.io.IOException;
-import java.util.regex.Matcher;
-import java.util.regex.Pattern;
-
-import org.junit.Ignore;
-
-/**
- */
-public class InstallJarIntoMavenTest {
-
- @Ignore("convenient trial tool for dev")
- public void testInstall() throws IOException {
- File folder = new File("/export/home/b_kylin/tmp");
- File out = new File("/export/home/b_kylin/tmp/out.sh");
- out.createNewFile();
- FileWriter fw = new FileWriter(out);
-
- for (File file : folder.listFiles()) {
- String name = file.getName();
-
- if (!name.endsWith(".jar"))
- continue;
-
- int firstSlash = name.indexOf('-');
- int lastDot = name.lastIndexOf('.');
- String groupId = name.substring(0, firstSlash);
-
- Pattern pattern = Pattern.compile("-\\d");
- Matcher match = pattern.matcher(name);
- match.find();
- String artifactId = name.substring(0, match.start());
- String version = name.substring(match.start() + 1, lastDot);
-
- fw.write(String.format("mvn install:install-file -Dfile=%s -DgroupId=%s -DartifactId=%s -Dversion=%s -Dpackaging=jar", name, "org.apache." + groupId, artifactId, version));
- fw.write("\n");
- }
- fw.close();
- }
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-kylin/blob/7e8896ac/common/src/test/java/org/apache/kylin/common/util/LocalFileMetadataTestCase.java
----------------------------------------------------------------------
diff --git a/common/src/test/java/org/apache/kylin/common/util/LocalFileMetadataTestCase.java b/common/src/test/java/org/apache/kylin/common/util/LocalFileMetadataTestCase.java
deleted file mode 100644
index 6939e20..0000000
--- a/common/src/test/java/org/apache/kylin/common/util/LocalFileMetadataTestCase.java
+++ /dev/null
@@ -1,77 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
-*/
-
-package org.apache.kylin.common.util;
-
-import org.apache.commons.io.FileUtils;
-import org.apache.kylin.common.KylinConfig;
-import org.apache.kylin.common.persistence.ResourceStore;
-
-import java.io.File;
-import java.io.IOException;
-
-/**
- * @author ysong1
- */
-public class LocalFileMetadataTestCase extends AbstractKylinTestCase {
-
- @Override
- public void createTestMetadata() {
- staticCreateTestMetadata();
- }
-
- public static void staticCreateTestMetadata() {
- staticCreateTestMetadata(LOCALMETA_TEST_DATA);
- }
-
- public static void staticCreateTestMetadata(String testDataFolder) {
- KylinConfig.destoryInstance();
-
- String tempTestMetadataUrl = "../examples/test_metadata";
- try {
- FileUtils.deleteDirectory(new File(tempTestMetadataUrl));
- FileUtils.copyDirectory(new File(testDataFolder), new File(tempTestMetadataUrl));
- } catch (IOException e) {
- e.printStackTrace();
- }
-
- if (System.getProperty(KylinConfig.KYLIN_CONF) == null && System.getenv(KylinConfig.KYLIN_CONF) == null)
- System.setProperty(KylinConfig.KYLIN_CONF, tempTestMetadataUrl);
-
- KylinConfig.getInstanceFromEnv().setMetadataUrl(tempTestMetadataUrl);
- }
-
- public static void cleanAfterClass() {
- String tempTestMetadataUrl = "../examples/test_metadata";
- try {
- FileUtils.deleteDirectory(new File(tempTestMetadataUrl));
- } catch (IOException e) {
- throw new IllegalStateException("Can't delete directory " + tempTestMetadataUrl, e);
- }
- staticCleanupTestMetadata();
- }
-
- @Override
- public void cleanupTestMetadata() {
- cleanAfterClass();
- }
-
- protected ResourceStore getStore() {
- return ResourceStore.getStore(KylinConfig.getInstanceFromEnv());
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-kylin/blob/7e8896ac/common/src/test/java/org/apache/kylin/common/util/MailServiceTest.java
----------------------------------------------------------------------
diff --git a/common/src/test/java/org/apache/kylin/common/util/MailServiceTest.java b/common/src/test/java/org/apache/kylin/common/util/MailServiceTest.java
deleted file mode 100644
index bc4d7cf..0000000
--- a/common/src/test/java/org/apache/kylin/common/util/MailServiceTest.java
+++ /dev/null
@@ -1,68 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
-*/
-
-package org.apache.kylin.common.util;
-
-import java.io.IOException;
-import java.util.ArrayList;
-import java.util.List;
-
-import org.apache.kylin.common.KylinConfig;
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Ignore;
-import org.junit.Test;
-
-@Ignore("convenient trial tool for dev")
-public class MailServiceTest extends LocalFileMetadataTestCase {
-
- @Before
- public void setup() throws Exception {
- this.createTestMetadata();
-
- }
-
- @After
- public void after() throws Exception {
- this.cleanupTestMetadata();
- }
-
- @Test
- public void testSendEmail() throws IOException {
-
- KylinConfig config = KylinConfig.getInstanceFromEnv();
-
- MailService mailservice = new MailService(config);
- boolean sent = sendTestEmail(mailservice);
- assert sent;
-
- // set mail.enabled=false, and run again, this time should be no mail delviered
- config.setProperty(KylinConfig.MAIL_ENABLED, "false");
- mailservice = new MailService(config);
- sent = sendTestEmail(mailservice);
- assert !sent;
-
- }
-
- private boolean sendTestEmail(MailService mailservice) {
-
- List<String> receivers = new ArrayList<String>(1);
- receivers.add("foobar@foobar.com");
- return mailservice.sendMail(receivers, "A test email from Kylin", "Hello!");
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-kylin/blob/7e8896ac/common/src/test/java/org/apache/kylin/common/util/PartialSorterTest.java
----------------------------------------------------------------------
diff --git a/common/src/test/java/org/apache/kylin/common/util/PartialSorterTest.java b/common/src/test/java/org/apache/kylin/common/util/PartialSorterTest.java
deleted file mode 100644
index e24e7f8..0000000
--- a/common/src/test/java/org/apache/kylin/common/util/PartialSorterTest.java
+++ /dev/null
@@ -1,47 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
-*/
-
-package org.apache.kylin.common.util;
-
-import com.google.common.collect.Lists;
-import org.junit.Test;
-import static org.junit.Assert.*;
-import java.util.Comparator;
-import java.util.List;
-
-/**
- */
-public class PartialSorterTest {
- @Test
- public void basicTest() {
- List<Integer> a = Lists.newArrayList();
- a.add(100);
- a.add(2);
- a.add(92);
- a.add(1);
- a.add(0);
- PartialSorter.partialSort(a, Lists.newArrayList(1, 3, 4), new Comparator<Integer>() {
- @Override
- public int compare(Integer o1, Integer o2) {
- return o1.compareTo(o2);
- }
- });
- assertArrayEquals(a.toArray(), new Integer[] { 100, 0, 92, 1, 2 });
- }
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-kylin/blob/7e8896ac/common/src/test/java/org/apache/kylin/common/util/RandomSamplerTest.java
----------------------------------------------------------------------
diff --git a/common/src/test/java/org/apache/kylin/common/util/RandomSamplerTest.java b/common/src/test/java/org/apache/kylin/common/util/RandomSamplerTest.java
deleted file mode 100644
index 89d5701..0000000
--- a/common/src/test/java/org/apache/kylin/common/util/RandomSamplerTest.java
+++ /dev/null
@@ -1,48 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
-*/
-
-package org.apache.kylin.common.util;
-
-import static org.junit.Assert.*;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.apache.hadoop.io.Text;
-import org.junit.Test;
-
-/**
- * @author ysong1
- *
- */
-public class RandomSamplerTest {
-
- @Test
- public void test() {
- RandomSampler<Text> s = new RandomSampler<Text>();
- List<Text> data = new ArrayList<Text>();
- for (int i = 0; i < 1000; i++) {
- data.add(new Text(String.valueOf(i)));
- }
-
- List<Text> result = s.sample(data, 50);
- System.out.println(result);
- assertEquals(50, result.size());
- }
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-kylin/blob/7e8896ac/common/src/test/java/org/apache/kylin/common/util/RangeTest.java
----------------------------------------------------------------------
diff --git a/common/src/test/java/org/apache/kylin/common/util/RangeTest.java b/common/src/test/java/org/apache/kylin/common/util/RangeTest.java
deleted file mode 100644
index 2a9ce40..0000000
--- a/common/src/test/java/org/apache/kylin/common/util/RangeTest.java
+++ /dev/null
@@ -1,160 +0,0 @@
-package org.apache.kylin.common.util;
-
-import org.junit.Assert;
-import org.junit.Test;
-
-import com.google.common.collect.Lists;
-import com.google.common.collect.Range;
-import com.google.common.collect.Ranges;
-
-/**
- */
-public class RangeTest {
-
- @Test
- public void extremeCase()
- {
- Range r1 = Ranges.all();
- Range r2 = Ranges.all();
-
- Range a = Ranges.closedOpen(2, 5);
-
- Assert.assertTrue(RangeUtil.remove(r1, r2).equals(Lists.newArrayList()));
- Assert.assertTrue(RangeUtil.remove(r1, a).equals(Lists.newArrayList(Ranges.lessThan(2),Ranges.atLeast(5))));
- }
-
- @Test
- public void testClosed() {
-
- Range anull = Ranges.closedOpen(0, 0);
-
- Range r1 = Ranges.closed(2, 5);
-
- Range a1 = Ranges.open(1, 2);
- Range a2 = Ranges.open(1, 3);
- Range a3 = Ranges.open(1, 5);
- Range a4 = Ranges.open(1, 6);
- Range a5 = Ranges.open(6, 7);
- Range a6 = Ranges.open(5, 7);
- Range a7 = Ranges.open(4, 7);
- Range a8 = Ranges.open(2, 7);
- Range a9 = Ranges.open(1, 7);
-
- Range b1 = Ranges.closed(1, 2);
- Range b2 = Ranges.closed(1, 3);
- Range b3 = Ranges.closed(1, 5);
- Range b4 = Ranges.closed(1, 6);
- Range b5 = Ranges.closed(6, 7);
- Range b6 = Ranges.closed(5, 7);
- Range b7 = Ranges.closed(4, 7);
- Range b8 = Ranges.closed(2, 7);
- Range b9 = Ranges.closed(1, 7);
-
- Range c1 = Ranges.open(2, 3);
- Range c2 = Ranges.open(3, 4);
- Range c3 = Ranges.open(4, 5);
-
- Range d1 = Ranges.closed(2, 3);
- Range d2 = Ranges.closed(3, 4);
- Range d3 = Ranges.closed(4, 5);
-
-
- Assert.assertTrue(RangeUtil.remove(r1, anull).equals(Lists.newArrayList(r1)));
- Assert.assertTrue(RangeUtil.remove(r1, a1).equals(Lists.newArrayList(r1)));
- Assert.assertTrue(RangeUtil.remove(r1, a2).equals(Lists.newArrayList(Ranges.closed(3, 5))));
- Assert.assertTrue(RangeUtil.remove(r1, a3).equals(Lists.newArrayList(Ranges.closed(5, 5))));
- Assert.assertTrue(RangeUtil.remove(r1, a4).equals(Lists.newArrayList()));
- Assert.assertTrue(RangeUtil.remove(r1, a5).equals(Lists.newArrayList(r1)));
- Assert.assertTrue(RangeUtil.remove(r1, a6).equals(Lists.newArrayList(r1)));
- Assert.assertTrue(RangeUtil.remove(r1, a7).equals(Lists.newArrayList(Ranges.closed(2, 4))));
- Assert.assertTrue(RangeUtil.remove(r1, a8).equals(Lists.newArrayList(Ranges.closed(2, 2))));
- Assert.assertTrue(RangeUtil.remove(r1, a9).equals(Lists.newArrayList()));
-
- Assert.assertTrue(RangeUtil.remove(r1, b1).equals(Lists.newArrayList(Ranges.openClosed(2, 5))));
- Assert.assertTrue(RangeUtil.remove(r1, b2).equals(Lists.newArrayList(Ranges.openClosed(3, 5))));
- Assert.assertTrue(RangeUtil.remove(r1, b3).equals(Lists.newArrayList()));
- Assert.assertTrue(RangeUtil.remove(r1, b4).equals(Lists.newArrayList()));
- Assert.assertTrue(RangeUtil.remove(r1, b5).equals(Lists.newArrayList(r1)));
- Assert.assertTrue(RangeUtil.remove(r1, b6).equals(Lists.newArrayList(Ranges.closedOpen(2, 5))));
- Assert.assertTrue(RangeUtil.remove(r1, b7).equals(Lists.newArrayList(Ranges.closedOpen(2, 4))));
- Assert.assertTrue(RangeUtil.remove(r1, b8).equals(Lists.newArrayList()));
- Assert.assertTrue(RangeUtil.remove(r1, b9).equals(Lists.newArrayList()));
-
- Assert.assertTrue(RangeUtil.remove(r1, c1).equals(Lists.newArrayList(Ranges.closed(2, 2), Ranges.closed(3, 5))));
- Assert.assertTrue(RangeUtil.remove(r1, c2).equals(Lists.newArrayList(Ranges.closed(2, 3), Ranges.closed(4, 5))));
- Assert.assertTrue(RangeUtil.remove(r1, c3).equals(Lists.newArrayList(Ranges.closed(2, 4), Ranges.closed(5, 5))));
-
- Assert.assertTrue(RangeUtil.remove(r1, d1).equals(Lists.newArrayList(Ranges.openClosed(3, 5))));
- Assert.assertTrue(RangeUtil.remove(r1, d2).equals(Lists.newArrayList(Ranges.closedOpen(2, 3), Ranges.openClosed(4, 5))));
- Assert.assertTrue(RangeUtil.remove(r1, d3).equals(Lists.newArrayList(Ranges.closedOpen(2, 4))));
-
- }
-
- @Test
- public void testOpen() {
-
- Range anull = Ranges.closedOpen(0, 0);
-
- Range r1 = Ranges.open(2, 5);
-
- Range a1 = Ranges.open(1, 2);
- Range a2 = Ranges.open(1, 3);
- Range a3 = Ranges.open(1, 5);
- Range a4 = Ranges.open(1, 6);
- Range a5 = Ranges.open(6, 7);
- Range a6 = Ranges.open(5, 7);
- Range a7 = Ranges.open(4, 7);
- Range a8 = Ranges.open(2, 7);
- Range a9 = Ranges.open(1, 7);
-
- Range b1 = Ranges.closed(1, 2);
- Range b2 = Ranges.closed(1, 3);
- Range b3 = Ranges.closed(1, 5);
- Range b4 = Ranges.closed(1, 6);
- Range b5 = Ranges.closed(6, 7);
- Range b6 = Ranges.closed(5, 7);
- Range b7 = Ranges.closed(4, 7);
- Range b8 = Ranges.closed(2, 7);
- Range b9 = Ranges.closed(1, 7);
-
- Range c1 = Ranges.open(2, 3);
- Range c2 = Ranges.open(3, 4);
- Range c3 = Ranges.open(4, 5);
-
- Range d1 = Ranges.closed(2, 3);
- Range d2 = Ranges.closed(3, 4);
- Range d3 = Ranges.closed(4, 5);
-
-
- Assert.assertTrue(RangeUtil.remove(r1, anull).equals(Lists.newArrayList(r1)));
-
- Assert.assertTrue(RangeUtil.remove(r1, a1).equals(Lists.newArrayList(r1)));
- Assert.assertTrue(RangeUtil.remove(r1, a2).equals(Lists.newArrayList(Ranges.closedOpen(3, 5))));
- Assert.assertTrue(RangeUtil.remove(r1, a3).equals(Lists.newArrayList()));
- Assert.assertTrue(RangeUtil.remove(r1, a4).equals(Lists.newArrayList()));
- Assert.assertTrue(RangeUtil.remove(r1, a5).equals(Lists.newArrayList(r1)));
- Assert.assertTrue(RangeUtil.remove(r1, a6).equals(Lists.newArrayList(r1)));
- Assert.assertTrue(RangeUtil.remove(r1, a7).equals(Lists.newArrayList(Ranges.openClosed(2, 4))));
- Assert.assertTrue(RangeUtil.remove(r1, a8).equals(Lists.newArrayList()));
- Assert.assertTrue(RangeUtil.remove(r1, a9).equals(Lists.newArrayList()));
-
- Assert.assertTrue(RangeUtil.remove(r1, b1).equals(Lists.newArrayList(Ranges.open(2, 5))));
- Assert.assertTrue(RangeUtil.remove(r1, b2).equals(Lists.newArrayList(Ranges.open(3, 5))));
- Assert.assertTrue(RangeUtil.remove(r1, b3).equals(Lists.newArrayList()));
- Assert.assertTrue(RangeUtil.remove(r1, b4).equals(Lists.newArrayList()));
- Assert.assertTrue(RangeUtil.remove(r1, b5).equals(Lists.newArrayList(r1)));
- Assert.assertTrue(RangeUtil.remove(r1, b6).equals(Lists.newArrayList(Ranges.open(2, 5))));
- Assert.assertTrue(RangeUtil.remove(r1, b7).equals(Lists.newArrayList(Ranges.open(2, 4))));
- Assert.assertTrue(RangeUtil.remove(r1, b8).equals(Lists.newArrayList()));
- Assert.assertTrue(RangeUtil.remove(r1, b9).equals(Lists.newArrayList()));
-
- Assert.assertTrue(RangeUtil.remove(r1, c1).equals(Lists.newArrayList( Ranges.closedOpen(3, 5))));
- Assert.assertTrue(RangeUtil.remove(r1, c2).equals(Lists.newArrayList(Ranges.openClosed(2, 3), Ranges.closedOpen(4, 5))));
- Assert.assertTrue(RangeUtil.remove(r1, c3).equals(Lists.newArrayList(Ranges.openClosed(2, 4))));
-
- Assert.assertTrue(RangeUtil.remove(r1, d1).equals(Lists.newArrayList(Ranges.open(3, 5))));
- Assert.assertTrue(RangeUtil.remove(r1, d2).equals(Lists.newArrayList(Ranges.open(2, 3), Ranges.open(4, 5))));
- Assert.assertTrue(RangeUtil.remove(r1, d3).equals(Lists.newArrayList(Ranges.open(2, 4))));
-
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-kylin/blob/7e8896ac/common/src/test/java/org/apache/kylin/common/util/RangeUtilTest.java
----------------------------------------------------------------------
diff --git a/common/src/test/java/org/apache/kylin/common/util/RangeUtilTest.java b/common/src/test/java/org/apache/kylin/common/util/RangeUtilTest.java
deleted file mode 100644
index 84688aa..0000000
--- a/common/src/test/java/org/apache/kylin/common/util/RangeUtilTest.java
+++ /dev/null
@@ -1,47 +0,0 @@
-package org.apache.kylin.common.util;
-
-import com.google.common.collect.Ranges;
-import org.junit.Assert;
-import org.junit.Test;
-
-import java.util.Map;
-import java.util.NavigableMap;
-import java.util.TreeMap;
-
-/**
- */
-public class RangeUtilTest {
- @Test
- public void testFilter() {
- NavigableMap<Integer, Integer> map = new TreeMap<>();
- map.put(3, 3);
- map.put(1, 1);
- map.put(2, 2);
- Map<Integer, Integer> subMap = RangeUtil.filter(map, Ranges.<Integer> all());
- Assert.assertEquals(subMap.size(), 3);
-
- subMap = RangeUtil.filter(map, Ranges.atLeast(2));
- Assert.assertEquals(subMap.size(), 2);
-
- subMap = RangeUtil.filter(map, Ranges.greaterThan(2));
- Assert.assertEquals(subMap.size(), 1);
-
- subMap = RangeUtil.filter(map, Ranges.greaterThan(0));
- Assert.assertEquals(subMap.size(), 3);
-
- subMap = RangeUtil.filter(map, Ranges.greaterThan(5));
- Assert.assertEquals(subMap.size(), 0);
-
- subMap = RangeUtil.filter(map, Ranges.atMost(2));
- Assert.assertEquals(subMap.size(), 2);
-
- subMap = RangeUtil.filter(map, Ranges.lessThan(2));
- Assert.assertEquals(subMap.size(), 1);
-
- subMap = RangeUtil.filter(map, Ranges.lessThan(5));
- Assert.assertEquals(subMap.size(), 3);
-
- subMap = RangeUtil.filter(map, Ranges.lessThan(0));
- Assert.assertEquals(subMap.size(), 0);
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-kylin/blob/7e8896ac/common/src/test/java/org/apache/kylin/common/util/SSHClientTest.java
----------------------------------------------------------------------
diff --git a/common/src/test/java/org/apache/kylin/common/util/SSHClientTest.java b/common/src/test/java/org/apache/kylin/common/util/SSHClientTest.java
deleted file mode 100644
index 5680234..0000000
--- a/common/src/test/java/org/apache/kylin/common/util/SSHClientTest.java
+++ /dev/null
@@ -1,86 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
-*/
-
-package org.apache.kylin.common.util;
-
-import static org.junit.Assert.*;
-
-import java.io.File;
-import java.io.IOException;
-
-import org.apache.hadoop.fs.FileUtil;
-import org.apache.kylin.common.KylinConfig;
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Test;
-
-/**
- * @author ysong1
- *
- */
-public class SSHClientTest extends LocalFileMetadataTestCase {
-
- private boolean isRemote;
- private String hostname;
- private int port;
- private String username;
- private String password;
-
- private void loadPropertiesFile() throws IOException {
-
- KylinConfig cfg = KylinConfig.getInstanceFromEnv();
-
- this.isRemote = cfg.getRunAsRemoteCommand();
- this.port = cfg.getRemoteHadoopCliPort();
- this.hostname = cfg.getRemoteHadoopCliHostname();
- this.username = cfg.getRemoteHadoopCliUsername();
- this.password = cfg.getRemoteHadoopCliPassword();
- }
-
- @Before
- public void before() throws Exception {
- this.createTestMetadata();
- loadPropertiesFile();
- }
-
- @After
- public void after() throws Exception {
- this.cleanupTestMetadata();
- }
-
- @Test
- public void testCmd() throws Exception {
- if (isRemote == false)
- return;
-
- SSHClient ssh = new SSHClient(this.hostname, this.port, this.username, this.password);
- SSHClientOutput output = ssh.execCommand("echo hello");
- assertEquals(0, output.getExitCode());
- assertEquals("hello\n", output.getText());
- }
-
- @Test
- public void testScp() throws Exception {
- if (isRemote == false)
- return;
-
- SSHClient ssh = new SSHClient(this.hostname, this.port, this.username, this.password);
- File tmpFile = FileUtil.createLocalTempFile(new File("/tmp/test_scp"), "temp_", false);
- ssh.scpFileToRemote(tmpFile.getAbsolutePath(), "/tmp");
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-kylin/blob/7e8896ac/common/src/test/java/org/apache/kylin/common/util/TimeUtilTest.java
----------------------------------------------------------------------
diff --git a/common/src/test/java/org/apache/kylin/common/util/TimeUtilTest.java b/common/src/test/java/org/apache/kylin/common/util/TimeUtilTest.java
deleted file mode 100644
index cfa11d8..0000000
--- a/common/src/test/java/org/apache/kylin/common/util/TimeUtilTest.java
+++ /dev/null
@@ -1,42 +0,0 @@
-package org.apache.kylin.common.util;
-
-import org.apache.kylin.common.util.TimeUtil.NormalizedTimeUnit;
-import org.junit.Assert;
-import org.junit.Test;
-
-import java.text.ParseException;
-import java.text.SimpleDateFormat;
-import java.util.Calendar;
-
-/**
- */
-public class TimeUtilTest {
- public static long normalizeTime(long timeMillis, NormalizedTimeUnit unit) {
- Calendar a = Calendar.getInstance();
- Calendar b = Calendar.getInstance();
- b.clear();
-
- a.setTimeInMillis(timeMillis);
- if (unit == NormalizedTimeUnit.MINUTE) {
- b.set(a.get(Calendar.YEAR), a.get(Calendar.MONTH), a.get(Calendar.DAY_OF_MONTH), a.get(Calendar.HOUR_OF_DAY), a.get(Calendar.MINUTE));
- } else if (unit == NormalizedTimeUnit.HOUR) {
- b.set(a.get(Calendar.YEAR), a.get(Calendar.MONTH), a.get(Calendar.DAY_OF_MONTH), a.get(Calendar.HOUR_OF_DAY), 0);
- }
- return b.getTimeInMillis();
- }
-
- @Test
- public void basicTest() throws ParseException {
- java.text.DateFormat dateFormat = new SimpleDateFormat("yyyy/MM/dd HH:mm:ss");
-
- long t1 = dateFormat.parse("2012/01/01 00:00:01").getTime();
- Assert.assertEquals(normalizeTime(t1, NormalizedTimeUnit.HOUR), TimeUtil.getHourStart(t1));
- Assert.assertEquals(normalizeTime(t1, NormalizedTimeUnit.MINUTE), TimeUtil.getMinuteStart(t1));
-
- long t2 = dateFormat.parse("2012/12/31 11:02:01").getTime();
- Assert.assertEquals(normalizeTime(t2, NormalizedTimeUnit.HOUR), TimeUtil.getHourStart(t2));
- Assert.assertEquals(normalizeTime(t2, NormalizedTimeUnit.MINUTE), TimeUtil.getMinuteStart(t2));
- }
-
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-kylin/blob/7e8896ac/core-common/.settings/org.eclipse.core.resources.prefs
----------------------------------------------------------------------
diff --git a/core-common/.settings/org.eclipse.core.resources.prefs b/core-common/.settings/org.eclipse.core.resources.prefs
new file mode 100644
index 0000000..365bbd6
--- /dev/null
+++ b/core-common/.settings/org.eclipse.core.resources.prefs
@@ -0,0 +1,5 @@
+eclipse.preferences.version=1
+encoding//src/main/java=UTF-8
+encoding//src/main/resources=UTF-8
+encoding//src/test/java=UTF-8
+encoding/<project>=UTF-8
http://git-wip-us.apache.org/repos/asf/incubator-kylin/blob/7e8896ac/core-common/.settings/org.eclipse.jdt.core.prefs
----------------------------------------------------------------------
diff --git a/core-common/.settings/org.eclipse.jdt.core.prefs b/core-common/.settings/org.eclipse.jdt.core.prefs
new file mode 100644
index 0000000..a903301
--- /dev/null
+++ b/core-common/.settings/org.eclipse.jdt.core.prefs
@@ -0,0 +1,379 @@
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.annotation.inheritNullAnnotations=disabled
+org.eclipse.jdt.core.compiler.annotation.missingNonNullByDefaultAnnotation=ignore
+org.eclipse.jdt.core.compiler.annotation.nonnull=org.eclipse.jdt.annotation.NonNull
+org.eclipse.jdt.core.compiler.annotation.nonnullbydefault=org.eclipse.jdt.annotation.NonNullByDefault
+org.eclipse.jdt.core.compiler.annotation.nullable=org.eclipse.jdt.annotation.Nullable
+org.eclipse.jdt.core.compiler.annotation.nullanalysis=disabled
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7
+org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
+org.eclipse.jdt.core.compiler.compliance=1.7
+org.eclipse.jdt.core.compiler.debug.lineNumber=generate
+org.eclipse.jdt.core.compiler.debug.localVariable=generate
+org.eclipse.jdt.core.compiler.debug.sourceFile=generate
+org.eclipse.jdt.core.compiler.problem.annotationSuperInterface=warning
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.autoboxing=ignore
+org.eclipse.jdt.core.compiler.problem.comparingIdentical=warning
+org.eclipse.jdt.core.compiler.problem.deadCode=warning
+org.eclipse.jdt.core.compiler.problem.deprecation=warning
+org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode=disabled
+org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=disabled
+org.eclipse.jdt.core.compiler.problem.discouragedReference=warning
+org.eclipse.jdt.core.compiler.problem.emptyStatement=ignore
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.problem.explicitlyClosedAutoCloseable=ignore
+org.eclipse.jdt.core.compiler.problem.fallthroughCase=ignore
+org.eclipse.jdt.core.compiler.problem.fatalOptionalError=disabled
+org.eclipse.jdt.core.compiler.problem.fieldHiding=ignore
+org.eclipse.jdt.core.compiler.problem.finalParameterBound=warning
+org.eclipse.jdt.core.compiler.problem.finallyBlockNotCompletingNormally=warning
+org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning
+org.eclipse.jdt.core.compiler.problem.hiddenCatchBlock=warning
+org.eclipse.jdt.core.compiler.problem.includeNullInfoFromAsserts=disabled
+org.eclipse.jdt.core.compiler.problem.incompatibleNonInheritedInterfaceMethod=warning
+org.eclipse.jdt.core.compiler.problem.incompleteEnumSwitch=warning
+org.eclipse.jdt.core.compiler.problem.indirectStaticAccess=ignore
+org.eclipse.jdt.core.compiler.problem.localVariableHiding=ignore
+org.eclipse.jdt.core.compiler.problem.methodWithConstructorName=warning
+org.eclipse.jdt.core.compiler.problem.missingDefaultCase=ignore
+org.eclipse.jdt.core.compiler.problem.missingDeprecatedAnnotation=ignore
+org.eclipse.jdt.core.compiler.problem.missingEnumCaseDespiteDefault=disabled
+org.eclipse.jdt.core.compiler.problem.missingHashCodeMethod=ignore
+org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=ignore
+org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotationForInterfaceMethodImplementation=enabled
+org.eclipse.jdt.core.compiler.problem.missingSerialVersion=warning
+org.eclipse.jdt.core.compiler.problem.missingSynchronizedOnInheritedMethod=ignore
+org.eclipse.jdt.core.compiler.problem.noEffectAssignment=warning
+org.eclipse.jdt.core.compiler.problem.noImplicitStringConversion=warning
+org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=ignore
+org.eclipse.jdt.core.compiler.problem.nonnullParameterAnnotationDropped=warning
+org.eclipse.jdt.core.compiler.problem.nullAnnotationInferenceConflict=error
+org.eclipse.jdt.core.compiler.problem.nullReference=warning
+org.eclipse.jdt.core.compiler.problem.nullSpecViolation=error
+org.eclipse.jdt.core.compiler.problem.nullUncheckedConversion=warning
+org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod=warning
+org.eclipse.jdt.core.compiler.problem.parameterAssignment=ignore
+org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment=ignore
+org.eclipse.jdt.core.compiler.problem.potentialNullReference=ignore
+org.eclipse.jdt.core.compiler.problem.potentiallyUnclosedCloseable=ignore
+org.eclipse.jdt.core.compiler.problem.rawTypeReference=warning
+org.eclipse.jdt.core.compiler.problem.redundantNullAnnotation=warning
+org.eclipse.jdt.core.compiler.problem.redundantNullCheck=ignore
+org.eclipse.jdt.core.compiler.problem.redundantSpecificationOfTypeArguments=ignore
+org.eclipse.jdt.core.compiler.problem.redundantSuperinterface=ignore
+org.eclipse.jdt.core.compiler.problem.reportMethodCanBePotentiallyStatic=ignore
+org.eclipse.jdt.core.compiler.problem.reportMethodCanBeStatic=ignore
+org.eclipse.jdt.core.compiler.problem.specialParameterHidingField=disabled
+org.eclipse.jdt.core.compiler.problem.staticAccessReceiver=warning
+org.eclipse.jdt.core.compiler.problem.suppressOptionalErrors=disabled
+org.eclipse.jdt.core.compiler.problem.suppressWarnings=enabled
+org.eclipse.jdt.core.compiler.problem.syntacticNullAnalysisForFields=disabled
+org.eclipse.jdt.core.compiler.problem.syntheticAccessEmulation=ignore
+org.eclipse.jdt.core.compiler.problem.typeParameterHiding=warning
+org.eclipse.jdt.core.compiler.problem.unavoidableGenericTypeProblems=enabled
+org.eclipse.jdt.core.compiler.problem.uncheckedTypeOperation=warning
+org.eclipse.jdt.core.compiler.problem.unclosedCloseable=warning
+org.eclipse.jdt.core.compiler.problem.undocumentedEmptyBlock=ignore
+org.eclipse.jdt.core.compiler.problem.unhandledWarningToken=warning
+org.eclipse.jdt.core.compiler.problem.unnecessaryElse=ignore
+org.eclipse.jdt.core.compiler.problem.unnecessaryTypeCheck=ignore
+org.eclipse.jdt.core.compiler.problem.unqualifiedFieldAccess=ignore
+org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownException=ignore
+org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionExemptExceptionAndThrowable=enabled
+org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionIncludeDocCommentReference=enabled
+org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionWhenOverriding=disabled
+org.eclipse.jdt.core.compiler.problem.unusedImport=warning
+org.eclipse.jdt.core.compiler.problem.unusedLabel=warning
+org.eclipse.jdt.core.compiler.problem.unusedLocal=warning
+org.eclipse.jdt.core.compiler.problem.unusedObjectAllocation=ignore
+org.eclipse.jdt.core.compiler.problem.unusedParameter=ignore
+org.eclipse.jdt.core.compiler.problem.unusedParameterIncludeDocCommentReference=enabled
+org.eclipse.jdt.core.compiler.problem.unusedParameterWhenImplementingAbstract=disabled
+org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=disabled
+org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=warning
+org.eclipse.jdt.core.compiler.problem.unusedTypeParameter=ignore
+org.eclipse.jdt.core.compiler.problem.unusedWarningToken=warning
+org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning
+org.eclipse.jdt.core.compiler.source=1.7
+org.eclipse.jdt.core.formatter.align_type_members_on_columns=false
+org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression=16
+org.eclipse.jdt.core.formatter.alignment_for_arguments_in_annotation=0
+org.eclipse.jdt.core.formatter.alignment_for_arguments_in_enum_constant=16
+org.eclipse.jdt.core.formatter.alignment_for_arguments_in_explicit_constructor_call=16
+org.eclipse.jdt.core.formatter.alignment_for_arguments_in_method_invocation=16
+org.eclipse.jdt.core.formatter.alignment_for_arguments_in_qualified_allocation_expression=16
+org.eclipse.jdt.core.formatter.alignment_for_assignment=0
+org.eclipse.jdt.core.formatter.alignment_for_binary_expression=16
+org.eclipse.jdt.core.formatter.alignment_for_compact_if=16
+org.eclipse.jdt.core.formatter.alignment_for_conditional_expression=80
+org.eclipse.jdt.core.formatter.alignment_for_enum_constants=0
+org.eclipse.jdt.core.formatter.alignment_for_expressions_in_array_initializer=16
+org.eclipse.jdt.core.formatter.alignment_for_method_declaration=0
+org.eclipse.jdt.core.formatter.alignment_for_multiple_fields=16
+org.eclipse.jdt.core.formatter.alignment_for_parameters_in_constructor_declaration=16
+org.eclipse.jdt.core.formatter.alignment_for_parameters_in_method_declaration=16
+org.eclipse.jdt.core.formatter.alignment_for_resources_in_try=80
+org.eclipse.jdt.core.formatter.alignment_for_selector_in_method_invocation=16
+org.eclipse.jdt.core.formatter.alignment_for_superclass_in_type_declaration=16
+org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_enum_declaration=16
+org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_type_declaration=16
+org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_constructor_declaration=16
+org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_method_declaration=16
+org.eclipse.jdt.core.formatter.alignment_for_union_type_in_multicatch=16
+org.eclipse.jdt.core.formatter.blank_lines_after_imports=1
+org.eclipse.jdt.core.formatter.blank_lines_after_package=1
+org.eclipse.jdt.core.formatter.blank_lines_before_field=0
+org.eclipse.jdt.core.formatter.blank_lines_before_first_class_body_declaration=0
+org.eclipse.jdt.core.formatter.blank_lines_before_imports=1
+org.eclipse.jdt.core.formatter.blank_lines_before_member_type=1
+org.eclipse.jdt.core.formatter.blank_lines_before_method=1
+org.eclipse.jdt.core.formatter.blank_lines_before_new_chunk=1
+org.eclipse.jdt.core.formatter.blank_lines_before_package=0
+org.eclipse.jdt.core.formatter.blank_lines_between_import_groups=1
+org.eclipse.jdt.core.formatter.blank_lines_between_type_declarations=1
+org.eclipse.jdt.core.formatter.brace_position_for_annotation_type_declaration=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_anonymous_type_declaration=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_array_initializer=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_block=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_block_in_case=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_constructor_declaration=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_enum_constant=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_enum_declaration=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_method_declaration=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_switch=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_type_declaration=end_of_line
+org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_block_comment=false
+org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_javadoc_comment=false
+org.eclipse.jdt.core.formatter.comment.format_block_comments=false
+org.eclipse.jdt.core.formatter.comment.format_header=false
+org.eclipse.jdt.core.formatter.comment.format_html=true
+org.eclipse.jdt.core.formatter.comment.format_javadoc_comments=false
+org.eclipse.jdt.core.formatter.comment.format_line_comments=false
+org.eclipse.jdt.core.formatter.comment.format_source_code=true
+org.eclipse.jdt.core.formatter.comment.indent_parameter_description=true
+org.eclipse.jdt.core.formatter.comment.indent_root_tags=true
+org.eclipse.jdt.core.formatter.comment.insert_new_line_before_root_tags=insert
+org.eclipse.jdt.core.formatter.comment.insert_new_line_for_parameter=insert
+org.eclipse.jdt.core.formatter.comment.line_length=80
+org.eclipse.jdt.core.formatter.comment.new_lines_at_block_boundaries=true
+org.eclipse.jdt.core.formatter.comment.new_lines_at_javadoc_boundaries=true
+org.eclipse.jdt.core.formatter.comment.preserve_white_space_between_code_and_line_comments=false
+org.eclipse.jdt.core.formatter.compact_else_if=true
+org.eclipse.jdt.core.formatter.continuation_indentation=2
+org.eclipse.jdt.core.formatter.continuation_indentation_for_array_initializer=2
+org.eclipse.jdt.core.formatter.disabling_tag=@formatter\:off
+org.eclipse.jdt.core.formatter.enabling_tag=@formatter\:on
+org.eclipse.jdt.core.formatter.format_guardian_clause_on_one_line=false
+org.eclipse.jdt.core.formatter.format_line_comment_starting_on_first_column=true
+org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_annotation_declaration_header=true
+org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_constant_header=true
+org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_declaration_header=true
+org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_type_header=true
+org.eclipse.jdt.core.formatter.indent_breaks_compare_to_cases=true
+org.eclipse.jdt.core.formatter.indent_empty_lines=false
+org.eclipse.jdt.core.formatter.indent_statements_compare_to_block=true
+org.eclipse.jdt.core.formatter.indent_statements_compare_to_body=true
+org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_cases=true
+org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_switch=false
+org.eclipse.jdt.core.formatter.indentation.size=4
+org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_field=insert
+org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_local_variable=insert
+org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_method=insert
+org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_package=insert
+org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_parameter=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_type=insert
+org.eclipse.jdt.core.formatter.insert_new_line_after_label=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_after_opening_brace_in_array_initializer=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_at_end_of_file_if_missing=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_before_catch_in_try_statement=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_before_closing_brace_in_array_initializer=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_before_else_in_if_statement=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_before_finally_in_try_statement=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_before_while_in_do_statement=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_annotation_declaration=insert
+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_anonymous_type_declaration=insert
+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_block=insert
+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_constant=insert
+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_declaration=insert
+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_method_body=insert
+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_type_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_after_and_in_type_parameter=insert
+org.eclipse.jdt.core.formatter.insert_space_after_assignment_operator=insert
+org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation_type_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_binary_operator=insert
+org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_arguments=insert
+org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_parameters=insert
+org.eclipse.jdt.core.formatter.insert_space_after_closing_brace_in_block=insert
+org.eclipse.jdt.core.formatter.insert_space_after_closing_paren_in_cast=insert
+org.eclipse.jdt.core.formatter.insert_space_after_colon_in_assert=insert
+org.eclipse.jdt.core.formatter.insert_space_after_colon_in_case=insert
+org.eclipse.jdt.core.formatter.insert_space_after_colon_in_conditional=insert
+org.eclipse.jdt.core.formatter.insert_space_after_colon_in_for=insert
+org.eclipse.jdt.core.formatter.insert_space_after_colon_in_labeled_statement=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_allocation_expression=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_annotation=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_array_initializer=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_parameters=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_throws=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_constant_arguments=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_declarations=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_explicitconstructorcall_arguments=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_increments=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_inits=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_parameters=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_throws=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_invocation_arguments=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_field_declarations=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_local_declarations=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_parameterized_type_reference=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_superinterfaces=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_arguments=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_parameters=insert
+org.eclipse.jdt.core.formatter.insert_space_after_ellipsis=insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_parameterized_type_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_arguments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_parameters=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_brace_in_array_initializer=insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_allocation_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_annotation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_cast=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_catch=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_constructor_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_enum_constant=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_for=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_if=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_invocation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_parenthesized_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_switch=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_synchronized=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_try=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_while=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_postfix_operator=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_prefix_operator=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_question_in_conditional=insert
+org.eclipse.jdt.core.formatter.insert_space_after_question_in_wildcard=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_for=insert
+org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_try_resources=insert
+org.eclipse.jdt.core.formatter.insert_space_after_unary_operator=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_and_in_type_parameter=insert
+org.eclipse.jdt.core.formatter.insert_space_before_assignment_operator=insert
+org.eclipse.jdt.core.formatter.insert_space_before_at_in_annotation_type_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_before_binary_operator=insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_parameterized_type_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_arguments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_parameters=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_brace_in_array_initializer=insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_allocation_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_annotation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_cast=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_catch=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_constructor_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_enum_constant=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_for=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_if=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_invocation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_parenthesized_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_switch=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_synchronized=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_try=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_while=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_colon_in_assert=insert
+org.eclipse.jdt.core.formatter.insert_space_before_colon_in_case=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_colon_in_conditional=insert
+org.eclipse.jdt.core.formatter.insert_space_before_colon_in_default=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_colon_in_for=insert
+org.eclipse.jdt.core.formatter.insert_space_before_colon_in_labeled_statement=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_allocation_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_annotation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_array_initializer=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_parameters=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_throws=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_constant_arguments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_declarations=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_explicitconstructorcall_arguments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_increments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_inits=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_parameters=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_throws=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_invocation_arguments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_field_declarations=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_local_declarations=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_parameterized_type_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_superinterfaces=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_arguments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_parameters=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_ellipsis=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_parameterized_type_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_arguments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_parameters=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_annotation_type_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_anonymous_type_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_array_initializer=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_block=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_constructor_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_constant=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_method_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_switch=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_type_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_allocation_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_type_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation_type_member_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_catch=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_constructor_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_enum_constant=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_for=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_if=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_invocation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_parenthesized_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_switch=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_synchronized=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_try=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_while=insert
+org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_return=insert
+org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_throw=insert
+org.eclipse.jdt.core.formatter.insert_space_before_postfix_operator=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_prefix_operator=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_question_in_conditional=insert
+org.eclipse.jdt.core.formatter.insert_space_before_question_in_wildcard=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_semicolon=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_for=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_try_resources=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_unary_operator=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_brackets_in_array_type_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_empty_braces_in_array_initializer=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_empty_brackets_in_array_allocation_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_annotation_type_member_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_constructor_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_enum_constant=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_invocation=do not insert
+org.eclipse.jdt.core.formatter.join_lines_in_comments=true
+org.eclipse.jdt.core.formatter.join_wrapped_lines=true
+org.eclipse.jdt.core.formatter.keep_else_statement_on_same_line=false
+org.eclipse.jdt.core.formatter.keep_empty_array_initializer_on_one_line=false
+org.eclipse.jdt.core.formatter.keep_imple_if_on_one_line=false
+org.eclipse.jdt.core.formatter.keep_then_statement_on_same_line=false
+org.eclipse.jdt.core.formatter.lineSplit=999
+org.eclipse.jdt.core.formatter.never_indent_block_comments_on_first_column=false
+org.eclipse.jdt.core.formatter.never_indent_line_comments_on_first_column=false
+org.eclipse.jdt.core.formatter.number_of_blank_lines_at_beginning_of_method_body=0
+org.eclipse.jdt.core.formatter.number_of_empty_lines_to_preserve=1
+org.eclipse.jdt.core.formatter.put_empty_statement_on_new_line=true
+org.eclipse.jdt.core.formatter.tabulation.char=space
+org.eclipse.jdt.core.formatter.tabulation.size=4
+org.eclipse.jdt.core.formatter.use_on_off_tags=false
+org.eclipse.jdt.core.formatter.use_tabs_only_for_leading_indentations=false
+org.eclipse.jdt.core.formatter.wrap_before_binary_operator=true
+org.eclipse.jdt.core.formatter.wrap_before_or_operator_multicatch=true
+org.eclipse.jdt.core.formatter.wrap_outer_expressions_when_nested=true
http://git-wip-us.apache.org/repos/asf/incubator-kylin/blob/7e8896ac/core-common/.settings/org.eclipse.jdt.ui.prefs
----------------------------------------------------------------------
diff --git a/core-common/.settings/org.eclipse.jdt.ui.prefs b/core-common/.settings/org.eclipse.jdt.ui.prefs
new file mode 100644
index 0000000..dece0e6
--- /dev/null
+++ b/core-common/.settings/org.eclipse.jdt.ui.prefs
@@ -0,0 +1,7 @@
+eclipse.preferences.version=1
+formatter_profile=_Space Indent & Long Lines
+formatter_settings_version=12
+org.eclipse.jdt.ui.ignorelowercasenames=true
+org.eclipse.jdt.ui.importorder=java;javax;org;com;
+org.eclipse.jdt.ui.ondemandthreshold=99
+org.eclipse.jdt.ui.staticondemandthreshold=1