code stringlengths 23 201k | docstring stringlengths 17 96.2k | func_name stringlengths 0 235 | language stringclasses 1
value | repo stringlengths 8 72 | path stringlengths 11 317 | url stringlengths 57 377 | license stringclasses 7
values |
|---|---|---|---|---|---|---|---|
@Override
public String getName() {
return VIEWER_NAME;
} | This class implements a viewer for ORC files
@author gaggarwa | getName | java | azkaban/azkaban | az-hdfs-viewer/src/main/java/azkaban/viewer/hdfs/ORCFileViewer.java | https://github.com/azkaban/azkaban/blob/master/az-hdfs-viewer/src/main/java/azkaban/viewer/hdfs/ORCFileViewer.java | Apache-2.0 |
@Override
public String getName() {
return VIEWER_NAME;
} | This class implements a viewer for Parquet files.
@author David Z. Chen (dchen@linkedin.com) | getName | java | azkaban/azkaban | az-hdfs-viewer/src/main/java/azkaban/viewer/hdfs/ParquetFileViewer.java | https://github.com/azkaban/azkaban/blob/master/az-hdfs-viewer/src/main/java/azkaban/viewer/hdfs/ParquetFileViewer.java | Apache-2.0 |
@Override
public Set<Capability> getCapabilities(FileSystem fs, Path path) {
if (logger.isDebugEnabled()) {
logger.debug("Parquet file path: " + path.toUri().getPath());
}
AvroParquetReader<GenericRecord> parquetReader = null;
try {
parquetReader = new AvroParquetReader<>(path);
} cat... | This class implements a viewer for Parquet files.
@author David Z. Chen (dchen@linkedin.com) | getCapabilities | java | azkaban/azkaban | az-hdfs-viewer/src/main/java/azkaban/viewer/hdfs/ParquetFileViewer.java | https://github.com/azkaban/azkaban/blob/master/az-hdfs-viewer/src/main/java/azkaban/viewer/hdfs/ParquetFileViewer.java | Apache-2.0 |
@Override
public void displayFile(FileSystem fs, Path path, OutputStream outputStream,
int startLine, int endLine) throws IOException {
if (logger.isDebugEnabled()) {
logger.debug("Display Parquet file: " + path.toUri().getPath());
}
AvroParquetReader<GenericRecord> parquetReader = null;
... | This class implements a viewer for Parquet files.
@author David Z. Chen (dchen@linkedin.com) | displayFile | java | azkaban/azkaban | az-hdfs-viewer/src/main/java/azkaban/viewer/hdfs/ParquetFileViewer.java | https://github.com/azkaban/azkaban/blob/master/az-hdfs-viewer/src/main/java/azkaban/viewer/hdfs/ParquetFileViewer.java | Apache-2.0 |
@Override
public String getSchema(FileSystem fs, Path path) {
String schema = null;
try {
AvroParquetReader<GenericRecord> parquetReader =
new AvroParquetReader<>(path);
GenericRecord record = parquetReader.read();
if (record == null) {
return null;
}
Schema avr... | This class implements a viewer for Parquet files.
@author David Z. Chen (dchen@linkedin.com) | getSchema | java | azkaban/azkaban | az-hdfs-viewer/src/main/java/azkaban/viewer/hdfs/ParquetFileViewer.java | https://github.com/azkaban/azkaban/blob/master/az-hdfs-viewer/src/main/java/azkaban/viewer/hdfs/ParquetFileViewer.java | Apache-2.0 |
@Before
public void setUp() throws IOException {
this.fs = new LocalFileSystem();
this.fs.initialize(this.fs.getWorkingDirectory().toUri(), new Configuration());
this.viewer = new HtmlFileViewer();
} | <pre>
Test cases for HtmlFileViewer
Validate accepted capabilities for the viewer and ensures that it
generates the correct content and content type.
</pre> | setUp | java | azkaban/azkaban | az-hdfs-viewer/src/test/java/azkaban/viewer/hdfs/HtmlFileViewerTest.java | https://github.com/azkaban/azkaban/blob/master/az-hdfs-viewer/src/test/java/azkaban/viewer/hdfs/HtmlFileViewerTest.java | Apache-2.0 |
@After
public void tearDown() throws IOException {
this.fs.close();
} | <pre>
Test cases for HtmlFileViewer
Validate accepted capabilities for the viewer and ensures that it
generates the correct content and content type.
</pre> | tearDown | java | azkaban/azkaban | az-hdfs-viewer/src/test/java/azkaban/viewer/hdfs/HtmlFileViewerTest.java | https://github.com/azkaban/azkaban/blob/master/az-hdfs-viewer/src/test/java/azkaban/viewer/hdfs/HtmlFileViewerTest.java | Apache-2.0 |
@Test
public void testCapabilities() throws AccessControlException {
Set<Capability> capabilities = this.viewer
.getCapabilities(this.fs, getResourcePath(EMPTY_HTM));
// READ should be the the one and only capability
assertTrue(capabilities.contains(Capability.READ));
ass... | <pre>
Test cases for HtmlFileViewer
Validate accepted capabilities for the viewer and ensures that it
generates the correct content and content type.
</pre> | testCapabilities | java | azkaban/azkaban | az-hdfs-viewer/src/test/java/azkaban/viewer/hdfs/HtmlFileViewerTest.java | https://github.com/azkaban/azkaban/blob/master/az-hdfs-viewer/src/test/java/azkaban/viewer/hdfs/HtmlFileViewerTest.java | Apache-2.0 |
@Test
public void testContentType() {
assertEquals(ContentType.HTML, this.viewer.getContentType());
} | <pre>
Test cases for HtmlFileViewer
Validate accepted capabilities for the viewer and ensures that it
generates the correct content and content type.
</pre> | testContentType | java | azkaban/azkaban | az-hdfs-viewer/src/test/java/azkaban/viewer/hdfs/HtmlFileViewerTest.java | https://github.com/azkaban/azkaban/blob/master/az-hdfs-viewer/src/test/java/azkaban/viewer/hdfs/HtmlFileViewerTest.java | Apache-2.0 |
@Test
public void testEmptyFile() throws IOException {
final ByteArrayOutputStream outStream = new ByteArrayOutputStream();
this.viewer.displayFile(this.fs, getResourcePath(EMPTY_HTM), outStream, 1, 2);
final String output = outStream.toString();
assertTrue(output.isEmpty());
} | <pre>
Test cases for HtmlFileViewer
Validate accepted capabilities for the viewer and ensures that it
generates the correct content and content type.
</pre> | testEmptyFile | java | azkaban/azkaban | az-hdfs-viewer/src/test/java/azkaban/viewer/hdfs/HtmlFileViewerTest.java | https://github.com/azkaban/azkaban/blob/master/az-hdfs-viewer/src/test/java/azkaban/viewer/hdfs/HtmlFileViewerTest.java | Apache-2.0 |
@Test
@SuppressWarnings("DefaultCharset")
public void testValidHtmlFile() throws IOException {
final ByteArrayOutputStream outStream = new ByteArrayOutputStream();
this.viewer.displayFile(this.fs, getResourcePath(VALID_HTML), outStream, 1, 2);
final String output = new String(outStream.t... | <pre>
Test cases for HtmlFileViewer
Validate accepted capabilities for the viewer and ensures that it
generates the correct content and content type.
</pre> | testValidHtmlFile | java | azkaban/azkaban | az-hdfs-viewer/src/test/java/azkaban/viewer/hdfs/HtmlFileViewerTest.java | https://github.com/azkaban/azkaban/blob/master/az-hdfs-viewer/src/test/java/azkaban/viewer/hdfs/HtmlFileViewerTest.java | Apache-2.0 |
private Path getResourcePath(final String filename) {
final String HDFS_VIEWER_ROOT_PATH = "../test/hdfs-viewer-sample-files/";
return new Path(HDFS_VIEWER_ROOT_PATH + filename);
} | <pre>
Test cases for HtmlFileViewer
Validate accepted capabilities for the viewer and ensures that it
generates the correct content and content type.
</pre> | getResourcePath | java | azkaban/azkaban | az-hdfs-viewer/src/test/java/azkaban/viewer/hdfs/HtmlFileViewerTest.java | https://github.com/azkaban/azkaban/blob/master/az-hdfs-viewer/src/test/java/azkaban/viewer/hdfs/HtmlFileViewerTest.java | Apache-2.0 |
@Before
public void setUp() throws IOException {
this.fs = new LocalFileSystem();
this.fs.initialize(this.fs.getWorkingDirectory().toUri(), new Configuration());
this.viewer = new ORCFileViewer();
this.supportedCapabilities = EnumSet.of(Capability.READ, Capability.SCHEMA);
th... | <pre>
Test cases for ORCFileViewer
Validate capability for ORC files Validate false capability for avro, text
and parquet schema for ORC files verify raw records from orc files
</pre> | setUp | java | azkaban/azkaban | az-hdfs-viewer/src/test/java/azkaban/viewer/hdfs/ORCFileViewerTest.java | https://github.com/azkaban/azkaban/blob/master/az-hdfs-viewer/src/test/java/azkaban/viewer/hdfs/ORCFileViewerTest.java | Apache-2.0 |
@After
public void tearDown() throws IOException {
this.fs.close();
} | <pre>
Test cases for ORCFileViewer
Validate capability for ORC files Validate false capability for avro, text
and parquet schema for ORC files verify raw records from orc files
</pre> | tearDown | java | azkaban/azkaban | az-hdfs-viewer/src/test/java/azkaban/viewer/hdfs/ORCFileViewerTest.java | https://github.com/azkaban/azkaban/blob/master/az-hdfs-viewer/src/test/java/azkaban/viewer/hdfs/ORCFileViewerTest.java | Apache-2.0 |
@SuppressWarnings("DefaultCharset")
/* Calls ORCFileViewer#displayFile and parse results */
String displayRecordWrapper(final String filename, final int startRecord, final int endRecord)
throws IOException {
final ByteArrayOutputStream outStream = new ByteArrayOutputStream();
this.vi... | <pre>
Test cases for ORCFileViewer
Validate capability for ORC files Validate false capability for avro, text
and parquet schema for ORC files verify raw records from orc files
</pre> | displayRecordWrapper | java | azkaban/azkaban | az-hdfs-viewer/src/test/java/azkaban/viewer/hdfs/ORCFileViewerTest.java | https://github.com/azkaban/azkaban/blob/master/az-hdfs-viewer/src/test/java/azkaban/viewer/hdfs/ORCFileViewerTest.java | Apache-2.0 |
Path getResourcePath(final String filename) {
final String HDFS_VIEWER_ROOT_PATH = "../test/hdfs-viewer-sample-files/";
return new Path(HDFS_VIEWER_ROOT_PATH + filename);
} | <pre>
Test cases for ORCFileViewer
Validate capability for ORC files Validate false capability for avro, text
and parquet schema for ORC files verify raw records from orc files
</pre> | getResourcePath | java | azkaban/azkaban | az-hdfs-viewer/src/test/java/azkaban/viewer/hdfs/ORCFileViewerTest.java | https://github.com/azkaban/azkaban/blob/master/az-hdfs-viewer/src/test/java/azkaban/viewer/hdfs/ORCFileViewerTest.java | Apache-2.0 |
@Test
public void orcEmptyFileCapability() throws IOException {
assertEquals(this.supportedCapabilities, this.viewer.getCapabilities(this.fs,
getResourcePath("TestOrcFile.emptyFile.orc")));
} | <pre>
Test cases for ORCFileViewer
Validate capability for ORC files Validate false capability for avro, text
and parquet schema for ORC files verify raw records from orc files
</pre> | orcEmptyFileCapability | java | azkaban/azkaban | az-hdfs-viewer/src/test/java/azkaban/viewer/hdfs/ORCFileViewerTest.java | https://github.com/azkaban/azkaban/blob/master/az-hdfs-viewer/src/test/java/azkaban/viewer/hdfs/ORCFileViewerTest.java | Apache-2.0 |
@Test
public void genericORCFileCapability() throws IOException {
assertEquals(this.supportedCapabilities, this.viewer.getCapabilities(this.fs,
getResourcePath("TestOrcFile.testPredicatePushdown.orc")));
} | <pre>
Test cases for ORCFileViewer
Validate capability for ORC files Validate false capability for avro, text
and parquet schema for ORC files verify raw records from orc files
</pre> | genericORCFileCapability | java | azkaban/azkaban | az-hdfs-viewer/src/test/java/azkaban/viewer/hdfs/ORCFileViewerTest.java | https://github.com/azkaban/azkaban/blob/master/az-hdfs-viewer/src/test/java/azkaban/viewer/hdfs/ORCFileViewerTest.java | Apache-2.0 |
@Test
public void binaryTypeORCFileCapability() throws IOException {
assertEquals(this.supportedCapabilities, this.viewer.getCapabilities(this.fs,
getResourcePath("TestOrcFile.testStringAndBinaryStatistics.orc")));
} | <pre>
Test cases for ORCFileViewer
Validate capability for ORC files Validate false capability for avro, text
and parquet schema for ORC files verify raw records from orc files
</pre> | binaryTypeORCFileCapability | java | azkaban/azkaban | az-hdfs-viewer/src/test/java/azkaban/viewer/hdfs/ORCFileViewerTest.java | https://github.com/azkaban/azkaban/blob/master/az-hdfs-viewer/src/test/java/azkaban/viewer/hdfs/ORCFileViewerTest.java | Apache-2.0 |
@Test
public void snappyCompressedORCFileCapability() throws IOException {
assertEquals(this.supportedCapabilities, this.viewer.getCapabilities(this.fs,
getResourcePath("TestOrcFile.testSnappy.orc")));
} | <pre>
Test cases for ORCFileViewer
Validate capability for ORC files Validate false capability for avro, text
and parquet schema for ORC files verify raw records from orc files
</pre> | snappyCompressedORCFileCapability | java | azkaban/azkaban | az-hdfs-viewer/src/test/java/azkaban/viewer/hdfs/ORCFileViewerTest.java | https://github.com/azkaban/azkaban/blob/master/az-hdfs-viewer/src/test/java/azkaban/viewer/hdfs/ORCFileViewerTest.java | Apache-2.0 |
@Test
public void unionTypeORCFileCapability() throws IOException {
assertEquals(this.supportedCapabilities, this.viewer.getCapabilities(this.fs,
getResourcePath("TestOrcFile.testUnionAndTimestamp.orc")));
} | <pre>
Test cases for ORCFileViewer
Validate capability for ORC files Validate false capability for avro, text
and parquet schema for ORC files verify raw records from orc files
</pre> | unionTypeORCFileCapability | java | azkaban/azkaban | az-hdfs-viewer/src/test/java/azkaban/viewer/hdfs/ORCFileViewerTest.java | https://github.com/azkaban/azkaban/blob/master/az-hdfs-viewer/src/test/java/azkaban/viewer/hdfs/ORCFileViewerTest.java | Apache-2.0 |
@Test
public void noAvroCapability() throws IOException {
assertEquals(this.unSupportedCapabilities,
this.viewer.getCapabilities(this.fs, getResourcePath("TestAvro.avro")));
} | <pre>
Test cases for ORCFileViewer
Validate capability for ORC files Validate false capability for avro, text
and parquet schema for ORC files verify raw records from orc files
</pre> | noAvroCapability | java | azkaban/azkaban | az-hdfs-viewer/src/test/java/azkaban/viewer/hdfs/ORCFileViewerTest.java | https://github.com/azkaban/azkaban/blob/master/az-hdfs-viewer/src/test/java/azkaban/viewer/hdfs/ORCFileViewerTest.java | Apache-2.0 |
@Test
public void noTextCapability() throws IOException {
assertEquals(this.unSupportedCapabilities,
this.viewer.getCapabilities(this.fs, getResourcePath("TestTextFile.txt")));
} | <pre>
Test cases for ORCFileViewer
Validate capability for ORC files Validate false capability for avro, text
and parquet schema for ORC files verify raw records from orc files
</pre> | noTextCapability | java | azkaban/azkaban | az-hdfs-viewer/src/test/java/azkaban/viewer/hdfs/ORCFileViewerTest.java | https://github.com/azkaban/azkaban/blob/master/az-hdfs-viewer/src/test/java/azkaban/viewer/hdfs/ORCFileViewerTest.java | Apache-2.0 |
@Test
public void noParquetCapability() throws IOException {
assertEquals(this.unSupportedCapabilities, this.viewer.getCapabilities(this.fs,
getResourcePath("TestParquetFile.parquet")));
} | <pre>
Test cases for ORCFileViewer
Validate capability for ORC files Validate false capability for avro, text
and parquet schema for ORC files verify raw records from orc files
</pre> | noParquetCapability | java | azkaban/azkaban | az-hdfs-viewer/src/test/java/azkaban/viewer/hdfs/ORCFileViewerTest.java | https://github.com/azkaban/azkaban/blob/master/az-hdfs-viewer/src/test/java/azkaban/viewer/hdfs/ORCFileViewerTest.java | Apache-2.0 |
@Test
public void emptyORCFileSchema() throws IOException {
final String schema =
"struct<boolean1:boolean,byte1:tinyint,short1:smallint,int1:int,long1:bigint,"
+ "float1:float,double1:double,bytes1:binary,string1:string,"
+ "middle:struct<list:array<struct<int1:i... | <pre>
Test cases for ORCFileViewer
Validate capability for ORC files Validate false capability for avro, text
and parquet schema for ORC files verify raw records from orc files
</pre> | emptyORCFileSchema | java | azkaban/azkaban | az-hdfs-viewer/src/test/java/azkaban/viewer/hdfs/ORCFileViewerTest.java | https://github.com/azkaban/azkaban/blob/master/az-hdfs-viewer/src/test/java/azkaban/viewer/hdfs/ORCFileViewerTest.java | Apache-2.0 |
@Test
public void genericORCFileSchema() throws IOException {
assertEquals("struct<int1:int,string1:string>", this.viewer.getSchema(this.fs,
getResourcePath("TestOrcFile.testPredicatePushdown.orc")));
} | <pre>
Test cases for ORCFileViewer
Validate capability for ORC files Validate false capability for avro, text
and parquet schema for ORC files verify raw records from orc files
</pre> | genericORCFileSchema | java | azkaban/azkaban | az-hdfs-viewer/src/test/java/azkaban/viewer/hdfs/ORCFileViewerTest.java | https://github.com/azkaban/azkaban/blob/master/az-hdfs-viewer/src/test/java/azkaban/viewer/hdfs/ORCFileViewerTest.java | Apache-2.0 |
@Test
public void binaryTypeFileSchema() throws IOException {
assertEquals("struct<bytes1:binary,string1:string>", this.viewer.getSchema(
this.fs,
getResourcePath("TestOrcFile.testStringAndBinaryStatistics.orc")));
} | <pre>
Test cases for ORCFileViewer
Validate capability for ORC files Validate false capability for avro, text
and parquet schema for ORC files verify raw records from orc files
</pre> | binaryTypeFileSchema | java | azkaban/azkaban | az-hdfs-viewer/src/test/java/azkaban/viewer/hdfs/ORCFileViewerTest.java | https://github.com/azkaban/azkaban/blob/master/az-hdfs-viewer/src/test/java/azkaban/viewer/hdfs/ORCFileViewerTest.java | Apache-2.0 |
@Test
public void snappyCompressedFileSchema() throws IOException {
assertEquals("struct<int1:int,string1:string>",
this.viewer.getSchema(this.fs, getResourcePath("TestOrcFile.testSnappy.orc")));
} | <pre>
Test cases for ORCFileViewer
Validate capability for ORC files Validate false capability for avro, text
and parquet schema for ORC files verify raw records from orc files
</pre> | snappyCompressedFileSchema | java | azkaban/azkaban | az-hdfs-viewer/src/test/java/azkaban/viewer/hdfs/ORCFileViewerTest.java | https://github.com/azkaban/azkaban/blob/master/az-hdfs-viewer/src/test/java/azkaban/viewer/hdfs/ORCFileViewerTest.java | Apache-2.0 |
@Test
public void unionTypeFileSchema() throws IOException {
assertEquals(
"struct<time:timestamp,union:uniontype<int,string>,decimal:decimal>",
this.viewer.getSchema(this.fs,
getResourcePath("TestOrcFile.testUnionAndTimestamp.orc")));
} | <pre>
Test cases for ORCFileViewer
Validate capability for ORC files Validate false capability for avro, text
and parquet schema for ORC files verify raw records from orc files
</pre> | unionTypeFileSchema | java | azkaban/azkaban | az-hdfs-viewer/src/test/java/azkaban/viewer/hdfs/ORCFileViewerTest.java | https://github.com/azkaban/azkaban/blob/master/az-hdfs-viewer/src/test/java/azkaban/viewer/hdfs/ORCFileViewerTest.java | Apache-2.0 |
@Test
public void emptyORCFileDisplay() throws IOException {
final String actual = displayRecordWrapper("TestOrcFile.emptyFile.orc", 1, 1);
assertEquals("", actual);
} | <pre>
Test cases for ORCFileViewer
Validate capability for ORC files Validate false capability for avro, text
and parquet schema for ORC files verify raw records from orc files
</pre> | emptyORCFileDisplay | java | azkaban/azkaban | az-hdfs-viewer/src/test/java/azkaban/viewer/hdfs/ORCFileViewerTest.java | https://github.com/azkaban/azkaban/blob/master/az-hdfs-viewer/src/test/java/azkaban/viewer/hdfs/ORCFileViewerTest.java | Apache-2.0 |
@Test
public void genericORCFileDisplay() throws IOException {
final String actual =
displayRecordWrapper("TestOrcFile.testPredicatePushdown.orc", 2, 2);
assertEquals("{\"int1\":300,\"string1\":\"a\"}", actual);
} | <pre>
Test cases for ORCFileViewer
Validate capability for ORC files Validate false capability for avro, text
and parquet schema for ORC files verify raw records from orc files
</pre> | genericORCFileDisplay | java | azkaban/azkaban | az-hdfs-viewer/src/test/java/azkaban/viewer/hdfs/ORCFileViewerTest.java | https://github.com/azkaban/azkaban/blob/master/az-hdfs-viewer/src/test/java/azkaban/viewer/hdfs/ORCFileViewerTest.java | Apache-2.0 |
@Test
public void binaryTypeFileDisplay() throws IOException {
final String actual =
displayRecordWrapper(
"TestOrcFile.testStringAndBinaryStatistics.orc", 4, 4);
assertEquals("{\"bytes1\":null,\"string1\":\"hi\"}", actual);
} | <pre>
Test cases for ORCFileViewer
Validate capability for ORC files Validate false capability for avro, text
and parquet schema for ORC files verify raw records from orc files
</pre> | binaryTypeFileDisplay | java | azkaban/azkaban | az-hdfs-viewer/src/test/java/azkaban/viewer/hdfs/ORCFileViewerTest.java | https://github.com/azkaban/azkaban/blob/master/az-hdfs-viewer/src/test/java/azkaban/viewer/hdfs/ORCFileViewerTest.java | Apache-2.0 |
@Test
public void snappyCompressedFileDisplay() throws IOException {
final String actual =
displayRecordWrapper("TestOrcFile.testSnappy.orc", 2, 2);
assertEquals("{\"int1\":1181413113,\"string1\":\"382fdaaa\"}", actual);
} | <pre>
Test cases for ORCFileViewer
Validate capability for ORC files Validate false capability for avro, text
and parquet schema for ORC files verify raw records from orc files
</pre> | snappyCompressedFileDisplay | java | azkaban/azkaban | az-hdfs-viewer/src/test/java/azkaban/viewer/hdfs/ORCFileViewerTest.java | https://github.com/azkaban/azkaban/blob/master/az-hdfs-viewer/src/test/java/azkaban/viewer/hdfs/ORCFileViewerTest.java | Apache-2.0 |
@Test
public void unionTypeFileDisplay() throws IOException {
final String actual =
displayRecordWrapper("TestOrcFile.testUnionAndTimestamp.orc", 5, 5);
assertEquals("{\"decimal\":null,\"time\":null,\"union\":{\"1\":null}}",
actual);
} | <pre>
Test cases for ORCFileViewer
Validate capability for ORC files Validate false capability for avro, text
and parquet schema for ORC files verify raw records from orc files
</pre> | unionTypeFileDisplay | java | azkaban/azkaban | az-hdfs-viewer/src/test/java/azkaban/viewer/hdfs/ORCFileViewerTest.java | https://github.com/azkaban/azkaban/blob/master/az-hdfs-viewer/src/test/java/azkaban/viewer/hdfs/ORCFileViewerTest.java | Apache-2.0 |
static String expandHiveAuxJarsPath(final String original) throws IOException {
if (original == null || original.endsWith(".jar")) {
return original;
}
final File[] files = new File(original).listFiles();
if (files == null || files.length == 0) {
return original;
}
return filesToU... | Normally hive.aux.jars.path is expanded from just being a path to the full
list of files in the directory by the hive shell script. Since we normally
won't be running from the script, it's up to us to do that work here. We
use a heuristic that if there is no occurrence of ".jar" in the original,
it needs expansion. Oth... | expandHiveAuxJarsPath | java | azkaban/azkaban | az-reportal/src/main/java/azkaban/jobtype/ReportalHiveRunner.java | https://github.com/azkaban/azkaban/blob/master/az-reportal/src/main/java/azkaban/jobtype/ReportalHiveRunner.java | Apache-2.0 |
static String filesToURIString(final File[] files) throws IOException {
final StringBuffer sb = new StringBuffer();
for (int i = 0; i < files.length; i++) {
sb.append("file:///").append(files[i].getCanonicalPath());
if (i != files.length - 1) {
sb.append(",");
}
}
return sb.to... | Normally hive.aux.jars.path is expanded from just being a path to the full
list of files in the directory by the hive shell script. Since we normally
won't be running from the script, it's up to us to do that work here. We
use a heuristic that if there is no occurrence of ".jar" in the original,
it needs expansion. Oth... | filesToURIString | java | azkaban/azkaban | az-reportal/src/main/java/azkaban/jobtype/ReportalHiveRunner.java | https://github.com/azkaban/azkaban/blob/master/az-reportal/src/main/java/azkaban/jobtype/ReportalHiveRunner.java | Apache-2.0 |
@Override
protected void runReportal() throws Exception {
System.out.println("Reportal Hive: Setting up Hive");
final HiveConf conf = new HiveConf(SessionState.class);
if (System.getenv(HADOOP_TOKEN_FILE_LOCATION) != null) {
conf.set(MAPREDUCE_JOB_CREDENTIALS_BINARY,
System.getenv(HADOOP_... | Normally hive.aux.jars.path is expanded from just being a path to the full
list of files in the directory by the hive shell script. Since we normally
won't be running from the script, it's up to us to do that work here. We
use a heuristic that if there is no occurrence of ".jar" in the original,
it needs expansion. Oth... | runReportal | java | azkaban/azkaban | az-reportal/src/main/java/azkaban/jobtype/ReportalHiveRunner.java | https://github.com/azkaban/azkaban/blob/master/az-reportal/src/main/java/azkaban/jobtype/ReportalHiveRunner.java | Apache-2.0 |
private String[] buildHiveArgs() {
final List<String> confBuilder = new ArrayList<>();
if (this.proxyUser != null) {
confBuilder.add("hive.exec.scratchdir=/tmp/hive-" + this.proxyUser);
}
if (this.jobTitle != null) {
confBuilder.add("mapred.job.name=\"Reportal: " + this.jobTitle + "\"");
... | Normally hive.aux.jars.path is expanded from just being a path to the full
list of files in the directory by the hive shell script. Since we normally
won't be running from the script, it's up to us to do that work here. We
use a heuristic that if there is no occurrence of ".jar" in the original,
it needs expansion. Oth... | buildHiveArgs | java | azkaban/azkaban | az-reportal/src/main/java/azkaban/jobtype/ReportalHiveRunner.java | https://github.com/azkaban/azkaban/blob/master/az-reportal/src/main/java/azkaban/jobtype/ReportalHiveRunner.java | Apache-2.0 |
private String cleanQueryLine(final String line) {
if (line != null) {
return line.trim();
}
return null;
} | Teradata's SET Query_Band allows use to "proxy" to an LDAP user. This
makes queries appear to admins as though it's being issued by the owner
of the report, rather than the 'Reportal' user. Tables will still be
"owned" by Reportal, but admins will be able to send angry emails to the
proper user when a reportal query is... | cleanQueryLine | java | azkaban/azkaban | az-reportal/src/main/java/azkaban/jobtype/ReportalTeradataRunner.java | https://github.com/azkaban/azkaban/blob/master/az-reportal/src/main/java/azkaban/jobtype/ReportalTeradataRunner.java | Apache-2.0 |
private PreparedStatement prepareStatement(final Connection conn, String line)
throws SQLException {
line = injectVariables(line);
// For some reason, teradata's adapter can't seem to handle this well
// List<String> variableReplacements = new ArrayList<String>();
//
// for (Entry<String, Str... | Teradata's SET Query_Band allows use to "proxy" to an LDAP user. This
makes queries appear to admins as though it's being issued by the owner
of the report, rather than the 'Reportal' user. Tables will still be
"owned" by Reportal, but admins will be able to send angry emails to the
proper user when a reportal query is... | prepareStatement | java | azkaban/azkaban | az-reportal/src/main/java/azkaban/jobtype/ReportalTeradataRunner.java | https://github.com/azkaban/azkaban/blob/master/az-reportal/src/main/java/azkaban/jobtype/ReportalTeradataRunner.java | Apache-2.0 |
public void updatePermissions() {
final String[] accessViewerList =
this.accessViewer.trim().split(ACCESS_LIST_SPLIT_REGEX);
final String[] accessExecutorList =
this.accessExecutor.trim().split(ACCESS_LIST_SPLIT_REGEX);
final String[] accessOwnerList =
this.accessOwner.trim().split(A... | Updates the project permissions in MEMORY, but does NOT update the project
in the database. | updatePermissions | java | azkaban/azkaban | az-reportal/src/main/java/azkaban/reportal/util/Reportal.java | https://github.com/azkaban/azkaban/blob/master/az-reportal/src/main/java/azkaban/reportal/util/Reportal.java | Apache-2.0 |
public void createZipAndUpload(final ProjectManager projectManager, final User user,
final String reportalStorageUser) throws Exception {
// Create temp folder to make the zip file for upload
final File tempDir = Utils.createTempDir();
final File dataDir = new File(tempDir, "data");
dataDir.mkdirs... | Updates the project permissions in MEMORY, but does NOT update the project
in the database. | createZipAndUpload | java | azkaban/azkaban | az-reportal/src/main/java/azkaban/reportal/util/Reportal.java | https://github.com/azkaban/azkaban/blob/master/az-reportal/src/main/java/azkaban/reportal/util/Reportal.java | Apache-2.0 |
public void loadImmutableFromProject(final Project project) {
this.reportalUser = stringGetter.get(project.getMetadata().get("reportal-user"));
this.ownerEmail = stringGetter.get(project.getMetadata().get("owner-email"));
} | Updates the project permissions in MEMORY, but does NOT update the project
in the database. | loadImmutableFromProject | java | azkaban/azkaban | az-reportal/src/main/java/azkaban/reportal/util/Reportal.java | https://github.com/azkaban/azkaban/blob/master/az-reportal/src/main/java/azkaban/reportal/util/Reportal.java | Apache-2.0 |
public Set<String> getAccessViewers() {
final Set<String> viewers = new HashSet<>();
for (final String user : this.accessViewer.trim().split(ACCESS_LIST_SPLIT_REGEX)) {
if (!user.isEmpty()) {
viewers.add(user);
}
}
return viewers;
} | @return A set of users explicitly granted viewer access to the report. | getAccessViewers | java | azkaban/azkaban | az-reportal/src/main/java/azkaban/reportal/util/Reportal.java | https://github.com/azkaban/azkaban/blob/master/az-reportal/src/main/java/azkaban/reportal/util/Reportal.java | Apache-2.0 |
public Set<String> getAccessExecutors() {
final Set<String> executors = new HashSet<>();
for (final String user : this.accessExecutor.trim().split(ACCESS_LIST_SPLIT_REGEX)) {
if (!user.isEmpty()) {
executors.add(user);
}
}
return executors;
} | @return A set of users explicitly granted executor access to the report. | getAccessExecutors | java | azkaban/azkaban | az-reportal/src/main/java/azkaban/reportal/util/Reportal.java | https://github.com/azkaban/azkaban/blob/master/az-reportal/src/main/java/azkaban/reportal/util/Reportal.java | Apache-2.0 |
@SuppressWarnings("unchecked")
public T get(final Object object) {
if (object == null || !(this.cls.isAssignableFrom(object.getClass()))) {
return this.defaultValue;
}
return (T) object;
} | @return A set of users explicitly granted executor access to the report. | get | java | azkaban/azkaban | az-reportal/src/main/java/azkaban/reportal/util/Reportal.java | https://github.com/azkaban/azkaban/blob/master/az-reportal/src/main/java/azkaban/reportal/util/Reportal.java | Apache-2.0 |
public String getTitle() {
return this.title;
} | @return A set of users explicitly granted executor access to the report. | getTitle | java | azkaban/azkaban | az-reportal/src/main/java/azkaban/reportal/util/Reportal.java | https://github.com/azkaban/azkaban/blob/master/az-reportal/src/main/java/azkaban/reportal/util/Reportal.java | Apache-2.0 |
public String getType() {
return this.type;
} | @return A set of users explicitly granted executor access to the report. | getType | java | azkaban/azkaban | az-reportal/src/main/java/azkaban/reportal/util/Reportal.java | https://github.com/azkaban/azkaban/blob/master/az-reportal/src/main/java/azkaban/reportal/util/Reportal.java | Apache-2.0 |
public String getScript() {
return this.script;
} | @return A set of users explicitly granted executor access to the report. | getScript | java | azkaban/azkaban | az-reportal/src/main/java/azkaban/reportal/util/Reportal.java | https://github.com/azkaban/azkaban/blob/master/az-reportal/src/main/java/azkaban/reportal/util/Reportal.java | Apache-2.0 |
public String getTitle() {
return this.title;
} | @return A set of users explicitly granted executor access to the report. | getTitle | java | azkaban/azkaban | az-reportal/src/main/java/azkaban/reportal/util/Reportal.java | https://github.com/azkaban/azkaban/blob/master/az-reportal/src/main/java/azkaban/reportal/util/Reportal.java | Apache-2.0 |
public String getName() {
return this.name;
} | @return A set of users explicitly granted executor access to the report. | getName | java | azkaban/azkaban | az-reportal/src/main/java/azkaban/reportal/util/Reportal.java | https://github.com/azkaban/azkaban/blob/master/az-reportal/src/main/java/azkaban/reportal/util/Reportal.java | Apache-2.0 |
public static void updateProjectNotifications(final Project project,
final ProjectManager pm) throws ProjectManagerException {
final Flow flow = project.getFlows().get(0);
// Get all success emails.
final ArrayList<String> successEmails = new ArrayList<>();
final String successNotifications =
... | Updates the email notifications saved in the project's flow. | updateProjectNotifications | java | azkaban/azkaban | az-reportal/src/main/java/azkaban/reportal/util/ReportalHelper.java | https://github.com/azkaban/azkaban/blob/master/az-reportal/src/main/java/azkaban/reportal/util/ReportalHelper.java | Apache-2.0 |
public static boolean isScheduledProject(final Project project) {
final Object schedule = project.getMetadata().get("schedule");
if (schedule == null || !(schedule instanceof Boolean)) {
return false;
}
return (boolean) (Boolean) schedule;
} | Updates the email notifications saved in the project's flow. | isScheduledProject | java | azkaban/azkaban | az-reportal/src/main/java/azkaban/reportal/util/ReportalHelper.java | https://github.com/azkaban/azkaban/blob/master/az-reportal/src/main/java/azkaban/reportal/util/ReportalHelper.java | Apache-2.0 |
public static boolean isScheduledRepeatingProject(final Project project) {
final Object schedule = project.getMetadata().get("scheduleRepeat");
if (schedule == null || !(schedule instanceof Boolean)) {
return false;
}
return (boolean) (Boolean) schedule;
} | Updates the email notifications saved in the project's flow. | isScheduledRepeatingProject | java | azkaban/azkaban | az-reportal/src/main/java/azkaban/reportal/util/ReportalHelper.java | https://github.com/azkaban/azkaban/blob/master/az-reportal/src/main/java/azkaban/reportal/util/ReportalHelper.java | Apache-2.0 |
public static List<Project> getUserReportalProjects(final AzkabanWebServer server,
final String userName) throws ProjectManagerException {
final ProjectManager projectManager = server.getProjectManager();
final List<Project> projects = projectManager.getProjects();
final List<Project> result = new Arr... | Updates the email notifications saved in the project's flow. | getUserReportalProjects | java | azkaban/azkaban | az-reportal/src/main/java/azkaban/reportal/util/ReportalHelper.java | https://github.com/azkaban/azkaban/blob/master/az-reportal/src/main/java/azkaban/reportal/util/ReportalHelper.java | Apache-2.0 |
public static Project createReportalProject(final AzkabanWebServer server,
final String title, final String description, final User user)
throws ProjectManagerException {
final ProjectManager projectManager = server.getProjectManager();
final String projectName =
"reportal-" + user.getUserId... | Updates the email notifications saved in the project's flow. | createReportalProject | java | azkaban/azkaban | az-reportal/src/main/java/azkaban/reportal/util/ReportalHelper.java | https://github.com/azkaban/azkaban/blob/master/az-reportal/src/main/java/azkaban/reportal/util/ReportalHelper.java | Apache-2.0 |
public static String sanitizeText(final String text) {
return text.replaceAll("[^A-Za-z0-9]", "-");
} | Updates the email notifications saved in the project's flow. | sanitizeText | java | azkaban/azkaban | az-reportal/src/main/java/azkaban/reportal/util/ReportalHelper.java | https://github.com/azkaban/azkaban/blob/master/az-reportal/src/main/java/azkaban/reportal/util/ReportalHelper.java | Apache-2.0 |
public static File findAvailableFileName(final File parent, String name,
final String extension) {
if (name.isEmpty()) {
name = "untitled";
}
File file = new File(parent, name + extension);
int i = 1;
while (file.exists()) {
file = new File(parent, name + "-" + i + extension);
... | Updates the email notifications saved in the project's flow. | findAvailableFileName | java | azkaban/azkaban | az-reportal/src/main/java/azkaban/reportal/util/ReportalHelper.java | https://github.com/azkaban/azkaban/blob/master/az-reportal/src/main/java/azkaban/reportal/util/ReportalHelper.java | Apache-2.0 |
public static String prepareStringForJS(final Object object) {
return object.toString().replace("\r", "").replace("\n", "\\n");
} | Updates the email notifications saved in the project's flow. | prepareStringForJS | java | azkaban/azkaban | az-reportal/src/main/java/azkaban/reportal/util/ReportalHelper.java | https://github.com/azkaban/azkaban/blob/master/az-reportal/src/main/java/azkaban/reportal/util/ReportalHelper.java | Apache-2.0 |
public static String[] filterCSVFile(final String[] files) {
final List<String> result = new ArrayList<>();
for (int i = 0; i < files.length; i++) {
if (StringUtils.endsWithIgnoreCase(files[i], ".csv")) {
result.add(files[i]);
}
}
return result.toArray(new String[result.size()]);
} | Updates the email notifications saved in the project's flow. | filterCSVFile | java | azkaban/azkaban | az-reportal/src/main/java/azkaban/reportal/util/ReportalHelper.java | https://github.com/azkaban/azkaban/blob/master/az-reportal/src/main/java/azkaban/reportal/util/ReportalHelper.java | Apache-2.0 |
public static Set<String> parseUniqueEmails(final String emailList,
final String splitRegex) {
final Set<String> uniqueEmails = new HashSet<>();
if (emailList == null) {
return uniqueEmails;
}
final String[] emails = emailList.trim().split(splitRegex);
for (final String email : emails)... | Given a string containing multiple emails, splits it based on the given
regular expression, and returns a set containing the unique, non-empty
emails. | parseUniqueEmails | java | azkaban/azkaban | az-reportal/src/main/java/azkaban/reportal/util/ReportalHelper.java | https://github.com/azkaban/azkaban/blob/master/az-reportal/src/main/java/azkaban/reportal/util/ReportalHelper.java | Apache-2.0 |
public static boolean isValidEmailAddress(final String email) {
if (email == null) {
return false;
}
boolean result = true;
try {
final InternetAddress emailAddr = new InternetAddress(email);
emailAddr.validate();
} catch (final AddressException ex) {
result = false;
}
... | Returns true if the given email is valid and false otherwise. | isValidEmailAddress | java | azkaban/azkaban | az-reportal/src/main/java/azkaban/reportal/util/ReportalHelper.java | https://github.com/azkaban/azkaban/blob/master/az-reportal/src/main/java/azkaban/reportal/util/ReportalHelper.java | Apache-2.0 |
public static String getEmailDomain(final String email) {
if (email == null || email.isEmpty()) {
return null;
}
final int atSignIndex = email.indexOf('@');
if (atSignIndex != -1) {
return email.substring(atSignIndex + 1);
}
return null;
} | Given an email string, returns the domain part if it exists, and null
otherwise. | getEmailDomain | java | azkaban/azkaban | az-reportal/src/main/java/azkaban/reportal/util/ReportalHelper.java | https://github.com/azkaban/azkaban/blob/master/az-reportal/src/main/java/azkaban/reportal/util/ReportalHelper.java | Apache-2.0 |
public static List<ExecutableNode> sortExecutableNodes(final ExecutableFlow flow) {
final List<ExecutableNode> sortedNodes = new ArrayList<>();
if (flow != null) {
final List<String> startNodeIds = flow.getStartNodes();
String nextNodeId = startNodeIds.isEmpty() ? null : startNodeIds.get(0);
... | Returns a list of the executable nodes in the specified flow in execution
order. Assumes that the flow is linear. | sortExecutableNodes | java | azkaban/azkaban | az-reportal/src/main/java/azkaban/reportal/util/ReportalUtil.java | https://github.com/azkaban/azkaban/blob/master/az-reportal/src/main/java/azkaban/reportal/util/ReportalUtil.java | Apache-2.0 |
public static List<Variable> getRunTimeVariables(
final Collection<Variable> variables) {
final List<Variable> runtimeVariables =
ReportalUtil.getVariablesByRegex(variables,
Reportal.REPORTAL_CONFIG_PREFIX_NEGATION_REGEX);
return runtimeVariables;
} | Get runtime variables to be set in unscheduled mode of execution.
Returns empty list, if no runtime variable is found | getRunTimeVariables | java | azkaban/azkaban | az-reportal/src/main/java/azkaban/reportal/util/ReportalUtil.java | https://github.com/azkaban/azkaban/blob/master/az-reportal/src/main/java/azkaban/reportal/util/ReportalUtil.java | Apache-2.0 |
public static List<Variable> getVariablesByRegex(
final Collection<Variable> variables, final String regex) {
final List<Variable> shortlistedVariables = new ArrayList<>();
if (variables != null && regex != null) {
for (final Variable var : variables) {
if (var.getTitle().matches(regex)) {
... | Shortlist variables which match a given regex. Returns empty empty list, if no
eligible variable is found | getVariablesByRegex | java | azkaban/azkaban | az-reportal/src/main/java/azkaban/reportal/util/ReportalUtil.java | https://github.com/azkaban/azkaban/blob/master/az-reportal/src/main/java/azkaban/reportal/util/ReportalUtil.java | Apache-2.0 |
public static Map<String, String> getVariableMapByPrefix(
final Collection<Variable> variables, final String prefix) {
final Map<String, String> shortlistMap = new HashMap<>();
if (variables != null && prefix != null) {
for (final Variable var : getVariablesByRegex(variables,
Reportal.REPO... | Shortlist variables which match a given prefix. Returns empty map, if no
eligible variable is found.
@param variables variables to be processed
@param prefix prefix to be matched
@return a map with shortlisted variables and prefix removed | getVariableMapByPrefix | java | azkaban/azkaban | az-reportal/src/main/java/azkaban/reportal/util/ReportalUtil.java | https://github.com/azkaban/azkaban/blob/master/az-reportal/src/main/java/azkaban/reportal/util/ReportalUtil.java | Apache-2.0 |
private static String formatValue(final String value) {
return "\"" + value.replace("\"", "") + "\"";
} | Shortlist variables which match a given prefix. Returns empty map, if no
eligible variable is found.
@param variables variables to be processed
@param prefix prefix to be matched
@return a map with shortlisted variables and prefix removed | formatValue | java | azkaban/azkaban | az-reportal/src/main/java/azkaban/reportal/util/ReportalUtil.java | https://github.com/azkaban/azkaban/blob/master/az-reportal/src/main/java/azkaban/reportal/util/ReportalUtil.java | Apache-2.0 |
public static void outputQueryResult(final ResultSet result, final OutputStream outputStream)
throws SQLException {
final PrintStream outFile = new PrintStream(outputStream);
final String delim = ",";
boolean isHeaderPending = true;
if (result != null) {
while (result.next()) {
final... | Shortlist variables which match a given prefix. Returns empty map, if no
eligible variable is found.
@param variables variables to be processed
@param prefix prefix to be matched
@return a map with shortlisted variables and prefix removed | outputQueryResult | java | azkaban/azkaban | az-reportal/src/main/java/azkaban/reportal/util/ReportalUtil.java | https://github.com/azkaban/azkaban/blob/master/az-reportal/src/main/java/azkaban/reportal/util/ReportalUtil.java | Apache-2.0 |
private FileStatus[] getFileStatusList(final String pathString)
throws HadoopSecurityManagerException, IOException {
ensureHdfs();
final Path path = new Path(pathString);
FileStatus pathStatus = null;
try {
pathStatus = this.hdfs.getFileStatus(path);
} catch (final IOException e) {
... | Returns an array of the file statuses of the files/directories in the given
path if it is a directory and an empty array otherwise. | getFileStatusList | java | azkaban/azkaban | az-reportal/src/main/java/azkaban/reportal/util/StreamProviderHDFS.java | https://github.com/azkaban/azkaban/blob/master/az-reportal/src/main/java/azkaban/reportal/util/StreamProviderHDFS.java | Apache-2.0 |
public void countDownByOneMinute() throws InterruptedException {
this.duration = this.duration.minusMinutes(1);
} | Countdown is a class used by Tableau Job to
keep track of time as the Tableau extractions are
being refreshed. | countDownByOneMinute | java | azkaban/azkaban | az-reportal/src/main/java/azkaban/reportal/util/tableau/Countdown.java | https://github.com/azkaban/azkaban/blob/master/az-reportal/src/main/java/azkaban/reportal/util/tableau/Countdown.java | Apache-2.0 |
public boolean moreTimeRemaining() {
return this.duration.toMillis() > 0;
} | Countdown is a class used by Tableau Job to
keep track of time as the Tableau extractions are
being refreshed. | moreTimeRemaining | java | azkaban/azkaban | az-reportal/src/main/java/azkaban/reportal/util/tableau/Countdown.java | https://github.com/azkaban/azkaban/blob/master/az-reportal/src/main/java/azkaban/reportal/util/tableau/Countdown.java | Apache-2.0 |
public String getMessage() {
return this.message;
} | Result enum stores resulting information from
the Tableau refresh | getMessage | java | azkaban/azkaban | az-reportal/src/main/java/azkaban/reportal/util/tableau/Result.java | https://github.com/azkaban/azkaban/blob/master/az-reportal/src/main/java/azkaban/reportal/util/tableau/Result.java | Apache-2.0 |
public void refreshContents() throws IOException {
this._urlContents = IOUtils.toString(this._url.openStream(), "UTF-8");
} | URL Response is a class used by Tableau Job to interact
with the proxy server which interfaces with the Tableau
server. | refreshContents | java | azkaban/azkaban | az-reportal/src/main/java/azkaban/reportal/util/tableau/URLResponse.java | https://github.com/azkaban/azkaban/blob/master/az-reportal/src/main/java/azkaban/reportal/util/tableau/URLResponse.java | Apache-2.0 |
@VisibleForTesting
void setURLContents(final String urlContents) {
this._urlContents = urlContents;
} | URL Response is a class used by Tableau Job to interact
with the proxy server which interfaces with the Tableau
server. | setURLContents | java | azkaban/azkaban | az-reportal/src/main/java/azkaban/reportal/util/tableau/URLResponse.java | https://github.com/azkaban/azkaban/blob/master/az-reportal/src/main/java/azkaban/reportal/util/tableau/URLResponse.java | Apache-2.0 |
public String getContents() {
return (this._urlContents);
} | URL Response is a class used by Tableau Job to interact
with the proxy server which interfaces with the Tableau
server. | getContents | java | azkaban/azkaban | az-reportal/src/main/java/azkaban/reportal/util/tableau/URLResponse.java | https://github.com/azkaban/azkaban/blob/master/az-reportal/src/main/java/azkaban/reportal/util/tableau/URLResponse.java | Apache-2.0 |
private boolean indicates(final String word) {
if (this._urlContents == null) {
return false;
} else {
return this._urlContents.contains(word);
}
} | URL Response is a class used by Tableau Job to interact
with the proxy server which interfaces with the Tableau
server. | indicates | java | azkaban/azkaban | az-reportal/src/main/java/azkaban/reportal/util/tableau/URLResponse.java | https://github.com/azkaban/azkaban/blob/master/az-reportal/src/main/java/azkaban/reportal/util/tableau/URLResponse.java | Apache-2.0 |
public boolean indicatesSuccess() {
return indicates("Success");
} | URL Response is a class used by Tableau Job to interact
with the proxy server which interfaces with the Tableau
server. | indicatesSuccess | java | azkaban/azkaban | az-reportal/src/main/java/azkaban/reportal/util/tableau/URLResponse.java | https://github.com/azkaban/azkaban/blob/master/az-reportal/src/main/java/azkaban/reportal/util/tableau/URLResponse.java | Apache-2.0 |
public boolean indicatesError() {
return indicates("Error");
} | URL Response is a class used by Tableau Job to interact
with the proxy server which interfaces with the Tableau
server. | indicatesError | java | azkaban/azkaban | az-reportal/src/main/java/azkaban/reportal/util/tableau/URLResponse.java | https://github.com/azkaban/azkaban/blob/master/az-reportal/src/main/java/azkaban/reportal/util/tableau/URLResponse.java | Apache-2.0 |
public String getPath() {
return (this.path);
} | URL Response is a class used by Tableau Job to interact
with the proxy server which interfaces with the Tableau
server. | getPath | java | azkaban/azkaban | az-reportal/src/main/java/azkaban/reportal/util/tableau/URLResponse.java | https://github.com/azkaban/azkaban/blob/master/az-reportal/src/main/java/azkaban/reportal/util/tableau/URLResponse.java | Apache-2.0 |
@Override
public void init(final ServletConfig config) throws ServletException {
super.init(config);
this.server = getApplication();
ReportalMailCreator.azkaban = this.server;
this.shouldProxy = this.props.getBoolean("azkaban.should.proxy", false);
logger.info("Hdfs browser should proxy: " + this... | A whitelist of allowed email domains (e.g.: example.com). If null, all
email domains are allowed. | init | java | azkaban/azkaban | az-reportal/src/main/java/azkaban/viewer/reportal/ReportalServlet.java | https://github.com/azkaban/azkaban/blob/master/az-reportal/src/main/java/azkaban/viewer/reportal/ReportalServlet.java | Apache-2.0 |
private HadoopSecurityManager loadHadoopSecurityManager(final Props props,
final Logger logger) throws RuntimeException {
final Class<?> hadoopSecurityManagerClass =
props.getClass(HADOOP_SECURITY_MANAGER_CLASS_PARAM, true,
ReportalServlet.class.getClassLoader());
logger.info("Initial... | A whitelist of allowed email domains (e.g.: example.com). If null, all
email domains are allowed. | loadHadoopSecurityManager | java | azkaban/azkaban | az-reportal/src/main/java/azkaban/viewer/reportal/ReportalServlet.java | https://github.com/azkaban/azkaban/blob/master/az-reportal/src/main/java/azkaban/viewer/reportal/ReportalServlet.java | Apache-2.0 |
@Override
protected void handleGet(final HttpServletRequest req, final HttpServletResponse resp,
final Session session) throws ServletException, IOException {
if (hasParam(req, "ajax")) {
handleAJAXAction(req, resp, session);
} else {
if (hasParam(req, "view")) {
try {
hand... | A whitelist of allowed email domains (e.g.: example.com). If null, all
email domains are allowed. | handleGet | java | azkaban/azkaban | az-reportal/src/main/java/azkaban/viewer/reportal/ReportalServlet.java | https://github.com/azkaban/azkaban/blob/master/az-reportal/src/main/java/azkaban/viewer/reportal/ReportalServlet.java | Apache-2.0 |
private void handleAJAXAction(final HttpServletRequest req,
final HttpServletResponse resp, final Session session) throws ServletException,
IOException {
final HashMap<String, Object> ret = new HashMap<>();
final String ajaxName = getParam(req, "ajax");
final User user = session.getUser();
f... | A whitelist of allowed email domains (e.g.: example.com). If null, all
email domains are allowed. | handleAJAXAction | java | azkaban/azkaban | az-reportal/src/main/java/azkaban/viewer/reportal/ReportalServlet.java | https://github.com/azkaban/azkaban/blob/master/az-reportal/src/main/java/azkaban/viewer/reportal/ReportalServlet.java | Apache-2.0 |
private void handleListReportal(final HttpServletRequest req,
final HttpServletResponse resp, final Session session) throws ServletException,
IOException {
final Page page =
newPage(req, resp, session,
"azkaban/viewer/reportal/reportallistpage.vm");
preparePage(page, session);
... | A whitelist of allowed email domains (e.g.: example.com). If null, all
email domains are allowed. | handleListReportal | java | azkaban/azkaban | az-reportal/src/main/java/azkaban/viewer/reportal/ReportalServlet.java | https://github.com/azkaban/azkaban/blob/master/az-reportal/src/main/java/azkaban/viewer/reportal/ReportalServlet.java | Apache-2.0 |
private void handleViewReportal(final HttpServletRequest req,
final HttpServletResponse resp, final Session session) throws ServletException,
Exception {
final int id = getIntParam(req, "id");
final Page page =
newPage(req, resp, session,
"azkaban/viewer/reportal/reportaldatapage... | A whitelist of allowed email domains (e.g.: example.com). If null, all
email domains are allowed. | handleViewReportal | java | azkaban/azkaban | az-reportal/src/main/java/azkaban/viewer/reportal/ReportalServlet.java | https://github.com/azkaban/azkaban/blob/master/az-reportal/src/main/java/azkaban/viewer/reportal/ReportalServlet.java | Apache-2.0 |
private List<Object> getFilePreviews(final String[] fileList, final String locationFull,
final IStreamProvider streamProvider, final boolean renderResultsAsHtml) {
final List<Object> files = new ArrayList<>();
InputStream csvInputStream = null;
try {
for (final String fileName : fileList) {
... | Returns a list of file Objects that contain a "name" property with the file
name, a "content" property with the lines in the file, and a "hasMore"
property if the file contains more than NUM_PREVIEW_ROWS lines. | getFilePreviews | java | azkaban/azkaban | az-reportal/src/main/java/azkaban/viewer/reportal/ReportalServlet.java | https://github.com/azkaban/azkaban/blob/master/az-reportal/src/main/java/azkaban/viewer/reportal/ReportalServlet.java | Apache-2.0 |
private void handleRunReportal(final HttpServletRequest req,
final HttpServletResponse resp, final Session session) throws ServletException,
IOException {
final int id = getIntParam(req, "id");
final ProjectManager projectManager = this.server.getProjectManager();
final Page page =
newPa... | Returns a list of file Objects that contain a "name" property with the file
name, a "content" property with the lines in the file, and a "hasMore"
property if the file contains more than NUM_PREVIEW_ROWS lines. | handleRunReportal | java | azkaban/azkaban | az-reportal/src/main/java/azkaban/viewer/reportal/ReportalServlet.java | https://github.com/azkaban/azkaban/blob/master/az-reportal/src/main/java/azkaban/viewer/reportal/ReportalServlet.java | Apache-2.0 |
private void handleNewReportal(final HttpServletRequest req,
final HttpServletResponse resp, final Session session) throws ServletException,
IOException {
final Page page =
newPage(req, resp, session,
"azkaban/viewer/reportal/reportaleditpage.vm");
preparePage(page, session);
... | Returns a list of file Objects that contain a "name" property with the file
name, a "content" property with the lines in the file, and a "hasMore"
property if the file contains more than NUM_PREVIEW_ROWS lines. | handleNewReportal | java | azkaban/azkaban | az-reportal/src/main/java/azkaban/viewer/reportal/ReportalServlet.java | https://github.com/azkaban/azkaban/blob/master/az-reportal/src/main/java/azkaban/viewer/reportal/ReportalServlet.java | Apache-2.0 |
private void handleEditReportal(final HttpServletRequest req,
final HttpServletResponse resp, final Session session) throws ServletException,
IOException {
final int id = getIntParam(req, "id");
final ProjectManager projectManager = this.server.getProjectManager();
final Page page =
new... | Returns a list of file Objects that contain a "name" property with the file
name, a "content" property with the lines in the file, and a "hasMore"
property if the file contains more than NUM_PREVIEW_ROWS lines. | handleEditReportal | java | azkaban/azkaban | az-reportal/src/main/java/azkaban/viewer/reportal/ReportalServlet.java | https://github.com/azkaban/azkaban/blob/master/az-reportal/src/main/java/azkaban/viewer/reportal/ReportalServlet.java | Apache-2.0 |
@Override
protected void handlePost(final HttpServletRequest req, final HttpServletResponse resp,
final Session session) throws ServletException, IOException {
if (hasParam(req, "ajax")) {
final HashMap<String, Object> ret = new HashMap<>();
handleRunReportalWithVariables(req, ret, session);
... | Returns a list of file Objects that contain a "name" property with the file
name, a "content" property with the lines in the file, and a "hasMore"
property if the file contains more than NUM_PREVIEW_ROWS lines. | handlePost | java | azkaban/azkaban | az-reportal/src/main/java/azkaban/viewer/reportal/ReportalServlet.java | https://github.com/azkaban/azkaban/blob/master/az-reportal/src/main/java/azkaban/viewer/reportal/ReportalServlet.java | Apache-2.0 |
private void handleSaveReportal(final HttpServletRequest req,
final HttpServletResponse resp, final Session session) throws ServletException,
IOException {
final String projectId = validateAndSaveReport(req, resp, session);
if (projectId != null) {
this.setSuccessMessageInCookie(resp, "Report... | Returns a list of file Objects that contain a "name" property with the file
name, a "content" property with the lines in the file, and a "hasMore"
property if the file contains more than NUM_PREVIEW_ROWS lines. | handleSaveReportal | java | azkaban/azkaban | az-reportal/src/main/java/azkaban/viewer/reportal/ReportalServlet.java | https://github.com/azkaban/azkaban/blob/master/az-reportal/src/main/java/azkaban/viewer/reportal/ReportalServlet.java | Apache-2.0 |
private String validateAndSaveReport(final HttpServletRequest req,
final HttpServletResponse resp, final Session session) throws ServletException,
IOException {
final ProjectManager projectManager = this.server.getProjectManager();
final User user = session.getUser();
final Page page =
... | Validates and saves a report, returning the project id of the saved report
if successful, and null otherwise.
@return The project id of the saved report if successful, and null
otherwise | validateAndSaveReport | java | azkaban/azkaban | az-reportal/src/main/java/azkaban/viewer/reportal/ReportalServlet.java | https://github.com/azkaban/azkaban/blob/master/az-reportal/src/main/java/azkaban/viewer/reportal/ReportalServlet.java | Apache-2.0 |
private void updateProjectPermissions(final Project project,
final ProjectManager projectManager, final Reportal report, final User currentUser)
throws ProjectManagerException {
// Old permissions and users
final List<Pair<String, Permission>> oldPermissions =
project.getUserPermissions();
... | Validates and saves a report, returning the project id of the saved report
if successful, and null otherwise.
@return The project id of the saved report if successful, and null
otherwise | updateProjectPermissions | java | azkaban/azkaban | az-reportal/src/main/java/azkaban/viewer/reportal/ReportalServlet.java | https://github.com/azkaban/azkaban/blob/master/az-reportal/src/main/java/azkaban/viewer/reportal/ReportalServlet.java | Apache-2.0 |
private void handleRunReportalWithVariables(final HttpServletRequest req,
final HashMap<String, Object> ret, final Session session) throws ServletException,
IOException {
final boolean isTestRun = hasParam(req, "testRun");
final int id = getIntParam(req, "id");
final ProjectManager projectManag... | Validates and saves a report, returning the project id of the saved report
if successful, and null otherwise.
@return The project id of the saved report if successful, and null
otherwise | handleRunReportalWithVariables | java | azkaban/azkaban | az-reportal/src/main/java/azkaban/viewer/reportal/ReportalServlet.java | https://github.com/azkaban/azkaban/blob/master/az-reportal/src/main/java/azkaban/viewer/reportal/ReportalServlet.java | Apache-2.0 |
private void preparePage(final Page page, final Session session) {
page.add("viewerName", this.viewerName);
page.add("hideNavigation", !this.showNav);
page.add("userid", session.getUser().getUserId());
page.add("esc", new EscapeTool());
} | Validates and saves a report, returning the project id of the saved report
if successful, and null otherwise.
@return The project id of the saved report if successful, and null
otherwise | preparePage | java | azkaban/azkaban | az-reportal/src/main/java/azkaban/viewer/reportal/ReportalServlet.java | https://github.com/azkaban/azkaban/blob/master/az-reportal/src/main/java/azkaban/viewer/reportal/ReportalServlet.java | Apache-2.0 |
@SuppressWarnings("unused")
public void shutdown() {
this.shutdown = true;
this.interrupt();
} | Validates and saves a report, returning the project id of the saved report
if successful, and null otherwise.
@return The project id of the saved report if successful, and null
otherwise | shutdown | java | azkaban/azkaban | az-reportal/src/main/java/azkaban/viewer/reportal/ReportalServlet.java | https://github.com/azkaban/azkaban/blob/master/az-reportal/src/main/java/azkaban/viewer/reportal/ReportalServlet.java | Apache-2.0 |
@Override
public void run() {
while (!this.shutdown) {
synchronized (this) {
ReportalServlet.logger.info("Cleaning old execution output dirs");
cleanOldReportalOutputDirs();
ReportalServlet.logger.info("Cleaning Reportal mail temp directory");
cleanReportalMail... | Validates and saves a report, returning the project id of the saved report
if successful, and null otherwise.
@return The project id of the saved report if successful, and null
otherwise | run | java | azkaban/azkaban | az-reportal/src/main/java/azkaban/viewer/reportal/ReportalServlet.java | https://github.com/azkaban/azkaban/blob/master/az-reportal/src/main/java/azkaban/viewer/reportal/ReportalServlet.java | Apache-2.0 |
private void cleanOldReportalOutputDirs() {
final IStreamProvider streamProvider =
ReportalUtil.getStreamProvider(ReportalMailCreator.outputFileSystem);
if (streamProvider instanceof StreamProviderHDFS) {
final StreamProviderHDFS hdfsStreamProvider =
(StreamProviderHDFS) strea... | Validates and saves a report, returning the project id of the saved report
if successful, and null otherwise.
@return The project id of the saved report if successful, and null
otherwise | cleanOldReportalOutputDirs | java | azkaban/azkaban | az-reportal/src/main/java/azkaban/viewer/reportal/ReportalServlet.java | https://github.com/azkaban/azkaban/blob/master/az-reportal/src/main/java/azkaban/viewer/reportal/ReportalServlet.java | Apache-2.0 |
private void cleanReportalMailTempDir() {
final File dir = ReportalServlet.this.reportalMailTempDirectory;
final long pastTimeThreshold =
System.currentTimeMillis() - this.MAIL_TEMP_DIR_RETENTION_MS;
final File[] oldMailTempDirs = dir.listFiles(new FileFilter() {
@Override
p... | Validates and saves a report, returning the project id of the saved report
if successful, and null otherwise.
@return The project id of the saved report if successful, and null
otherwise | cleanReportalMailTempDir | java | azkaban/azkaban | az-reportal/src/main/java/azkaban/viewer/reportal/ReportalServlet.java | https://github.com/azkaban/azkaban/blob/master/az-reportal/src/main/java/azkaban/viewer/reportal/ReportalServlet.java | Apache-2.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.