cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From alek...@apache.org
Subject [3/6] cassandra git commit: Remove Pig support
Date Fri, 16 Oct 2015 12:30:36 GMT
http://git-wip-us.apache.org/repos/asf/cassandra/blob/56cfc6ea/test/pig/org/apache/cassandra/pig/CqlTableTest.java
----------------------------------------------------------------------
diff --git a/test/pig/org/apache/cassandra/pig/CqlTableTest.java b/test/pig/org/apache/cassandra/pig/CqlTableTest.java
deleted file mode 100644
index 3902fce..0000000
--- a/test/pig/org/apache/cassandra/pig/CqlTableTest.java
+++ /dev/null
@@ -1,303 +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.cassandra.pig;
-
-import java.io.IOException;
-import java.util.Iterator;
-
-import org.apache.cassandra.exceptions.ConfigurationException;
-import org.apache.pig.data.Tuple;
-import org.apache.thrift.TException;
-import org.junit.Assert;
-import org.junit.BeforeClass;
-import org.junit.Test;
-
-public class CqlTableTest extends PigTestBase
-{    
-    private static String[] statements = {
-            "DROP KEYSPACE IF EXISTS cql3ks",
-            "CREATE KEYSPACE cql3ks WITH replication = {'class': 'SimpleStrategy', 'replication_factor' : 1}",
-            "USE cql3ks;",
-
-            "CREATE TABLE cqltable (key1 text, key2 int, column1 int, column2 float, primary key(key1, key2))",
-            "INSERT INTO cqltable (key1, key2, column1, column2) values ('key1', 111, 100, 10.1)",
-            "CREATE TABLE compactcqltable (key1 text, column1 int, column2 float, primary key(key1)) WITH COMPACT STORAGE",
-            "INSERT INTO compactcqltable (key1, column1, column2) values ('key1', 100, 10.1)",
-
-            "CREATE TABLE test (a int PRIMARY KEY, b int);",
-            "CREATE INDEX test_b on test (b);",
-
-            "CREATE TABLE moredata (x int PRIMARY KEY, y int);",
-            "CREATE TABLE test_bulk (a int PRIMARY KEY, b int);",
-            "INSERT INTO test_bulk (a,b) VALUES (1,1);",
-            "INSERT INTO test_bulk (a,b) VALUES (2,2);",
-            "INSERT INTO test_bulk (a,b) VALUES (3,3);",
-            "INSERT INTO test (a,b) VALUES (1,1);",
-            "INSERT INTO test (a,b) VALUES (2,2);",
-            "INSERT INTO test (a,b) VALUES (3,3);",
-            "INSERT INTO moredata (x, y) VALUES (4,4);",
-            "INSERT INTO moredata (x, y) VALUES (5,5);",
-            "INSERT INTO moredata (x, y) VALUES (6,6);",
-
-            "CREATE TABLE compotable (a int, b int, c text, d text, PRIMARY KEY (a,b,c));",
-            "INSERT INTO compotable (a, b , c , d ) VALUES ( 1,1,'One','match');",
-            "INSERT INTO compotable (a, b , c , d ) VALUES ( 2,2,'Two','match');",
-            "INSERT INTO compotable (a, b , c , d ) VALUES ( 3,3,'Three','match');",
-            "INSERT INTO compotable (a, b , c , d ) VALUES ( 4,4,'Four','match');",
-
-            "create table compmore (id int PRIMARY KEY, x int, y int, z text, data text);",
-            "INSERT INTO compmore (id, x, y, z,data) VALUES (1,5,6,'Fix','nomatch');",
-            "INSERT INTO compmore (id, x, y, z,data) VALUES (2,6,5,'Sive','nomatch');",
-            "INSERT INTO compmore (id, x, y, z,data) VALUES (3,7,7,'Seven','match');",
-            "INSERT INTO compmore (id, x, y, z,data) VALUES (4,8,8,'Eight','match');",
-            "INSERT INTO compmore (id, x, y, z,data) VALUES (5,9,10,'Ninen','nomatch');",
-
-            "CREATE TABLE collectiontable(m text PRIMARY KEY, n map<text, text>);",
-            "UPDATE collectiontable SET n['key1'] = 'value1' WHERE m = 'book1';",
-            "UPDATE collectiontable SET n['key2'] = 'value2' WHERE m = 'book2';",
-            "UPDATE collectiontable SET n['key3'] = 'value3' WHERE m = 'book3';",
-            "UPDATE collectiontable SET n['key4'] = 'value4' WHERE m = 'book4';",
-            "CREATE TABLE nulltable(m text PRIMARY KEY, n map<text, text>);",
-            "UPDATE nulltable SET n['key1'] = 'value1' WHERE m = 'book1';",
-            "UPDATE nulltable SET n['key2'] = 'value2' WHERE m = 'book2';",
-            "UPDATE nulltable SET n['key3'] = 'value3' WHERE m = 'book3';",
-            "UPDATE nulltable SET n['key4'] = 'value4' WHERE m = 'book4';",
-    };
-
-    @BeforeClass
-    public static void setup() throws IOException, ConfigurationException, TException
-    {
-        startCassandra();
-        executeCQLStatements(statements);
-        startHadoopCluster();
-    }
-
-    @Test
-    public void testCqlNativeStorageSchema() throws IOException
-    {
-        //input_cql=select * from cqltable where token(key1) > ? and token(key1) <= ?
-        cqlTableSchemaTest("rows = LOAD 'cql://cql3ks/cqltable?" + defaultParameters + nativeParameters +  "&input_cql=select%20*%20from%20cqltable%20where%20token(key1)%20%3E%20%3F%20and%20token(key1)%20%3C%3D%20%3F' USING CqlNativeStorage();");
-
-        //input_cql=select * from compactcqltable where token(key1) > ? and token(key1) <= ?
-        compactCqlTableSchemaTest("rows = LOAD 'cql://cql3ks/compactcqltable?" + defaultParameters + nativeParameters + "&input_cql=select%20*%20from%20compactcqltable%20where%20token(key1)%20%3E%20%3F%20and%20token(key1)%20%3C%3D%20%3F' USING CqlNativeStorage();");
-    }
-
-    private void compactCqlTableSchemaTest(String initialQuery) throws IOException
-    {
-        pig.registerQuery(initialQuery);
-        Iterator<Tuple>  it = pig.openIterator("rows");
-        if (it.hasNext()) {
-            Tuple t = it.next();
-            Assert.assertEquals(t.get(0).toString(), "key1");
-            Assert.assertEquals(t.get(1), 100);
-            Assert.assertEquals(t.get(2), 10.1f);
-            Assert.assertEquals(3, t.size());
-        }
-        else
-        {
-            Assert.fail("Failed to get data for query " + initialQuery);
-        }
-    }
-
-    private void cqlTableSchemaTest(String initialQuery) throws IOException
-    {
-        pig.registerQuery(initialQuery);
-        Iterator<Tuple> it = pig.openIterator("rows");
-        if (it.hasNext()) {
-            Tuple t = it.next();
-            Assert.assertEquals(t.get(0).toString(), "key1");
-            Assert.assertEquals(t.get(1), 111);
-            Assert.assertEquals(t.get(2), 100);
-            Assert.assertEquals(t.get(3), 10.1f);
-            Assert.assertEquals(4, t.size());
-        }
-        else
-        {
-            Assert.fail("Failed to get data for query " + initialQuery);
-        }
-    }
-
-    @Test
-    public void testCqlNativeStorageSingleKeyTable() throws IOException
-    {
-        //input_cql=select * from moredata where token(x) > ? and token(x) <= ?
-        singleKeyTableTest("moretestvalues= LOAD 'cql://cql3ks/moredata?" + defaultParameters + nativeParameters + "&input_cql=select%20*%20from%20moredata%20where%20token(x)%20%3E%20%3F%20and%20token(x)%20%3C%3D%20%3F' USING CqlNativeStorage();");
-    }
-
-    private void singleKeyTableTest(String initialQuery) throws IOException
-    {
-        pig.setBatchOn();
-        pig.registerQuery(initialQuery);
-        pig.registerQuery("insertformat= FOREACH moretestvalues GENERATE TOTUPLE(TOTUPLE('a',x)),TOTUPLE(y);");
-        pig.registerQuery("STORE insertformat INTO 'cql://cql3ks/test?" + defaultParameters + nativeParameters + "&output_query=UPDATE+cql3ks.test+set+b+%3D+%3F' USING CqlNativeStorage();");
-        pig.executeBatch();
-        //(5,5)
-        //(6,6)
-        //(4,4)
-        //(2,2)
-        //(3,3)
-        //(1,1)
-        //input_cql=select * from test where token(a) > ? and token(a) <= ?
-        pig.registerQuery("result= LOAD 'cql://cql3ks/test?" + defaultParameters + nativeParameters + "&input_cql=select%20*%20from%20test%20where%20token(a)%20%3E%20%3F%20and%20token(a)%20%3C%3D%20%3F' USING CqlNativeStorage();");
-        Iterator<Tuple> it = pig.openIterator("result");
-        int count = 0;
-        while (it.hasNext()) {
-            Tuple t = it.next();
-            Assert.assertEquals(t.get(0), t.get(1));
-            count ++;
-        }
-        Assert.assertEquals(6, count);
-    }
-
-    @Test
-    public void testCqlNativeStorageCompositeKeyTable() throws IOException
-    {
-        //input_cql=select * from compmore where token(id) > ? and token(id) <= ?
-        compositeKeyTableTest("moredata= LOAD 'cql://cql3ks/compmore?" + defaultParameters + nativeParameters + "&input_cql=select%20*%20from%20compmore%20where%20token(id)%20%3E%20%3F%20and%20token(id)%20%3C%3D%20%3F' USING CqlNativeStorage();");
-    }
-
-    private void compositeKeyTableTest(String initialQuery) throws IOException
-    {
-        pig.setBatchOn();
-        pig.registerQuery(initialQuery);
-        pig.registerQuery("insertformat = FOREACH moredata GENERATE TOTUPLE (TOTUPLE('a',x),TOTUPLE('b',y), TOTUPLE('c',z)),TOTUPLE(data);");
-        pig.registerQuery("STORE insertformat INTO 'cql://cql3ks/compotable?" + defaultParameters + nativeParameters + "&output_query=UPDATE%20cql3ks.compotable%20SET%20d%20%3D%20%3F' USING CqlNativeStorage();");
-        pig.executeBatch();
-
-        //(5,6,Fix,nomatch)
-        //(3,3,Three,match)
-        //(1,1,One,match)
-        //(2,2,Two,match)
-        //(7,7,Seven,match)
-        //(8,8,Eight,match)
-        //(6,5,Sive,nomatch)
-        //(4,4,Four,match)
-        //(9,10,Ninen,nomatch)
-        //input_cql=select * from compotable where token(a) > ? and token(a) <= ?
-        pig.registerQuery("result= LOAD 'cql://cql3ks/compotable?" + defaultParameters + nativeParameters + "&input_cql=select%20*%20from%20compotable%20where%20token(a)%20%3E%20%3F%20and%20token(a)%20%3C%3D%20%3F' USING CqlNativeStorage();");
-        Iterator<Tuple> it = pig.openIterator("result");
-        int count = 0;
-        while (it.hasNext()) {
-            it.next();
-            count ++;
-        }
-        Assert.assertEquals(count, 9);
-    }
-
-    @Test
-    public void testCqlNativeStorageCollectionColumnTable() throws IOException
-    {
-        //input_cql=select * from collectiontable where token(m) > ? and token(m) <= ?
-        CollectionColumnTableTest("collectiontable= LOAD 'cql://cql3ks/collectiontable?" + defaultParameters + nativeParameters + "&input_cql=select%20*%20from%20collectiontable%20where%20token(m)%20%3E%20%3F%20and%20token(m)%20%3C%3D%20%3F' USING CqlNativeStorage();");
-    }
-
-    private void CollectionColumnTableTest(String initialQuery) throws IOException
-    {
-        pig.setBatchOn();
-        pig.registerQuery(initialQuery);
-        pig.registerQuery("recs= FOREACH collectiontable GENERATE TOTUPLE(TOTUPLE('m', m) ), TOTUPLE(TOTUPLE('map', TOTUPLE('m', 'mm'), TOTUPLE('n', 'nn')));");
-        pig.registerQuery("STORE recs INTO 'cql://cql3ks/collectiontable?" + defaultParameters + nativeParameters + "&output_query=update+cql3ks.collectiontable+set+n+%3D+%3F' USING CqlNativeStorage();");
-        pig.executeBatch();
-
-        //(book2,((m,mm),(n,nn)))
-        //(book3,((m,mm),(n,nn)))
-        //(book4,((m,mm),(n,nn)))
-        //(book1,((m,mm),(n,nn)))
-        //input_cql=select * from collectiontable where token(m) > ? and token(m) <= ?
-        pig.registerQuery("result= LOAD 'cql://cql3ks/collectiontable?" + defaultParameters + nativeParameters + "&input_cql=select%20*%20from%20collectiontable%20where%20token(m)%20%3E%20%3F%20and%20token(m)%20%3C%3D%20%3F' USING CqlNativeStorage();");
-        Iterator<Tuple> it = pig.openIterator("result");
-        if (it.hasNext()) {
-            Tuple t = it.next();
-            Tuple t1 = (Tuple) t.get(1);
-            Assert.assertEquals(t1.size(), 2);
-            Tuple element1 = (Tuple) t1.get(0);
-            Tuple element2 = (Tuple) t1.get(1);
-            Assert.assertEquals(element1.get(0), "m");
-            Assert.assertEquals(element1.get(1), "mm");
-            Assert.assertEquals(element2.get(0), "n");
-            Assert.assertEquals(element2.get(1), "nn");
-        }
-        else
-        {
-            Assert.fail("Can't fetch any data");
-        }
-    }
-
-    @Test
-    public void testCqlNativeStorageNullTuples() throws IOException
-    {
-        //input_cql=select * from collectiontable where token(m) > ? and token(m) <= ?
-        NullTupleTest("nulltable= LOAD 'cql://cql3ks/collectiontable?" + defaultParameters + nativeParameters + "&input_cql=select%20*%20from%20nulltable%20where%20token(m)%20%3E%20%3F%20and%20token(m)%20%3C%3D%20%3F' USING CqlNativeStorage();");
-    }
-
-    private void NullTupleTest(String initialQuery) throws IOException
-    {
-        pig.setBatchOn();
-        pig.registerQuery(initialQuery);
-        pig.registerQuery("recs= FOREACH nulltable GENERATE TOTUPLE(TOTUPLE('m', m) ), TOTUPLE(TOTUPLE('map', TOTUPLE('m', null), TOTUPLE('n', null)));");
-        pig.registerQuery("STORE recs INTO 'cql://cql3ks/nulltable?" + defaultParameters + nativeParameters + "&output_query=update+cql3ks.nulltable+set+n+%3D+%3F' USING CqlNativeStorage();");
-        pig.executeBatch();
-
-        pig.registerQuery("result= LOAD 'cql://cql3ks/nulltable?" + defaultParameters + nativeParameters + "&input_cql=select%20*%20from%20nulltable%20where%20token(m)%20%3E%20%3F%20and%20token(m)%20%3C%3D%20%3F' USING CqlNativeStorage();");
-        Iterator<Tuple> it = pig.openIterator("result");
-        if (it.hasNext()) {
-            Tuple t = it.next();
-            Tuple t1 = (Tuple) t.get(1);
-            Assert.assertEquals(t1.size(), 2);
-            Tuple element1 = (Tuple) t1.get(0);
-            Tuple element2 = (Tuple) t1.get(1);
-            Assert.assertEquals(element1.get(0), "m");
-            Assert.assertEquals(element1.get(1), "");
-            Assert.assertEquals(element2.get(0), "n");
-            Assert.assertEquals(element2.get(1), "");
-        }
-        else
-        {
-            Assert.fail("Can't fetch any data");
-        }
-    }
-
-    @Test
-    public void testCqlStorageSingleKeyTableBulkLoad() throws TException, IOException
-    {
-        pig.setBatchOn();
-        //input_cql=select * from moredata where token(x) > ? and token(x) <= ?
-        pig.registerQuery("moretestvalues= LOAD 'cql://cql3ks/moredata?" + defaultParameters + nativeParameters + "&input_cql=select%20*%20from%20moredata%20where%20token(x)%20%3E%20%3F%20and%20token(x)%20%3C%3D%20%3F' USING CqlNativeStorage();");
-        pig.registerQuery("insertformat= FOREACH moretestvalues GENERATE TOTUPLE(x, y);");
-        pig.registerQuery("STORE insertformat INTO 'cql://cql3ks/test_bulk?" + defaultParameters + nativeParameters +  "&bulk_output_format=true&bulk_cf_schema=CREATE%20TABLE%20cql3ks.test_bulk%20(a%20int%20PRIMARY%20KEY%2C%20b%20int)&bulk_insert_statement=Insert%20into%20cql3ks.test_bulk(a%2C%20b)%20values(%3F%2C%3F)' USING CqlNativeStorage();");
-        pig.executeBatch();
-
-        //(5,5)
-        //(6,6)
-        //(4,4)
-        //(2,2)
-        //(3,3)
-        //(1,1)
-        //input_cql=select * from test_bulk1 where token(a) > ? and token(a) <= ?
-        pig.registerQuery("result= LOAD 'cql://cql3ks/test_bulk?" + defaultParameters + nativeParameters + "&input_cql=select%20*%20from%20test_bulk%20where%20token(a)%20%3E%20%3F%20and%20token(a)%20%3C%3D%20%3F' USING CqlNativeStorage();");
-        Iterator<Tuple> it = pig.openIterator("result");
-        int count = 0;
-        while (it.hasNext()) {
-            Tuple t = it.next();
-            Assert.assertEquals(t.get(0), t.get(1));
-            count ++;
-        }
-        Assert.assertEquals(6, count);
-     }
-}

http://git-wip-us.apache.org/repos/asf/cassandra/blob/56cfc6ea/test/pig/org/apache/cassandra/pig/PigTestBase.java
----------------------------------------------------------------------
diff --git a/test/pig/org/apache/cassandra/pig/PigTestBase.java b/test/pig/org/apache/cassandra/pig/PigTestBase.java
deleted file mode 100644
index 067397b..0000000
--- a/test/pig/org/apache/cassandra/pig/PigTestBase.java
+++ /dev/null
@@ -1,117 +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.cassandra.pig;
-
-import java.io.IOException;
-
-import com.datastax.driver.core.Cluster;
-import com.datastax.driver.core.Session;
-import org.apache.cassandra.SchemaLoader;
-import org.apache.cassandra.config.Schema;
-import org.apache.cassandra.db.marshal.AbstractType;
-import org.apache.cassandra.db.marshal.TypeParser;
-import org.apache.cassandra.exceptions.ConfigurationException;
-import org.apache.cassandra.exceptions.SyntaxException;
-import org.apache.cassandra.service.EmbeddedCassandraService;
-import org.apache.cassandra.utils.ByteBufferUtil;
-import org.apache.hadoop.conf.Configuration;
-import org.apache.pig.ExecType;
-import org.apache.pig.PigServer;
-import org.apache.pig.backend.hadoop.datastorage.ConfigurationUtil;
-import org.apache.pig.impl.PigContext;
-import org.apache.pig.test.MiniCluster;
-import org.junit.After;
-import org.junit.AfterClass;
-import org.junit.Before;
-
-public class PigTestBase extends SchemaLoader
-{
-    protected static EmbeddedCassandraService cassandra;
-    protected static Configuration conf;
-    protected static MiniCluster cluster; 
-    protected static PigServer pig;
-    protected static String defaultParameters= "init_address=localhost&rpc_port=9170&partitioner=org.apache.cassandra.dht.Murmur3Partitioner";
-    protected static String nativeParameters = "&core_conns=2&max_conns=10&min_simult_reqs=3&max_simult_reqs=10&native_timeout=10000000"  +
-                                               "&native_read_timeout=10000000&send_buff_size=4096&receive_buff_size=4096&solinger=3" +
-                                               "&tcp_nodelay=true&reuse_address=true&keep_alive=true&native_port=9042";
-
-    static
-    {
-        System.setProperty("logback.configurationFile", "logback-test.xml");
-        System.setProperty("cassandra.config", "cassandra_pig.yaml");
-    }
-
-    @AfterClass
-    public static void oneTimeTearDown() throws Exception {
-        cluster.shutDown();
-    }
-
-    @Before
-    public void beforeTest() throws Exception {
-        pig = new PigServer(new PigContext(ExecType.LOCAL, ConfigurationUtil.toProperties(conf)));
-        PigContext.initializeImportList("org.apache.cassandra.hadoop.pig");   
-    }
-
-    @After
-    public void tearDown() throws Exception {
-        pig.shutdown();
-    }
-
-    protected static Session getClient()
-    {
-        Cluster cluster = Cluster.builder().addContactPoints("localhost").withPort(9042).build();
-        return cluster.connect();
-    }
-
-    protected static void startCassandra() throws IOException
-    {
-        Schema.instance.clear(); // Schema are now written on disk and will be reloaded
-        cassandra = new EmbeddedCassandraService();
-        cassandra.start();
-    }
-
-    protected static void startHadoopCluster()
-    {
-        cluster = MiniCluster.buildCluster();
-        conf = cluster.getConfiguration();
-    }
-
-    protected AbstractType parseType(String type) throws IOException
-    {
-        try
-        {
-            return TypeParser.parse(type);
-        }
-        catch (ConfigurationException | SyntaxException e)
-        {
-            throw new IOException(e);
-        }
-    }
-
-    protected static void executeCQLStatements(String[] statements)
-    {
-        Session client = getClient();
-
-        for (String statement : statements)
-        {
-            System.out.println("Executing statement: " + statement);
-            client.execute(statement);
-        }
-    }
-}

http://git-wip-us.apache.org/repos/asf/cassandra/blob/56cfc6ea/test/pig/org/apache/cassandra/pig/ThriftColumnFamilyDataTypeTest.java
----------------------------------------------------------------------
diff --git a/test/pig/org/apache/cassandra/pig/ThriftColumnFamilyDataTypeTest.java b/test/pig/org/apache/cassandra/pig/ThriftColumnFamilyDataTypeTest.java
deleted file mode 100644
index 273cdff..0000000
--- a/test/pig/org/apache/cassandra/pig/ThriftColumnFamilyDataTypeTest.java
+++ /dev/null
@@ -1,150 +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.cassandra.pig;
-
-import java.io.IOException;
-
-import org.apache.cassandra.db.marshal.TimeUUIDType;
-import org.apache.cassandra.db.marshal.UUIDType;
-import org.apache.cassandra.exceptions.ConfigurationException;
-import org.apache.cassandra.utils.Hex;
-import org.apache.pig.data.DataByteArray;
-import org.apache.pig.data.Tuple;
-import org.junit.BeforeClass;
-import org.junit.Test;
-
-import static junit.framework.Assert.assertEquals;
-
-public class ThriftColumnFamilyDataTypeTest extends PigTestBase
-{
-    private static String[] statements = {
-            "DROP KEYSPACE IF EXISTS thrift_ks",
-            "CREATE KEYSPACE thrift_ks WITH replication = {'class': 'SimpleStrategy', 'replication_factor': 1};",
-            "USE thrift_ks;",
-
-            "CREATE TABLE some_app (" +
-            "key text PRIMARY KEY," +
-            "col_ascii ascii," +
-            "col_bigint bigint," +
-            "col_blob blob," +
-            "col_boolean boolean," +
-            "col_decimal decimal," +
-            "col_double double," +
-            "col_float float," +
-            "col_inet inet," +
-            "col_int int," +
-            "col_text text," +
-            "col_timestamp timestamp," +
-            "col_timeuuid timeuuid," +
-            "col_uuid uuid," +
-            "col_varint varint)" +
-            " WITH COMPACT STORAGE;",
-
-            "INSERT INTO some_app (key, col_ascii, col_bigint, col_blob, col_boolean, col_decimal, col_double, col_float," +
-                "col_inet, col_int, col_text, col_timestamp, col_uuid, col_varint, col_timeuuid) " +
-                    "VALUES ('foo', 'ascii', 12345678, 0xDEADBEEF, false, 23.345, 2.7182818284590451, 23.45, '127.0.0.1', 23, 'hello', " +
-                        "'2011-02-03T04:05:00+0000', 550e8400-e29b-41d4-a716-446655440000, 12345, e23f450f-53a6-11e2-7f7f-7f7f7f7f7f7f);",
-
-            "CREATE TABLE cc (key text, name text, value counter, PRIMARY KEY (key, name)) WITH COMPACT STORAGE",
-
-            "UPDATE cc SET value = value + 3 WHERE key = 'chuck' AND name = 'kick'",
-    };
-
-    @BeforeClass
-    public static void setup() throws IOException, ConfigurationException
-    {
-        startCassandra();
-        executeCQLStatements(statements);
-        startHadoopCluster();
-    }
-
-    @Test
-    public void testCassandraStorageDataType() throws IOException
-    {
-        pig.registerQuery("rows = LOAD 'cql://thrift_ks/some_app?" + defaultParameters + "' USING CqlNativeStorage();");
-        Tuple t = pig.openIterator("rows").next();
-
-        // key
-        assertEquals("foo", t.get(0));
-
-        // col_ascii
-        Object column = t.get(1);
-        assertEquals("ascii", column);
-
-        // col_bigint
-        column = t.get(2);
-        assertEquals(12345678L, column);
-
-        // col_blob
-        column = t.get(3);
-        assertEquals(new DataByteArray(Hex.hexToBytes("DEADBEEF")), column);
-
-        // col_boolean
-        column = t.get(4);
-        assertEquals(false, column);
-
-        // col_decimal
-        column = t.get(5);
-        assertEquals("23.345", column);
-
-        // col_double
-        column = t.get(6);
-        assertEquals(2.7182818284590451d, column);
-
-        // col_float
-        column = t.get(7);
-        assertEquals(23.45f, column);
-
-        // col_inet
-        column = t.get(8);
-        assertEquals("127.0.0.1", column);
-
-        // col_int
-        column = t.get(9);
-        assertEquals(23, column);
-
-        // col_text
-        column = t.get(10);
-        assertEquals("hello", column);
-
-        // col_timestamp
-        column = t.get(11);
-        assertEquals(1296705900000L, column);
-
-        // col_timeuuid
-        column = t.get(12);
-        assertEquals(new DataByteArray((TimeUUIDType.instance.fromString("e23f450f-53a6-11e2-7f7f-7f7f7f7f7f7f").array())), column);
-
-        // col_uuid
-        column = t.get(13);
-        assertEquals(new DataByteArray((UUIDType.instance.fromString("550e8400-e29b-41d4-a716-446655440000").array())), column);
-
-        // col_varint
-        column = t.get(14);
-        assertEquals(12345, column);
-
-        pig.registerQuery("cc_rows = LOAD 'cql://thrift_ks/cc?" + defaultParameters + "' USING CqlNativeStorage();");
-        t = pig.openIterator("cc_rows").next();
-
-        assertEquals("chuck", t.get(0));
-
-        assertEquals("kick", t.get(1));
-        assertEquals(3L, t.get(2));
-    }
-}

http://git-wip-us.apache.org/repos/asf/cassandra/blob/56cfc6ea/test/pig/org/apache/cassandra/pig/ThriftColumnFamilyTest.java
----------------------------------------------------------------------
diff --git a/test/pig/org/apache/cassandra/pig/ThriftColumnFamilyTest.java b/test/pig/org/apache/cassandra/pig/ThriftColumnFamilyTest.java
deleted file mode 100644
index 93ac5be..0000000
--- a/test/pig/org/apache/cassandra/pig/ThriftColumnFamilyTest.java
+++ /dev/null
@@ -1,617 +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.cassandra.pig;
-
-import java.io.IOException;
-import java.nio.ByteBuffer;
-import java.util.Iterator;
-
-import com.datastax.driver.core.ResultSet;
-import com.datastax.driver.core.Row;
-import com.datastax.driver.core.Session;
-import org.apache.cassandra.exceptions.ConfigurationException;
-import org.apache.cassandra.utils.ByteBufferUtil;
-import org.apache.pig.data.DataBag;
-import org.apache.pig.data.DataByteArray;
-import org.apache.pig.data.Tuple;
-
-import org.junit.Assert;
-import org.junit.BeforeClass;
-import org.junit.Test;
-
-public class ThriftColumnFamilyTest extends PigTestBase
-{
-    private static String[] statements = {
-            "DROP KEYSPACE IF EXISTS thrift_ks",
-            "CREATE KEYSPACE thrift_ks WITH replication = {'class': 'SimpleStrategy', 'replication_factor': 1};",
-            "USE thrift_ks;",
-
-            "CREATE TABLE some_app (" +
-            "key text PRIMARY KEY," +
-            "name text," +
-            "vote_type text," +
-            "rating int," +
-            "score bigint," +
-            "percent float," +
-            "atomic_weight double," +
-            "created timestamp)" +
-            " WITH COMPACT STORAGE;",
-
-            "CREATE INDEX ON some_app(name);",
-
-            "INSERT INTO some_app (key, name, vote_type, rating, score, percent, atomic_weight, created) " +
-                    "VALUES ('foo', 'User Foo', 'like', 8, 125000, 85.0, 2.7182818284590451, 1335890877);",
-
-            "INSERT INTO some_app (key, name, vote_type, rating, score, percent, atomic_weight, created) " +
-                    "VALUES ('bar', 'User Bar', 'like', 9, 15000, 35.0, 3.1415926535897931, 1335890877);",
-
-            "INSERT INTO some_app (key, name, vote_type, rating, score, percent, atomic_weight, created) " +
-                    "VALUES ('baz', 'User Baz', 'dislike', 3, 512000, 95.3, 1.61803399, 1335890877);",
-
-            "INSERT INTO some_app (key, name, vote_type, rating, score, percent, atomic_weight, created) " +
-                    "VALUES ('qux', 'User Qux', 'dislike', 2, 12000, 64.7, 0.660161815846869, 1335890877);",
-
-            "CREATE TABLE copy_of_some_app (" +
-            "key text PRIMARY KEY," +
-            "name text," +
-            "vote_type text," +
-            "rating int," +
-            "score bigint," +
-            "percent float," +
-            "atomic_weight double," +
-            "created timestamp)" +
-            " WITH COMPACT STORAGE;",
-
-            "CREATE INDEX ON copy_of_some_app(name);",
-
-            "CREATE TABLE u8 (" +
-            "key text," +
-            "column1 text," +
-            "value blob," +
-            "PRIMARY KEY (key, column1))" +
-            " WITH COMPACT STORAGE",
-
-            "INSERT INTO u8 (key, column1, value) VALUES ('foo', 'x', asciiAsBlob('Z'))",
-
-            "CREATE TABLE bytes (" +
-            "key blob," +
-            "column1 text," +
-            "value blob," +
-            "PRIMARY KEY (key, column1))" +
-            " WITH COMPACT STORAGE",
-
-            "INSERT INTO bytes (key, column1, value) VALUES (asciiAsBlob('foo'), 'x', asciiAsBlob('Z'))",
-
-            "CREATE TABLE cc (key text, name text, value counter, PRIMARY KEY (key, name)) WITH COMPACT STORAGE",
-
-            "UPDATE cc SET value = value + 3 WHERE key = 'chuck' AND name = 'kick'",
-            "UPDATE cc SET value = value + 1 WHERE key = 'chuck' AND name = 'fist'",
-
-            "CREATE TABLE compo (" +
-            "key text," +
-            "column1 text," +
-            "column2 text," +
-            "value text," +
-            "PRIMARY KEY (key, column1, column2))" +
-            " WITH COMPACT STORAGE",
-
-            "INSERT INTO compo (key, column1, column2, value) VALUES ('punch', 'bruce', 'lee', 'ouch');",
-            "INSERT INTO compo (key, column1, column2, value) VALUES ('punch', 'bruce', 'bruce', 'hunh?');",
-            "INSERT INTO compo (key, column1, column2, value) VALUES ('kick', 'bruce', 'lee', 'oww');",
-            "INSERT INTO compo (key, column1, column2, value) VALUES ('kick', 'bruce', 'bruce', 'watch it, mate');",
-
-            "CREATE TABLE compo_int (" +
-            "key text," +
-            "column1 bigint," +
-            "column2 bigint," +
-            "value text," +
-            "PRIMARY KEY (key, column1, column2))" +
-            " WITH COMPACT STORAGE",
-
-            "INSERT INTO compo_int (key, column1, column2, value) VALUES ('clock', 1, 0, 'z');",
-            "INSERT INTO compo_int (key, column1, column2, value) VALUES ('clock', 1, 30, 'zzzz');",
-            "INSERT INTO compo_int (key, column1, column2, value) VALUES ('clock', 2, 30, 'daddy?');",
-            "INSERT INTO compo_int (key, column1, column2, value) VALUES ('clock', 6, 30, 'coffee...');",
-
-            "CREATE TABLE compo_int_copy (" +
-            "key text," +
-            "column1 bigint," +
-            "column2 bigint," +
-            "value text," +
-            "PRIMARY KEY (key, column1, column2))" +
-            " WITH COMPACT STORAGE",
-
-            "CREATE TABLE compo_key (" +
-            "key text," +
-            "column1 bigint," +
-            "column2 bigint," +
-            "value text," +
-            "PRIMARY KEY ((key, column1), column2))" +
-            " WITH COMPACT STORAGE",
-
-            "INSERT INTO compo_key (key, column1, column2, value) VALUES ('clock', 10, 1, 'z');",
-            "INSERT INTO compo_key (key, column1, column2, value) VALUES ('clock', 20, 1, 'zzzz');",
-            "INSERT INTO compo_key (key, column1, column2, value) VALUES ('clock', 30, 2, 'daddy?');",
-            "INSERT INTO compo_key (key, column1, column2, value) VALUES ('clock', 40, 6, 'coffee...');",
-
-            "CREATE TABLE compo_key_copy (" +
-            "key text," +
-            "column1 bigint," +
-            "column2 bigint," +
-            "value text," +
-            "PRIMARY KEY ((key, column1), column2))" +
-            " WITH COMPACT STORAGE",
-    };
-
-    private static String[] deleteCopyOfSomeAppTableData = {
-            "use thrift_ks;",
-            "DELETE FROM copy_of_some_app WHERE key = 'foo';",
-            "DELETE FROM copy_of_some_app WHERE key = 'bar';",
-            "DELETE FROM copy_of_some_app WHERE key = 'baz';",
-            "DELETE FROM copy_of_some_app WHERE key = 'qux';",
-    };
-
-    @BeforeClass
-    public static void setup() throws IOException, ConfigurationException
-    {
-        startCassandra();
-        executeCQLStatements(statements);
-        startHadoopCluster();
-    }
-
-    @Test
-    public void testCqlNativeStorage() throws IOException
-    {
-        //regular thrift column families
-        //input_cql=select * from "some_app" where token(key) > ? and token(key) <= ?
-        cqlStorageTest("data = load 'cql://thrift_ks/some_app?" + defaultParameters + nativeParameters + "&input_cql=select%20*%20from%20%22some_app%22%20where%20token(key)%20%3E%20%3F%20and%20token(key)%20%3C%3D%20%3F' using CqlNativeStorage();");
-
-        //Test counter column family
-        //input_cql=select * from "cc" where token(key) > ? and token(key) <= ?
-        cqlStorageCounterTableTest("cc_data = load 'cql://thrift_ks/cc?" + defaultParameters + nativeParameters + "&input_cql=select%20*%20from%20%22cc%22%20where%20token(key)%20%3E%20%3F%20and%20token(key)%20%3C%3D%20%3F' using CqlNativeStorage();");
-
-        //Test composite column family
-        //input_cql=select * from "compo" where token(key) > ? and token(key) <= ?
-        cqlStorageCompositeTableTest("compo_data = load 'cql://thrift_ks/compo?" + defaultParameters + nativeParameters + "&input_cql=select%20*%20from%20%22compo%22%20where%20token(key)%20%3E%20%3F%20and%20token(key)%20%3C%3D%20%3F' using CqlNativeStorage();");
-    }
-
-    private void cqlStorageTest(String initialQuery) throws IOException
-    {
-        pig.registerQuery(initialQuery);
-
-        //(bar,3.141592653589793,1335890877,User Bar,35.0,9,15000,like)
-        //(baz,1.61803399,1335890877,User Baz,95.3,3,512000,dislike)
-        //(foo,2.718281828459045,1335890877,User Foo,85.0,8,125000,like)
-        //(qux,0.660161815846869,1335890877,User Qux,64.7,2,12000,dislike)
-
-        //{key: chararray,atomic_weight: double,created: long,name: chararray,percent: float,rating: int,score: long,vote_type: chararray}
-        Iterator<Tuple> it = pig.openIterator("data");
-        int count = 0;
-        while (it.hasNext()) {
-            count ++;
-            Tuple t = it.next();
-            if ("bar".equals(t.get(0)))
-            {
-                Assert.assertEquals(t.get(1), 3.141592653589793d);
-                Assert.assertEquals(t.get(3), "User Bar");
-                Assert.assertEquals(t.get(4), 35.0f);
-                Assert.assertEquals(t.get(5), 9);
-                Assert.assertEquals(t.get(6), 15000L);
-                Assert.assertEquals(t.get(7), "like");
-            }
-            else if ("baz".equals(t.get(0)))
-            {
-                Assert.assertEquals(t.get(1), 1.61803399d);
-                Assert.assertEquals(t.get(3), "User Baz");
-                Assert.assertEquals(t.get(4), 95.3f);
-                Assert.assertEquals(t.get(5), 3);
-                Assert.assertEquals(t.get(6), 512000L);
-                Assert.assertEquals(t.get(7), "dislike");
-            }
-            else if ("foo".equals(t.get(0)))
-            {
-                Assert.assertEquals(t.get(0), "foo");
-                Assert.assertEquals(t.get(1), 2.718281828459045d);
-                Assert.assertEquals(t.get(3), "User Foo");
-                Assert.assertEquals(t.get(4), 85.0f);
-                Assert.assertEquals(t.get(5), 8);
-                Assert.assertEquals(t.get(6), 125000L);
-                Assert.assertEquals(t.get(7), "like");
-            }
-            else if ("qux".equals(t.get(0)))
-            {
-                Assert.assertEquals(t.get(0), "qux");
-                Assert.assertEquals(t.get(1), 0.660161815846869d);
-                Assert.assertEquals(t.get(3), "User Qux");
-                Assert.assertEquals(t.get(4), 64.7f);
-                Assert.assertEquals(t.get(5), 2);
-                Assert.assertEquals(t.get(6), 12000L);
-                Assert.assertEquals(t.get(7), "dislike");
-            }
-        }
-        Assert.assertEquals(count, 4);
-    }
-
-    private void cqlStorageCounterTableTest(String initialQuery) throws IOException
-    {
-        pig.registerQuery(initialQuery);
-
-        //(chuck,fist,1)
-        //(chuck,kick,3)
-
-        // {key: chararray,column1: chararray,value: long}
-        Iterator<Tuple> it = pig.openIterator("cc_data");
-        int count = 0;
-        while (it.hasNext()) {
-            count ++;
-            Tuple t = it.next();
-            if ("chuck".equals(t.get(0)) && "fist".equals(t.get(1)))
-                Assert.assertEquals(t.get(2), 1L);
-            else if ("chuck".equals(t.get(0)) && "kick".equals(t.get(1)))
-                Assert.assertEquals(t.get(2), 3L);
-        }
-        Assert.assertEquals(count, 2);
-    }
-
-    private void cqlStorageCompositeTableTest(String initialQuery) throws IOException
-    {
-        pig.registerQuery(initialQuery);
-
-        //(kick,bruce,bruce,watch it, mate)
-        //(kick,bruce,lee,oww)
-        //(punch,bruce,bruce,hunh?)
-        //(punch,bruce,lee,ouch)
-
-        //{key: chararray,column1: chararray,column2: chararray,value: chararray}
-        Iterator<Tuple> it = pig.openIterator("compo_data");
-        int count = 0;
-        while (it.hasNext()) {
-            count ++;
-            Tuple t = it.next();
-            if ("kick".equals(t.get(0)) && "bruce".equals(t.get(1)) && "bruce".equals(t.get(2)))
-                Assert.assertEquals(t.get(3), "watch it, mate");
-            else if ("kick".equals(t.get(0)) && "bruce".equals(t.get(1)) && "lee".equals(t.get(2)))
-                Assert.assertEquals(t.get(3), "oww");
-            else if ("punch".equals(t.get(0)) && "bruce".equals(t.get(1)) && "bruce".equals(t.get(2)))
-                Assert.assertEquals(t.get(3), "hunh?");
-            else if ("punch".equals(t.get(0)) && "bruce".equals(t.get(1)) && "lee".equals(t.get(2)))
-                Assert.assertEquals(t.get(3), "ouch");
-        }
-        Assert.assertEquals(count, 4);
-    }
-
-    @Test
-    public void testCqlNativeStorageSchema() throws IOException
-    {
-        //results: (qux,(atomic_weight,0.660161815846869),(created,1335890877),(name,User Qux),(percent,64.7),
-        //(rating,2),(score,12000),(vote_type,dislike))
-        pig.registerQuery("rows = LOAD 'cql://thrift_ks/some_app?" + defaultParameters + "' USING CqlNativeStorage();");
-
-        //schema: {key: chararray,atomic_weight: (name: chararray,value: double),created: (name: chararray,value: long),
-        //name: (name: chararray,value: chararray),percent: (name: chararray,value: float),
-        //rating: (name: chararray,value: int),score: (name: chararray,value: long),
-        //vote_type: (name: chararray,value: chararray),columns: {(name: chararray,value: chararray)}}
-        Iterator<Tuple> it = pig.openIterator("rows");
-        if (it.hasNext()) {
-            Tuple t = it.next();
-            String rowKey =  t.get(0).toString();
-            if ("qux".equals(rowKey))
-            {
-                Tuple column = (Tuple) t.get(1);
-                Assert.assertEquals(column.get(0), "atomic_weight");
-                Assert.assertEquals(column.get(1), 0.660161815846869d);
-                column = (Tuple) t.get(3);
-                Assert.assertEquals(column.get(0), "name");
-                Assert.assertEquals(column.get(1), "User Qux");
-                column = (Tuple) t.get(4);
-                Assert.assertEquals(column.get(0), "percent");
-                Assert.assertEquals(column.get(1), 64.7f);
-                column = (Tuple) t.get(5);
-                Assert.assertEquals(column.get(0), "rating");
-                Assert.assertEquals(column.get(1), 2);
-                column = (Tuple) t.get(6);
-                Assert.assertEquals(column.get(0), "score");
-                Assert.assertEquals(column.get(1), 12000L);
-                column = (Tuple) t.get(7);
-                Assert.assertEquals(column.get(0), "vote_type");
-                Assert.assertEquals(column.get(1), "dislike");
-            }
-        }
-    }
-
-    @Test
-    public void testCqlNativeStorageFullCopy() throws IOException
-    {
-        pig.setBatchOn();
-        pig.registerQuery("rows = LOAD 'cql://thrift_ks/some_app?" + defaultParameters + nativeParameters + "&input_cql=select%20*%20from%20some_app%20where%20token(key)%20%3E%20%3F%20and%20token(key)%20%3C%3D%20%3F' USING CqlNativeStorage();");
-        pig.registerQuery("records = FOREACH rows GENERATE TOTUPLE(TOTUPLE('key', key)),TOTUPLE(atomic_weight, created, name, percent, rating, score, vote_type);");
-        //full copy
-        pig.registerQuery("STORE records INTO 'cql://thrift_ks/copy_of_some_app?" + defaultParameters + nativeParameters + "&output_query=UPDATE+thrift_ks.copy_of_some_app+set+atomic_weight+%3D+%3F,+created+%3D+%3F,+name+%3D+%3F,+percent+%3D+%3F,+rating+%3D+%3F,+score+%3D+%3F,+vote_type+%3D+%3F' USING CqlNativeStorage();");
-        pig.executeBatch();
-        Assert.assertEquals("User Qux", getColumnValue("thrift_ks", "copy_of_some_app", "name", "qux", "UTF8Type"));
-        Assert.assertEquals("dislike", getColumnValue("thrift_ks", "copy_of_some_app", "vote_type", "qux", "UTF8Type"));
-        Assert.assertEquals("64.7", getColumnValue("thrift_ks", "copy_of_some_app", "percent", "qux", "FloatType"));
-    }
-
-    @Test
-    public void testCqlNativeStorageSingleTupleCopy() throws IOException
-    {
-        executeCQLStatements(deleteCopyOfSomeAppTableData);
-        pig.setBatchOn();
-        pig.registerQuery("rows = LOAD 'cql://thrift_ks/some_app?" + defaultParameters + nativeParameters + "&input_cql=select%20*%20from%20some_app%20where%20token(key)%20%3E%20%3F%20and%20token(key)%20%3C%3D%20%3F' USING CqlNativeStorage();");
-        //single tuple
-        pig.registerQuery("onecol = FOREACH rows GENERATE TOTUPLE(TOTUPLE('key', key)), TOTUPLE(percent);");
-        pig.registerQuery("STORE onecol INTO 'cql://thrift_ks/copy_of_some_app?" + defaultParameters + nativeParameters + "&output_query=UPDATE+thrift_ks.copy_of_some_app+set+percent+%3D+%3F' USING CqlNativeStorage();");
-        pig.executeBatch();
-        String value = getColumnValue("thrift_ks", "copy_of_some_app", "name", "qux", "UTF8Type");
-        if (value != null)
-            Assert.fail();
-        value = getColumnValue("thrift_ks", "copy_of_some_app", "vote_type", "qux", "UTF8Type");
-        if (value != null)
-            Assert.fail();
-        Assert.assertEquals("64.7", getColumnValue("thrift_ks", "copy_of_some_app", "percent", "qux", "FloatType"));
-    }
-
-    @Test
-    public void testCqlNativeStorageBagOnlyCopy() throws IOException
-    {
-        executeCQLStatements(deleteCopyOfSomeAppTableData);
-        pig.setBatchOn();
-        pig.registerQuery("rows = LOAD 'cql://thrift_ks/some_app?" + defaultParameters + nativeParameters + "&input_cql=select%20*%20from%20some_app%20where%20token(key)%20%3E%20%3F%20and%20token(key)%20%3C%3D%20%3F' USING CqlNativeStorage();");
-        //bag only
-        pig.registerQuery("other = FOREACH rows GENERATE TOTUPLE(TOTUPLE('key', key)), TOTUPLE();");
-        pig.registerQuery("STORE other INTO 'cql://thrift_ks/copy_of_some_app?" + defaultParameters + nativeParameters + "' USING CqlNativeStorage();");
-        pig.executeBatch();
-        String value = getColumnValue("thrift_ks", "copy_of_some_app", "name", "qux", "UTF8Type");
-        if (value != null)
-            Assert.fail();
-        value = getColumnValue("thrift_ks", "copy_of_some_app", "vote_type", "qux", "UTF8Type");
-        if (value != null)
-            Assert.fail();
-        value = getColumnValue("thrift_ks", "copy_of_some_app", "percent", "qux", "FloatType");
-        if (value != null)
-            Assert.fail();
-    }
-
-    @Test
-    public void testCqlNativeStorageFilter() throws IOException
-    {
-        executeCQLStatements(deleteCopyOfSomeAppTableData);
-        pig.setBatchOn();
-        pig.registerQuery("rows = LOAD 'cql://thrift_ks/some_app?" + defaultParameters + nativeParameters + "&input_cql=select%20*%20from%20some_app%20where%20token(key)%20%3E%20%3F%20and%20token(key)%20%3C%3D%20%3F' USING CqlNativeStorage();");
-
-        //filter
-        pig.registerQuery("likes = FILTER rows by vote_type eq 'like' and rating > 5;");
-        pig.registerQuery("records = FOREACH likes GENERATE TOTUPLE(TOTUPLE('key', key)),TOTUPLE(atomic_weight, created, name, percent, rating, score, vote_type);");
-        pig.registerQuery("STORE records INTO 'cql://thrift_ks/copy_of_some_app?" + defaultParameters + nativeParameters + "&output_query=UPDATE+thrift_ks.copy_of_some_app+set+atomic_weight+%3D+%3F,+created+%3D+%3F,+name+%3D+%3F,+percent+%3D+%3F,+rating+%3D+%3F,+score+%3D+%3F,+vote_type+%3D+%3F' USING CqlNativeStorage();");
-        pig.executeBatch();
-
-        Assert.assertEquals("like", getColumnValue("thrift_ks", "copy_of_some_app", "vote_type", "bar", "UTF8Type"));
-        Assert.assertEquals("like", getColumnValue("thrift_ks", "copy_of_some_app", "vote_type", "foo", "UTF8Type"));
-        String value = getColumnValue("thrift_ks", "copy_of_some_app", "vote_type", "qux", "UTF8Type");
-        if (value != null)
-            Assert.fail();
-        value = getColumnValue("thrift_ks", "copy_of_some_app", "vote_type", "baz", "UTF8Type");
-
-        if (value != null)
-            Assert.fail();
-
-        executeCQLStatements(deleteCopyOfSomeAppTableData);
-        pig.setBatchOn();
-        pig.registerQuery("rows = LOAD 'cql://thrift_ks/some_app?" + defaultParameters + nativeParameters + "&input_cql=select%20*%20from%20some_app%20where%20token(key)%20%3E%20%3F%20and%20token(key)%20%3C%3D%20%3F' USING CqlNativeStorage();");
-        pig.registerQuery("dislikes_extras = FILTER rows by vote_type eq 'dislike';");
-        pig.registerQuery("dislikes_records = FOREACH dislikes_extras GENERATE TOTUPLE(TOTUPLE('key', key)),TOTUPLE(atomic_weight, created, name, percent, rating, score, vote_type);");
-        pig.registerQuery("STORE dislikes_records INTO 'cql://thrift_ks/copy_of_some_app?" + defaultParameters + nativeParameters + "&output_query=UPDATE+thrift_ks.copy_of_some_app+set+atomic_weight+%3D+%3F,+created+%3D+%3F,+name+%3D+%3F,+percent+%3D+%3F,+rating+%3D+%3F,+score+%3D+%3F,+vote_type+%3D+%3F' USING CqlNativeStorage();");
-        pig.executeBatch();
-        Assert.assertEquals("dislike", getColumnValue("thrift_ks", "copy_of_some_app", "vote_type", "baz", "UTF8Type"));
-        Assert.assertEquals("dislike", getColumnValue("thrift_ks", "copy_of_some_app", "vote_type", "qux", "UTF8Type"));
-        value = getColumnValue("thrift_ks", "copy_of_some_app", "vote_type", "bar", "UTF8Type");
-        if (value != null)
-            Assert.fail();
-        value = getColumnValue("thrift_ks", "copy_of_some_app", "vote_type", "foo", "UTF8Type");
-        if (value != null)
-            Assert.fail();
-    }
-
-    @Test
-    public void testCqlNativeStorageJoin() throws IOException
-    {
-        //test key types with a join
-        pig.registerQuery("U8 = load 'cql://thrift_ks/u8?" + defaultParameters + nativeParameters + "&input_cql=select%20*%20from%20u8%20where%20token(key)%20%3E%20%3F%20and%20token(key)%20%3C%3D%20%3F' using CqlNativeStorage();");
-        pig.registerQuery("Bytes = load 'cql://thrift_ks/bytes?" + defaultParameters + nativeParameters + "&input_cql=select%20*%20from%20bytes%20where%20token(key)%20%3E%20%3F%20and%20token(key)%20%3C%3D%20%3F' using CqlNativeStorage();");
-
-        //cast key to chararray
-        pig.registerQuery("b = foreach Bytes generate (chararray)key, column1, value;");
-
-        //key in Bytes is a bytearray, U8 chararray
-        //(foo,{(x,Z)},foo,{(x,Z)})
-        pig.registerQuery("a = join Bytes by key, U8 by key;");
-        Iterator<Tuple> it = pig.openIterator("a");
-        if (it.hasNext()) {
-            Tuple t = it.next();
-            Assert.assertEquals(t.get(0), new DataByteArray("foo".getBytes()));
-            Assert.assertEquals(t.get(1), "x");
-            Assert.assertEquals(t.get(2), new DataByteArray("Z".getBytes()));
-            Assert.assertEquals(t.get(3), "foo");
-            Assert.assertEquals(t.get(4), "x");
-            Assert.assertEquals(t.get(5), new DataByteArray("Z".getBytes()));
-        }
-        //key should now be cast into a chararray
-        //(foo,{(x,Z)},foo,{(x,Z)})
-        pig.registerQuery("c = join b by (chararray)key, U8 by (chararray)key;");
-        it = pig.openIterator("c");
-        if (it.hasNext()) {
-            Tuple t = it.next();
-            Assert.assertEquals(t.get(0), "foo");
-            Assert.assertEquals(t.get(1), "x");
-            Assert.assertEquals(t.get(2), new DataByteArray("Z".getBytes()));
-            Assert.assertEquals(t.get(3), "foo");
-            Assert.assertEquals(t.get(4), "x");
-            Assert.assertEquals(t.get(5), new DataByteArray("Z".getBytes()));
-        }
-    }
-
-    @Test
-    public void testCqlNativeStorageCounterCF() throws IOException
-    {
-        //Test counter column family support
-        pig.registerQuery("CC = load 'cql://thrift_ks/cc?" + defaultParameters + nativeParameters + "&input_cql=select%20*%20from%20cc%20where%20token(key)%20%3E%20%3F%20and%20token(key)%20%3C%3D%20%3F' using CqlNativeStorage();");
-        pig.registerQuery("A = foreach CC generate key, name, value;");
-        pig.registerQuery("B = GROUP A BY key;");
-        pig.registerQuery("total_hits = foreach B generate group, SUM(A.value);");
-        //(chuck,4)
-        Tuple t = pig.openIterator("total_hits").next();
-        Assert.assertEquals(t.get(0), "chuck");
-        Assert.assertEquals(t.get(1), 4l);
-    }
-
-    @Test
-    public void testCqlNativeStorageCompositeColumnCF() throws IOException
-    {
-        //Test CompositeType
-        pig.registerQuery("compo = load 'cql://thrift_ks/compo?" + defaultParameters + nativeParameters + "&input_cql=select%20*%20from%20compo%20where%20token(key)%20%3E%20%3F%20and%20token(key)%20%3C%3D%20%3F' using CqlNativeStorage();");
-        pig.registerQuery("lee = filter compo by column1 == 'bruce' AND column2 == 'lee';");
-
-        //(kick,(bruce,lee),oww)
-        //(punch,(bruce,lee),ouch)
-        Iterator<Tuple> it = pig.openIterator("lee");
-        int count = 0;
-        while (it.hasNext()) {
-            count ++;
-            Tuple t = it.next();
-            Assert.assertEquals(t.get(1), "bruce");
-            Assert.assertEquals(t.get(2), "lee");
-            if ("kick".equals(t.get(0)))
-                Assert.assertEquals(t.get(3), "oww");
-            else
-                Assert.assertEquals(t.get(3), "ouch");
-        }
-        Assert.assertEquals(count, 2);
-        pig.registerQuery("night = load 'cql://thrift_ks/compo_int?" + defaultParameters + nativeParameters + "&input_cql=select%20*%20from%20compo_int%20where%20token(key)%20%3E%20%3F%20and%20token(key)%20%3C%3D%20%3F' using CqlNativeStorage();");
-        pig.registerQuery("night = foreach night generate (int)column1+(double)column2/60 as hour, value as noise;");
-
-        //What happens at the darkest hour?
-        pig.registerQuery("darkest = filter night by hour > 2 and hour < 5;");
-
-        //(2.5,daddy?)
-        it = pig.openIterator("darkest");
-        if (it.hasNext()) {
-            Tuple t = it.next();
-            Assert.assertEquals(t.get(0), 2.5d);
-            Assert.assertEquals(t.get(1), "daddy?");
-        }
-        pig.setBatchOn();
-        pig.registerQuery("compo_int_rows = LOAD 'cql://thrift_ks/compo_int?" + defaultParameters + nativeParameters + "&input_cql=select%20*%20from%20compo_int%20where%20token(key)%20%3E%20%3F%20and%20token(key)%20%3C%3D%20%3F' using CqlNativeStorage();");
-        pig.registerQuery("STORE compo_int_rows INTO 'cql://thrift_ks/compo_int_copy?" + defaultParameters + nativeParameters + "&output_query=UPDATE+thrift_ks.compo_int_copy+set+column1+%3D+%3F,+column2+%3D+%3F,+value+%3D+%3F' using CqlNativeStorage();");
-        pig.executeBatch();
-        pig.registerQuery("compocopy_int_rows = LOAD 'cql://thrift_ks/compo_int_copy?" + defaultParameters + nativeParameters + "&input_cql=select%20*%20from%20compo_int_copy%20where%20token(key)%20%3E%20%3F%20and%20token(key)%20%3C%3D%20%3F' using CqlNativeStorage();");
-        //(clock,{((1,0),z),((1,30),zzzz),((2,30),daddy?),((6,30),coffee...)})
-        it = pig.openIterator("compocopy_int_rows");
-        count = 0;
-        if (it.hasNext()) {
-            Tuple t = it.next();
-            Assert.assertEquals(t.get(0), "clock");
-            DataBag columns = (DataBag) t.get(1);
-            for (Tuple t1 : columns)
-            {
-                count++;
-                Tuple inner = (Tuple) t1.get(0);
-                if ((Long) inner.get(0) == 1L && (Long) inner.get(1) == 0L)
-                    Assert.assertEquals(t1.get(1), "z");
-                else if ((Long) inner.get(0) == 1L && (Long) inner.get(1) == 30L)
-                    Assert.assertEquals(t1.get(1), "zzzz");
-                else if ((Long) inner.get(0) == 2L && (Long) inner.get(1) == 30L)
-                    Assert.assertEquals(t1.get(1), "daddy?");
-                else if ((Long) inner.get(0) == 6L && (Long) inner.get(1) == 30L)
-                    Assert.assertEquals(t1.get(1), "coffee...");
-            }
-            Assert.assertEquals(count, 4);
-        }
-    }
-
-    @Test
-    public void testCqlNativeStorageCompositeKeyCF() throws IOException
-    {
-        //Test CompositeKey
-        pig.registerQuery("compokeys = load 'cql://thrift_ks/compo_key?" + defaultParameters + nativeParameters + "&input_cql=select%20*%20from%20compo_key%20where%20token(key,column1)%20%3E%20%3F%20and%20token(key,column1)%20%3C%3D%20%3F' using CqlNativeStorage();");
-        pig.registerQuery("compokeys = filter compokeys by column1 == 40;");
-        //(clock,40,6,coffee...)
-        Iterator<Tuple> it = pig.openIterator("compokeys");
-        if (it.hasNext()) {
-            Tuple t = it.next();
-            Assert.assertEquals(t.get(0), "clock");
-            Assert.assertEquals(t.get(1), 40L);
-            Assert.assertEquals(t.get(2), 6L);
-            Assert.assertEquals(t.get(3), "coffee...");
-        }
-        pig.setBatchOn();
-        pig.registerQuery("compo_key_rows = LOAD 'cql://thrift_ks/compo_key?" + defaultParameters + nativeParameters + "&input_cql=select%20*%20from%20compo_key%20where%20token(key,column1)%20%3E%20%3F%20and%20token(key,column1)%20%3C%3D%20%3F' using CqlNativeStorage();");
-        pig.registerQuery("compo_key_rows = FOREACH compo_key_rows GENERATE TOTUPLE(TOTUPLE('key',key),TOTUPLE('column1',column1),TOTUPLE('column2',column2)),TOTUPLE(value);");
-        pig.registerQuery("STORE compo_key_rows INTO 'cql://thrift_ks/compo_key_copy?" + defaultParameters + nativeParameters + "&output_query=UPDATE+thrift_ks.compo_key_copy+set+value+%3D+%3F' using CqlNativeStorage();");
-        pig.executeBatch();
-        pig.registerQuery("compo_key_copy_rows = LOAD 'cql://thrift_ks/compo_key_copy?" + defaultParameters + nativeParameters + "&input_cql=select%20*%20from%20compo_key_copy%20where%20token(key,column1)%20%3E%20%3F%20and%20token(key,column1)%20%3C%3D%20%3F' using CqlNativeStorage();");
-        //((clock,10),{(1,z)})
-        //((clock,20),{(1,zzzz)})
-        //((clock,30),{(2,daddy?)})
-        //((clock,40),{(6,coffee...)})
-        it = pig.openIterator("compo_key_copy_rows");
-        int count = 0;
-        while (it.hasNext()) {
-            Tuple t = it.next();
-            count ++;
-            if ("clock".equals(t.get(0)) && (Long) t.get(1) == 10L)
-            {
-                Assert.assertEquals(t.get(2), 1L);
-                Assert.assertEquals(t.get(3), "z");
-            }
-            else if ("clock".equals(t.get(0)) && (Long) t.get(1) == 40L)
-            {
-                Assert.assertEquals(t.get(2), 6L);
-                Assert.assertEquals(t.get(3), "coffee...");
-            }
-            else if ("clock".equals(t.get(0)) && (Long) t.get(1) == 20L)
-            {
-                Assert.assertEquals(t.get(2), 1L);
-                Assert.assertEquals(t.get(3), "zzzz");
-            }
-            else if ("clock".equals(t.get(0)) && (Long) t.get(1) == 30L)
-            {
-                Assert.assertEquals(t.get(2), 2L);
-                Assert.assertEquals(t.get(3), "daddy?");
-            }
-        }
-        Assert.assertEquals(4, count);
-    }
-
-    private String getColumnValue(String ks, String cf, String colName, String key, String validator) throws IOException
-    {
-        Session client = getClient();
-        client.execute("USE " + ks);
-
-        String query = String.format("SELECT %s FROM %s WHERE key = '%s'", colName, cf, key);
-
-        ResultSet rows = client.execute(query);
-        Row row = rows.one();
-
-        if (row == null || row.isNull(0))
-            return null;
-
-        return parseType(validator).getString(row.getBytesUnsafe(0));
-    }
-}

http://git-wip-us.apache.org/repos/asf/cassandra/blob/56cfc6ea/test/pig/org/apache/pig/test/MiniCluster.java
----------------------------------------------------------------------
diff --git a/test/pig/org/apache/pig/test/MiniCluster.java b/test/pig/org/apache/pig/test/MiniCluster.java
deleted file mode 100644
index 95acb84..0000000
--- a/test/pig/org/apache/pig/test/MiniCluster.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.pig.test;
-
-import java.io.File;
-import java.io.FileOutputStream;
-import java.io.IOException;
-import java.io.OutputStream;
-
-import org.apache.cassandra.utils.FBUtilities;
-import org.apache.hadoop.conf.Configuration;
-import org.apache.hadoop.hdfs.MiniDFSCluster;
-import org.apache.hadoop.mapred.MiniMRCluster;
-
-public class MiniCluster extends MiniGenericCluster {
-    private MiniMRCluster m_mr = null;
-    public MiniCluster() {
-        super();
-    }
-
-    @Override
-    protected void setupMiniDfsAndMrClusters() {
-        try {
-            System.setProperty("hadoop.log.dir", "build/test/logs");
-            final int dataNodes = 4;     // There will be 4 data nodes
-            final int taskTrackers = 4;  // There will be 4 task tracker nodes
-
-            // Create the configuration hadoop-site.xml file
-            File conf_dir = new File("build/classes/");
-            conf_dir.mkdirs();
-            File conf_file = new File(conf_dir, "hadoop-site.xml");
-
-            conf_file.delete();
-
-            // Builds and starts the mini dfs and mapreduce clusters
-            Configuration config = new Configuration();
-            if (FBUtilities.isWindows())
-                config.set("fs.file.impl", WindowsLocalFileSystem.class.getName());
-            m_dfs = new MiniDFSCluster(config, dataNodes, true, null);
-            m_fileSys = m_dfs.getFileSystem();
-            m_mr = new MiniMRCluster(taskTrackers, m_fileSys.getUri().toString(), 1);
-
-            // Write the necessary config info to hadoop-site.xml
-            m_conf = m_mr.createJobConf();
-            m_conf.setInt("mapred.submit.replication", 2);
-            m_conf.set("dfs.datanode.address", "0.0.0.0:0");
-            m_conf.set("dfs.datanode.http.address", "0.0.0.0:0");
-            m_conf.set("mapred.map.max.attempts", "2");
-            m_conf.set("mapred.reduce.max.attempts", "2");
-            m_conf.set("pig.jobcontrol.sleep", "100");
-            try (OutputStream os = new FileOutputStream(conf_file))
-            {
-                m_conf.writeXml(os);
-            }
-
-            // Set the system properties needed by Pig
-            System.setProperty("cluster", m_conf.get("mapred.job.tracker"));
-            System.setProperty("namenode", m_conf.get("fs.default.name"));
-            System.setProperty("junit.hadoop.conf", conf_dir.getPath());
-        } catch (IOException e) {
-            throw new RuntimeException(e);
-        }
-    }
-
-    @Override
-    protected void shutdownMiniMrClusters() {
-        if (m_mr != null)
-            m_mr.shutdown();
-        m_mr = null;
-    }
-}

http://git-wip-us.apache.org/repos/asf/cassandra/blob/56cfc6ea/test/pig/org/apache/pig/test/MiniGenericCluster.java
----------------------------------------------------------------------
diff --git a/test/pig/org/apache/pig/test/MiniGenericCluster.java b/test/pig/org/apache/pig/test/MiniGenericCluster.java
deleted file mode 100644
index ac3f5bc..0000000
--- a/test/pig/org/apache/pig/test/MiniGenericCluster.java
+++ /dev/null
@@ -1,122 +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.pig.test;
-
-import java.io.*;
-import java.util.Properties;
-
-import org.apache.hadoop.hdfs.MiniDFSCluster;
-
-import org.apache.hadoop.conf.Configuration;
-import org.apache.hadoop.fs.FileSystem;
-import org.apache.pig.backend.hadoop.datastorage.ConfigurationUtil;
-
-/**
- * This class builds a single instance of itself with the Singleton 
- * design pattern. While building the single instance, it sets up a 
- * mini cluster that actually consists of a mini DFS cluster and a 
- * mini MapReduce cluster on the local machine and also sets up the 
- * environment for Pig to run on top of the mini cluster.
- *
- * This class is the base class for MiniCluster, which has slightly
- * difference among different versions of hadoop. MiniCluster implementation
- * is located in $PIG_HOME/shims.
- */
-abstract public class MiniGenericCluster {
-    protected MiniDFSCluster m_dfs = null;
-    protected FileSystem m_fileSys = null;
-    protected Configuration m_conf = null;
-    
-    protected final static MiniCluster INSTANCE = new MiniCluster();
-    protected static boolean isSetup = true;
-    
-    protected MiniGenericCluster() {
-        setupMiniDfsAndMrClusters();
-    }
-    
-    abstract protected void setupMiniDfsAndMrClusters();
-    
-    /**
-     * Returns the single instance of class MiniClusterBuilder that
-     * represents the resouces for a mini dfs cluster and a mini 
-     * mapreduce cluster. 
-     */
-    public static MiniCluster buildCluster() {
-        if(! isSetup){
-            INSTANCE.setupMiniDfsAndMrClusters();
-            isSetup = true;
-        }
-        return INSTANCE;
-    }
-
-    public void shutDown(){
-        INSTANCE.shutdownMiniDfsAndMrClusters();
-    }
-    
-    protected void finalize() {
-        shutdownMiniDfsAndMrClusters();
-    }
-    
-    protected void shutdownMiniDfsAndMrClusters() {
-        isSetup = false;
-        shutdownMiniDfsClusters();
-        shutdownMiniMrClusters();
-    }
-    
-    protected void shutdownMiniDfsClusters() {
-        try {
-            if (m_fileSys != null) { m_fileSys.close(); }
-        } catch (IOException e) {
-            e.printStackTrace();
-        }
-        if (m_dfs != null) { m_dfs.shutdown(); }
-        m_fileSys = null;
-        m_dfs = null;
-    }
-    
-    abstract protected void shutdownMiniMrClusters();
-
-    public Properties getProperties() {
-        errorIfNotSetup();
-        return ConfigurationUtil.toProperties(m_conf);
-    }
-
-    public Configuration getConfiguration() {
-        return new Configuration(m_conf);
-    }
-
-    public void setProperty(String name, String value) {
-        errorIfNotSetup();
-        m_conf.set(name, value);
-    }
-    
-    public FileSystem getFileSystem() {
-        errorIfNotSetup();
-        return m_fileSys;
-    }
-    
-    /**
-     * Throw RunTimeException if isSetup is false
-     */
-    private void errorIfNotSetup(){
-        if(isSetup)
-            return;
-        String msg = "function called on MiniCluster that has been shutdown";
-        throw new RuntimeException(msg);
-    }
-}

http://git-wip-us.apache.org/repos/asf/cassandra/blob/56cfc6ea/test/pig/org/apache/pig/test/WindowsLocalFileSystem.java
----------------------------------------------------------------------
diff --git a/test/pig/org/apache/pig/test/WindowsLocalFileSystem.java b/test/pig/org/apache/pig/test/WindowsLocalFileSystem.java
deleted file mode 100644
index 9193341..0000000
--- a/test/pig/org/apache/pig/test/WindowsLocalFileSystem.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.pig.test;
-
-import java.io.IOException;
-
-import org.apache.hadoop.fs.LocalFileSystem;
-import org.apache.hadoop.fs.Path;
-import org.apache.hadoop.fs.permission.FsPermission;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-/**
- * Workaround for https://issues.apache.org/jira/browse/HADOOP-7682 used to allow the Pig-tests to run on Cygwin on
- * a Windows box. This workaround was suggested by Joshua Caplan in the comments of HADOOP-7682.
- */
-public final class WindowsLocalFileSystem extends LocalFileSystem
-{
-    private final Logger logger = LoggerFactory.getLogger(getClass());
-
-    public WindowsLocalFileSystem()
-    {
-        logger.warn("Using {} instead of org.apache.hadoop.fs.LocalFileSystem to avoid the problem linked to HADOOP-7682. " +
-                    "IOException thrown when setting permissions will be swallowed.", getClass().getName());
-    }
-
-    @Override
-    public boolean mkdirs(Path path, FsPermission permission) throws IOException
-    {
-        boolean result = super.mkdirs(path);
-        setPermission(path, permission);
-        return result;
-    }
-
-    @Override
-    public void setPermission(Path p, FsPermission permission) throws IOException
-    {
-        try
-        {
-            super.setPermission(p, permission);
-        }
-        catch (IOException e)
-        {
-            // Just swallow the Exception as logging it produces too much output.
-        }
-    }
-}


Mime
View raw message