MCPcopy Create free account
hub / github.com/apache/pig / setUp

Method setUp

test/org/apache/pig/test/TestLargeFile.java:59–90  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

57 String fileName, tmpFile1;
58
59 @Before
60 public void setUp() throws Exception{
61
62 System.out.println("Generating test data...");
63 System.out.println("Default block size = " + defaultBlockSize);
64 System.out.println("Total no. of iterations to run for the test data = " + total);
65
66 datFile = File.createTempFile("StoreTest", ".dat");
67
68 FileOutputStream dat = new FileOutputStream(datFile);
69
70 Random rand = new Random();
71
72 for(int i = 0; i < max_rand; i++) {
73 COUNT[i] = 0;
74 }
75
76 for(long i = 0; i < total; i++) {
77 Integer x = new Integer(rand.nextInt(max_rand));
78 COUNT[x.intValue()]++;
79 dat.write((x.toString() + "\n").getBytes());
80 }
81
82 dat.close();
83
84 pig = new PigServer(ExecType.MAPREDUCE, cluster.getProperties());
85
86 fileName = "'" + FileLocalizer.hadoopify(datFile.toString(), pig.getPigContext()) + "'";
87 tmpFile1 = "'" + FileLocalizer.getTemporaryPath(pig.getPigContext()).toString() + "'";
88
89 datFile.delete();
90 }
91
92 @After
93 public void tearDown() throws Exception {

Callers

nothing calls this directly

Calls 11

hadoopifyMethod · 0.95
getTemporaryPathMethod · 0.95
getBytesMethod · 0.65
closeMethod · 0.65
deleteMethod · 0.65
createTempFileMethod · 0.45
nextIntMethod · 0.45
writeMethod · 0.45
toStringMethod · 0.45
getPropertiesMethod · 0.45
getPigContextMethod · 0.45

Tested by

no test coverage detected