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

Method testPigServer

test/org/apache/pig/test/TestMapReduce.java:489–506  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

487
488
489 @Test
490 public void testPigServer() throws Throwable {
491 log.debug("creating pig server");
492 PigContext pigContext = new PigContext(cluster.getExecType(), cluster.getProperties());
493 PigServer pig = new PigServer(pigContext);
494 System.out.println("testing capacity");
495 long capacity = pig.capacity();
496 assertTrue(capacity > 0);
497 String sampleFileName = "/tmp/fileTest";
498 if (!pig.existsFile(sampleFileName)) {
499 ElementDescriptor path = pigContext.getDfs().asElement(sampleFileName);
500 OutputStream os = path.create();
501 os.write("Ben was here!".getBytes());
502 os.close();
503 }
504 long length = pig.fileSize(sampleFileName);
505 assertTrue(length > 0);
506 }
507
508 /***
509 * For generating a sample dataset as

Callers

nothing calls this directly

Calls 12

capacityMethod · 0.95
existsFileMethod · 0.95
getDfsMethod · 0.95
createMethod · 0.95
fileSizeMethod · 0.95
debugMethod · 0.80
asElementMethod · 0.65
getBytesMethod · 0.65
closeMethod · 0.65
getExecTypeMethod · 0.45
getPropertiesMethod · 0.45
writeMethod · 0.45

Tested by

no test coverage detected