Skip to content

Commit

Permalink
PIG-5264: Remove deprecated keys from PigConfiguration (nkollar via r…
Browse files Browse the repository at this point in the history
…ohini)

git-svn-id: https://svn.apache.org/repos/asf/pig/trunk@1803010 13f79535-47bb-0310-9956-ffa450edef68
  • Loading branch information
r0hini committed Jul 25, 2017
1 parent 0effe5a commit cdd48d8
Show file tree
Hide file tree
Showing 18 changed files with 44 additions and 268 deletions.
2 changes: 2 additions & 0 deletions CHANGES.txt
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ INCOMPATIBLE CHANGES

IMPROVEMENTS

PIG-5264: Remove deprecated keys from PigConfiguration (nkollar via rohini)

PIG-5157: Upgrade to Spark 2.0 (nkollar via liyunzhang)

PIG-5237: Fix DOT file parsing to enable DOT-based physical plan testing (YaShock via szita)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,20 +28,22 @@
import org.apache.pig.PigServer;
import org.apache.pig.backend.hadoop.datastorage.ConfigurationUtil;
import org.apache.pig.data.Tuple;
import org.apache.pig.test.MiniCluster;
import org.apache.pig.test.MiniGenericCluster;
import org.apache.pig.test.Util;
import org.junit.Before;
import org.junit.Test;

import junit.framework.TestCase;
import static org.junit.Assert.assertTrue;

public class TestLookupInFiles extends TestCase {
MiniCluster cluster = MiniCluster.buildCluster();
public class TestLookupInFiles {
MiniGenericCluster cluster = MiniGenericCluster.buildCluster();
private PigServer pigServer;

@Override
@Before
public void setUp() throws Exception{
pigServer = new PigServer(ExecType.MAPREDUCE, cluster.getProperties());
}

@Test
public void testLookupInFiles() throws Exception {
File tmpFile = File.createTempFile("test", ".txt");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
import org.apache.pig.backend.hadoop.executionengine.mapReduceLayer.MRConfiguration;
import org.apache.pig.data.DataByteArray;
import org.apache.pig.data.Tuple;
import org.apache.pig.test.MiniCluster;
import org.apache.pig.test.MiniGenericCluster;
import org.apache.pig.test.Util;
import org.junit.Assert;
import org.junit.Test;
Expand All @@ -40,10 +40,10 @@ public class TestCSVStorage {
protected static final Log LOG = LogFactory.getLog(TestCSVStorage.class);

private PigServer pigServer;
private MiniCluster cluster;
private MiniGenericCluster cluster;

public TestCSVStorage() throws ExecException, IOException {
cluster = MiniCluster.buildCluster();
cluster = MiniGenericCluster.buildCluster();
pigServer = new PigServer(ExecType.LOCAL, new Properties());
pigServer.getPigContext().getProperties()
.setProperty(MRConfiguration.MAP_MAX_ATTEMPTS, "1");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,25 +30,28 @@
import java.sql.SQLException;
import java.sql.Statement;
import java.sql.Date;
import java.util.List;

import org.apache.pig.ExecType;
import org.apache.pig.PigServer;
import org.apache.pig.backend.executionengine.ExecException;
import org.apache.pig.backend.executionengine.ExecJob;
import org.apache.pig.backend.hadoop.executionengine.mapReduceLayer.MRConfiguration;
import org.apache.pig.test.MiniCluster;
import org.apache.pig.test.MiniGenericCluster;
import org.apache.pig.test.Util;
import org.hsqldb.Server;
import org.junit.After;
import org.junit.Before;

import junit.framework.TestCase;
import org.junit.Test;

public class TestDBStorage extends TestCase {
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotSame;
import static org.junit.Assert.assertTrue;

public class TestDBStorage {

private PigServer pigServer;
private MiniCluster cluster;
private MiniGenericCluster cluster;
private Server dbServer;
private String driver = "org.hsqldb.jdbcDriver";
// private String url = "jdbc:hsqldb:mem:.";
Expand All @@ -63,7 +66,7 @@ public class TestDBStorage extends TestCase {

public TestDBStorage() throws ExecException, IOException {
// Initialise Pig server
cluster = MiniCluster.buildCluster();
cluster = MiniGenericCluster.buildCluster();
pigServer = new PigServer(ExecType.MAPREDUCE, cluster.getProperties());
pigServer.getPigContext().getProperties()
.setProperty(MRConfiguration.MAP_MAX_ATTEMPTS, "1");
Expand Down Expand Up @@ -155,6 +158,7 @@ public boolean accept(File dir, String name) {
}
}

@Test
public void testWriteToDB() throws IOException {
String insertQuery = "insert into ttt (id, name, ratio, dt) values (?,?,?,?)";
pigServer.setBatchOn();
Expand Down
72 changes: 0 additions & 72 deletions src/org/apache/pig/PigConfiguration.java
Original file line number Diff line number Diff line change
Expand Up @@ -504,21 +504,11 @@ private PigConfiguration() {}
*/
public static final String PIG_SPARK_USE_NETTY_FILESERVER = "pig.spark.rpc.useNettyFileServer";

/**
* @deprecated use {@link #PIG_LOG_TRACE_ID} instead. Will be removed in Pig 0.18
*/
public static final String CALLER_ID = PIG_LOG_TRACE_ID;

/**
* Enable ATS for Pig
*/
public static final String PIG_ATS_ENABLED = "pig.ats.enabled";

/**
* @deprecated use {@link #PIG_ATS_ENABLED} instead. Will be removed in Pig 0.18
*/
public static final String ENABLE_ATS = PIG_ATS_ENABLED;

/**
* If set, Pig will override tez.am.launch.cmd-opts and tez.am.resource.memory.mb to optimal
*/
Expand All @@ -533,66 +523,4 @@ private PigConfiguration() {}

public static final String PIG_PRINT_EXEC_PLAN = "pig.print.exec.plan";

// Deprecated settings of Pig 0.13

/**
* @deprecated use {@link #PIG_OPT_FETCH} instead. Will be removed in Pig 0.16
*/
@Deprecated
public static final String OPT_FETCH = PIG_OPT_FETCH;

/**
* @deprecated use {@link #PIG_CACHEDBAG_MEMUSAGE} instead. Will be removed in Pig 0.16
*/
@Deprecated
public static final String PROP_CACHEDBAG_MEMUSAGE = PIG_CACHEDBAG_MEMUSAGE;

/**
* @deprecated use {@link #PIG_EXEC_MAP_PARTAGG} instead. Will be removed in Pig 0.16
*/
@Deprecated
public static final String PROP_EXEC_MAP_PARTAGG = PIG_EXEC_MAP_PARTAGG;

/**
* @deprecated use {@link #PIG_EXEC_MAP_PARTAGG_MINREDUCTION} instead. Will be removed in Pig 0.16
*/
@Deprecated
public static final String PARTAGG_MINREDUCTION = PIG_EXEC_MAP_PARTAGG_MINREDUCTION;

/**
* @deprecated use {@link #PROP_NO_COMBINER1} instead. Will be removed in Pig 0.16
*/
@Deprecated
public static final String PROP_NO_COMBINER = PIG_EXEC_NO_COMBINER;

@Deprecated
public static final String SHOULD_USE_SCHEMA_TUPLE = PIG_SCHEMA_TUPLE_ENABLED;

@Deprecated
public static final String SCHEMA_TUPLE_SHOULD_USE_IN_UDF = PIG_SCHEMA_TUPLE_USE_IN_UDF;

@Deprecated
public static final String SCHEMA_TUPLE_SHOULD_USE_IN_FOREACH = PIG_SCHEMA_TUPLE_USE_IN_FOREACH;

@Deprecated
public static final String SCHEMA_TUPLE_SHOULD_USE_IN_FRJOIN = PIG_SCHEMA_TUPLE_USE_IN_FRJOIN;

@Deprecated
public static final String SCHEMA_TUPLE_SHOULD_USE_IN_MERGEJOIN = PIG_SCHEMA_TUPLE_USE_IN_MERGEJOIN;

@Deprecated
public static final String SCHEMA_TUPLE_SHOULD_ALLOW_FORCE = PIG_SCHEMA_TUPLE_ALLOW_FORCE;

/**
* @deprecated use {@link #PIG_SCRIPT_INFO_ENABLED} instead. Will be removed in Pig 0.16
*/
@Deprecated
public static final String INSERT_ENABLED = PIG_SCRIPT_INFO_ENABLED;

/**
* @deprecated use {@link #PIG_SCRIPT_MAX_SIZE} instead. Will be removed in Pig 0.16
*/
@Deprecated
public static final String MAX_SCRIPT_SIZE = PIG_SCRIPT_MAX_SIZE;

}
11 changes: 0 additions & 11 deletions src/org/apache/pig/ResourceStatistics.java
Original file line number Diff line number Diff line change
Expand Up @@ -197,17 +197,6 @@ public Long getmBytes() {
return this.bytes / 1024 / 1024;
}

/**
*
* @param mBytes
* @deprecated Use {@link ResourceStatistics#setSizeInBytes(Long)} instead
*/
@Deprecated
public ResourceStatistics setmBytes(Long mBytes) {
this.bytes = mBytes * 1024 * 1024;
return this;
}

/**
* Sets the size in bytes
*
Expand Down
79 changes: 0 additions & 79 deletions src/org/apache/pig/builtin/RoundRobinPartitioner.java

This file was deleted.

49 changes: 0 additions & 49 deletions src/org/apache/pig/impl/util/WrappedIOException.java

This file was deleted.

15 changes: 0 additions & 15 deletions src/org/apache/pig/tools/pigstats/PigStatsUtil.java
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
import java.util.regex.Pattern;

import org.apache.pig.backend.hadoop.executionengine.physicalLayer.relationalOperators.POStore;
import org.apache.pig.tools.pigstats.mapreduce.MRPigStatsUtil;
import org.apache.pig.tools.pigstats.mapreduce.SimplePigStats;

/**
Expand Down Expand Up @@ -59,20 +58,6 @@ public class PigStatsUtil {
public static final String MULTI_STORE_COUNTER_GROUP
= "MultiStoreCounters";

/**
* @deprecated use {@link org.apache.pig.tools.pigstats.mapreduce.MRPigStatsUtil#TASK_COUNTER_GROUP} instead.
*/
@Deprecated
public static final String TASK_COUNTER_GROUP
= "org.apache.hadoop.mapred.Task$Counter";

/**
* @deprecated use {@link org.apache.pig.tools.pigstats.mapreduce.MRPigStatsUtil#FS_COUNTER_GROUP} instead.
*/
@Deprecated
public static final String FS_COUNTER_GROUP
= MRPigStatsUtil.FS_COUNTER_GROUP;

/**
* Returns an empty PigStats object Use of this method is not advised as it
* will return the MR execution engine version of PigStats by default, and
Expand Down
9 changes: 0 additions & 9 deletions test/org/apache/pig/test/MiniCluster.java
Original file line number Diff line number Diff line change
Expand Up @@ -48,15 +48,6 @@ public class MiniCluster extends MiniGenericCluster {
private Configuration m_dfs_conf = null;
private Configuration m_mr_conf = null;

/**
* @deprecated use {@link org.apache.pig.test.MiniGenericCluster.buildCluster() instead.
*/
@Deprecated
public static MiniCluster buildCluster() {
System.setProperty("test.exec.type", "mr");
return (MiniCluster)MiniGenericCluster.buildCluster("mr");
}

@Override
public ExecType getExecType() {
return ExecType.MAPREDUCE;
Expand Down

0 comments on commit cdd48d8

Please sign in to comment.