id
int64
0
1.29M
original_id
stringlengths
32
32
swhid
stringlengths
100
170
sha1
stringlengths
40
40
repo_name
stringlengths
2
45
repo_group
stringclasses
12 values
filepath
stringlengths
5
153
name
stringlengths
1
14.9k
type
stringclasses
3 values
code
stringlengths
7
2.12M
2,400
84e90205e5709a4e774eef395acaaf66
swh:1:cnt:48a2e25be1ce1e50e083e12cedf1219dbe7b58e9;origin=https://gitlab.wikimedia.org/repos/data-engineering/gobblin-wmf-deprecated.git;lines=60-76/
4c4c61812f396c53f9db8501e35270ce8bd47102
gobblin-wmf-deprecated
analytics
gobblin-wmf-core/src/main/java/org/wikimedia/gobblin/writer/SimpleStringWriter.java
SimpleStringWriter::write(String rec)
function
/** * Write a source record to the staging file. * * @param rec data record to write * @throws java.io.IOException if there is anything wrong writing the record */ @Override public void write(String rec) throws IOException { Preconditions.checkNotNull(rec); byte[] toWri...
2,401
48bcf71ded10dff460be4807114dce7f
swh:1:cnt:48a2e25be1ce1e50e083e12cedf1219dbe7b58e9;origin=https://gitlab.wikimedia.org/repos/data-engineering/gobblin-wmf-deprecated.git;lines=103-109/
4c4c61812f396c53f9db8501e35270ce8bd47102
gobblin-wmf-deprecated
analytics
gobblin-wmf-core/src/main/java/org/wikimedia/gobblin/writer/SimpleStringWriter.java
SimpleStringWriter::flush()
function
/** * Flush the staging file. */ @Override public void flush() throws IOException { this.stagingFileOutputStream.flush(); }
2,402
558b7c90249a8a7359e581ab56f26704
swh:1:cnt:e5c03974ca295625e6ba6721dd4e4def41da91a1;origin=https://gitlab.wikimedia.org/repos/data-engineering/gobblin-wmf-deprecated.git;lines=39-88/
d50b19520ff8978cf258f8a42a701bb397031c43
gobblin-wmf-deprecated
analytics
gobblin-wmf-core/src/main/java/org/wikimedia/gobblin/writer/SimpleStringWriterBuilder.java
SimpleStringWriterBuilder
type
/** * A {@link DataWriterBuilder} for building {@link DataWriter} that writes String. * * @author akshay@nerdwallet.com */ public class SimpleStringWriterBuilder extends FsDataWriterBuilder<String, Object> { /** * Build a {@link org.apache.gobblin.writer.DataWriter}. * * @return the built {@link ...
2,403
ee3a08b064197375fbfaeb79a1c84e01
swh:1:cnt:e5c03974ca295625e6ba6721dd4e4def41da91a1;origin=https://gitlab.wikimedia.org/repos/data-engineering/gobblin-wmf-deprecated.git;lines=45-61/
d50b19520ff8978cf258f8a42a701bb397031c43
gobblin-wmf-deprecated
analytics
gobblin-wmf-core/src/main/java/org/wikimedia/gobblin/writer/SimpleStringWriterBuilder.java
SimpleStringWriterBuilder::build()
function
/** * Build a {@link org.apache.gobblin.writer.DataWriter}. * * @return the built {@link org.apache.gobblin.writer.DataWriter} * @throws java.io.IOException if there is anything wrong building the writer */ @Override public DataWriter<Object> build() throws IOException { State s...
2,404
83980ea16f6466714c05e43edb05dd02
swh:1:cnt:e5c03974ca295625e6ba6721dd4e4def41da91a1;origin=https://gitlab.wikimedia.org/repos/data-engineering/gobblin-wmf-deprecated.git;lines=63-87/
d50b19520ff8978cf258f8a42a701bb397031c43
gobblin-wmf-deprecated
analytics
gobblin-wmf-core/src/main/java/org/wikimedia/gobblin/writer/SimpleStringWriterBuilder.java
SimpleStringWriterBuilder::buildEncoders()
function
@Override protected List<StreamCodec> buildEncoders() { Preconditions.checkNotNull(this.destination, "Destination must be set before building encoders"); List<StreamCodec> encoders = new ArrayList<>(); // TODO: refactor this when capability support comes back in // Compress first ...
2,405
ace073a85c65228ebd90b9c40e17ddf5
swh:1:cnt:2dc86c87ffa3fd85d635035f1df1fecd7428c7a7;origin=https://gitlab.wikimedia.org/repos/data-engineering/gobblin-wmf-deprecated.git;lines=27-85/
e0e05e9a6eeb4f967080a17e642c3b027f2d7743
gobblin-wmf-deprecated
analytics
gobblin-wmf-core/src/main/java/org/wikimedia/gobblin/writer/TimestampedRecordWriterWrapper.java
TimestampedRecordWriterWrapper
type
/** * Copied and updated from SimpleDataWriter. */ public class TimestampedRecordWriterWrapper<P> implements DataWriter<TimestampedRecord<P>> { protected final DataWriter<P> wrappedWriter; /** * Initialize a new metadata wrapper. * @param wrappedWriter Writer to wrap */ public Timestamped...
2,406
630cd9bf6a821f80c5d44399a762a67b
swh:1:cnt:2dc86c87ffa3fd85d635035f1df1fecd7428c7a7;origin=https://gitlab.wikimedia.org/repos/data-engineering/gobblin-wmf-deprecated.git;lines=47-50/
e0e05e9a6eeb4f967080a17e642c3b027f2d7743
gobblin-wmf-deprecated
analytics
gobblin-wmf-core/src/main/java/org/wikimedia/gobblin/writer/TimestampedRecordWriterWrapper.java
TimestampedRecordWriterWrapper::commit()
function
@Override public void commit() throws IOException { wrappedWriter.commit(); }
2,407
26a199d42a056aad167d1beb2e493660
swh:1:cnt:2dc86c87ffa3fd85d635035f1df1fecd7428c7a7;origin=https://gitlab.wikimedia.org/repos/data-engineering/gobblin-wmf-deprecated.git;lines=57-60/
e0e05e9a6eeb4f967080a17e642c3b027f2d7743
gobblin-wmf-deprecated
analytics
gobblin-wmf-core/src/main/java/org/wikimedia/gobblin/writer/TimestampedRecordWriterWrapper.java
TimestampedRecordWriterWrapper::recordsWritten()
function
@Override public long recordsWritten() { return wrappedWriter.recordsWritten(); }
2,408
4364474dc87963147ced098ddd1a6c17
swh:1:cnt:2dc86c87ffa3fd85d635035f1df1fecd7428c7a7;origin=https://gitlab.wikimedia.org/repos/data-engineering/gobblin-wmf-deprecated.git;lines=67-70/
e0e05e9a6eeb4f967080a17e642c3b027f2d7743
gobblin-wmf-deprecated
analytics
gobblin-wmf-core/src/main/java/org/wikimedia/gobblin/writer/TimestampedRecordWriterWrapper.java
TimestampedRecordWriterWrapper::close()
function
@Override public void close() throws IOException { wrappedWriter.close(); }
2,409
e3bf25eb5674b4fc4bce31e54976fbb4
swh:1:cnt:2dc86c87ffa3fd85d635035f1df1fecd7428c7a7;origin=https://gitlab.wikimedia.org/repos/data-engineering/gobblin-wmf-deprecated.git;lines=42-45/
e0e05e9a6eeb4f967080a17e642c3b027f2d7743
gobblin-wmf-deprecated
analytics
gobblin-wmf-core/src/main/java/org/wikimedia/gobblin/writer/TimestampedRecordWriterWrapper.java
TimestampedRecordWriterWrapper::write(TimestampedRecord<P> untypedRecord)
function
@Override public void write(TimestampedRecord<P> untypedRecord) throws IOException { wrappedWriter.write((untypedRecord).getPayload()); }
2,410
15ea24132e8cfcb6d7b3d16c9b88db4d
swh:1:cnt:2dc86c87ffa3fd85d635035f1df1fecd7428c7a7;origin=https://gitlab.wikimedia.org/repos/data-engineering/gobblin-wmf-deprecated.git;lines=52-55/
e0e05e9a6eeb4f967080a17e642c3b027f2d7743
gobblin-wmf-deprecated
analytics
gobblin-wmf-core/src/main/java/org/wikimedia/gobblin/writer/TimestampedRecordWriterWrapper.java
TimestampedRecordWriterWrapper::cleanup()
function
@Override public void cleanup() throws IOException { wrappedWriter.cleanup(); }
2,411
491a06a24084de9219750d08dbdc1f8d
swh:1:cnt:2dc86c87ffa3fd85d635035f1df1fecd7428c7a7;origin=https://gitlab.wikimedia.org/repos/data-engineering/gobblin-wmf-deprecated.git;lines=62-65/
e0e05e9a6eeb4f967080a17e642c3b027f2d7743
gobblin-wmf-deprecated
analytics
gobblin-wmf-core/src/main/java/org/wikimedia/gobblin/writer/TimestampedRecordWriterWrapper.java
TimestampedRecordWriterWrapper::bytesWritten()
function
@Override public long bytesWritten() throws IOException { return wrappedWriter.bytesWritten(); }
2,412
fcab3cd445fc2a64662cf523246ae545
swh:1:cnt:2dc86c87ffa3fd85d635035f1df1fecd7428c7a7;origin=https://gitlab.wikimedia.org/repos/data-engineering/gobblin-wmf-deprecated.git;lines=72-75/
e0e05e9a6eeb4f967080a17e642c3b027f2d7743
gobblin-wmf-deprecated
analytics
gobblin-wmf-core/src/main/java/org/wikimedia/gobblin/writer/TimestampedRecordWriterWrapper.java
TimestampedRecordWriterWrapper::flush()
function
@Override public void flush() throws IOException { wrappedWriter.flush(); }
2,413
26d460fff3747ea882486a3e63c89557
swh:1:cnt:2dc86c87ffa3fd85d635035f1df1fecd7428c7a7;origin=https://gitlab.wikimedia.org/repos/data-engineering/gobblin-wmf-deprecated.git;lines=77-84/
e0e05e9a6eeb4f967080a17e642c3b027f2d7743
gobblin-wmf-deprecated
analytics
gobblin-wmf-core/src/main/java/org/wikimedia/gobblin/writer/TimestampedRecordWriterWrapper.java
TimestampedRecordWriterWrapper::getOutputFilePath()
function
public String getOutputFilePath() { if (wrappedWriter instanceof FsDataWriter) { return ((FsDataWriter)wrappedWriter).getOutputFilePath(); } else { throw new ClassCastException("Wrong class getting output file path: " + wrappedWriter.getClass().getCanonicalNam...
2,414
2d09c9ea28eb919cb0cd7529880364df
swh:1:cnt:6321347315a7e7fc2a5196442d96232513e987e5;origin=https://gitlab.wikimedia.org/repos/data-engineering/gobblin-wmf-deprecated.git;lines=29-53/
5cbd3c529c0411ce498725388786b369cd4c57b1
gobblin-wmf-deprecated
analytics
gobblin-wmf-core/src/main/java/org/wikimedia/gobblin/writer/TimestampedStringRecordDataWriterBuilder.java
TimestampedStringRecordDataWriterBuilder
type
/** * A {@link DataWriterBuilder} for building {@link DataWriter} that writes a * {@link TimestampedRecord} containing a byte[] payload. */ @Slf4j public class TimestampedStringRecordDataWriterBuilder extends SimpleStringWriterBuilder { /** * Build a {@link org.apache.gobblin.writer.DataWriter}. * ...
2,415
d04f1b3a772b74277d7ddf0d0677d6d6
swh:1:cnt:6321347315a7e7fc2a5196442d96232513e987e5;origin=https://gitlab.wikimedia.org/repos/data-engineering/gobblin-wmf-deprecated.git;lines=36-52/
5cbd3c529c0411ce498725388786b369cd4c57b1
gobblin-wmf-deprecated
analytics
gobblin-wmf-core/src/main/java/org/wikimedia/gobblin/writer/TimestampedStringRecordDataWriterBuilder.java
TimestampedStringRecordDataWriterBuilder::build()
function
/** * Build a {@link org.apache.gobblin.writer.DataWriter}. * * @return the built {@link org.apache.gobblin.writer.DataWriter} * @throws java.io.IOException if there is anything wrong building the writer */ @Override public DataWriter<Object> build() throws IOException { return ...
2,416
cf198fd6aa2ed572a3a26501aac2141e
swh:1:cnt:12970eef3fa67572343fac0180b8ced91284645d;origin=https://gitlab.wikimedia.org/repos/data-engineering/gobblin-wmf-deprecated.git;lines=31-89/
6a62fe4915fb090bc777ae13934e614fea7ffb03
gobblin-wmf-deprecated
analytics
gobblin-wmf-core/src/main/java/org/wikimedia/gobblin/writer/partitioner/JsonStringTimeBasedWriterPartitioner.java
JsonStringTimeBasedWriterPartitioner
type
/** * A {@link TimeBasedWriterPartitioner} for byte[] containing json. * * The json field that contains the timestamp can be specified using TIMESTAMP_COLUMN_KEY. * The format of the json field that contains the timestamp can be specified using TIMESTAMP_FORMAT_KEY. * * If a record doesn't contain the specified f...
2,417
0d57e102971020c4f293addcebed3b24
swh:1:cnt:12970eef3fa67572343fac0180b8ced91284645d;origin=https://gitlab.wikimedia.org/repos/data-engineering/gobblin-wmf-deprecated.git;lines=63-66/
6a62fe4915fb090bc777ae13934e614fea7ffb03
gobblin-wmf-deprecated
analytics
gobblin-wmf-core/src/main/java/org/wikimedia/gobblin/writer/partitioner/JsonStringTimeBasedWriterPartitioner.java
JsonStringTimeBasedWriterPartitioner::getRecordTimestamp(String rec)
function
@Override public long getRecordTimestamp(String rec) { return jsonStringTimestampExtractor.getRecordTimestamp(rec); }
2,418
33933477007cff0360ce1d92007e5a7c
swh:1:cnt:12970eef3fa67572343fac0180b8ced91284645d;origin=https://gitlab.wikimedia.org/repos/data-engineering/gobblin-wmf-deprecated.git;lines=68-77/
6a62fe4915fb090bc777ae13934e614fea7ffb03
gobblin-wmf-deprecated
analytics
gobblin-wmf-core/src/main/java/org/wikimedia/gobblin/writer/partitioner/JsonStringTimeBasedWriterPartitioner.java
JsonStringTimeBasedWriterPartitioner::getWriterPartitionerTimestampColumns(State state, int numBranches, int branchId)
function
/** * Utility function facilitating getting a timestamp-column. */ public static List<String> getWriterPartitionerTimestampColumns(State state, int numBranches, int branchId) { String propName = ForkOperatorUtils.getPropertyNameForBranch(TIMESTAMP_COLUMNS_KEY, numBranches, branchId); List<...
2,419
e2f9dee12761f2c94fcb4b3699f5d35f
swh:1:cnt:12970eef3fa67572343fac0180b8ced91284645d;origin=https://gitlab.wikimedia.org/repos/data-engineering/gobblin-wmf-deprecated.git;lines=79-88/
6a62fe4915fb090bc777ae13934e614fea7ffb03
gobblin-wmf-deprecated
analytics
gobblin-wmf-core/src/main/java/org/wikimedia/gobblin/writer/partitioner/JsonStringTimeBasedWriterPartitioner.java
JsonStringTimeBasedWriterPartitioner::getWriterPartitionerTimestampFormat(State state, int numBranches, int branchId)
function
/** * Utility function facilitating getting a timestamp-format. */ public static String getWriterPartitionerTimestampFormat(State state, int numBranches, int branchId) { String propName = ForkOperatorUtils.getPropertyNameForBranch(TIMESTAMP_FORMAT_KEY, numBranches, branchId); String prop =...
2,420
26a2c731b6fd5334b982d38081e5cc5f
swh:1:cnt:d7876c765fb2253777453f55af811376fb459fe0;origin=https://gitlab.wikimedia.org/repos/data-engineering/gobblin-wmf-deprecated.git;lines=27-61/
8a93199954223b62ea333443cae5eee9c034a586
gobblin-wmf-deprecated
analytics
gobblin-wmf-core/src/main/java/org/wikimedia/gobblin/writer/partitioner/TimestampedRecordOrJsonStringTimeBasedWriterPartitioner.java
TimestampedRecordOrJsonStringTimeBasedWriterPartitioner
type
/** * A {@link TimeBasedWriterPartitioner} for Timestamped byte[] records whose payload contains json. * This class is a superclass of {@link TimestampedRecordTimeBasedWriterPartitioner} overriding the * {@link TimestampedRecordTimeBasedWriterPartitioner#getNonKafkaTimestamp} method only. * * This class uses {@lin...
2,421
cdc73b43b8abf79b8745307e9e74d06c
swh:1:cnt:d7876c765fb2253777453f55af811376fb459fe0;origin=https://gitlab.wikimedia.org/repos/data-engineering/gobblin-wmf-deprecated.git;lines=57-60/
8a93199954223b62ea333443cae5eee9c034a586
gobblin-wmf-deprecated
analytics
gobblin-wmf-core/src/main/java/org/wikimedia/gobblin/writer/partitioner/TimestampedRecordOrJsonStringTimeBasedWriterPartitioner.java
TimestampedRecordOrJsonStringTimeBasedWriterPartitioner::getNonKafkaTimestamp(String payload)
function
@Override protected long getNonKafkaTimestamp(String payload) { return jsonStringTimestampExtractor.getRecordTimestamp(payload); }
2,422
020d865829c511beb128af44f9c775b5
swh:1:cnt:63ee8ffcc51b56f71ff7fd679c3ce222ef034ace;origin=https://gitlab.wikimedia.org/repos/data-engineering/gobblin-wmf-deprecated.git;lines=29-62/
0d09e6341b5da20c8869e6cb3b3a30ac76219444
gobblin-wmf-deprecated
analytics
gobblin-wmf-core/src/main/java/org/wikimedia/gobblin/writer/partitioner/TimestampedRecordTimeBasedWriterPartitioner.java
TimestampedRecordTimeBasedWriterPartitioner
type
/** * A {@link TimeBasedWriterPartitioner} for byte[] containing json. * * The json field that contains the timestamp can be specified using TIMESTAMP_COLUMN_KEY. * The format of the json field that contains the timestamp can be specified using TIMESTAMP_FORMAT_KEY. * * If a record doesn't contain the specified f...
2,423
2aac6cae54fc999f38380170832c19dd
swh:1:cnt:63ee8ffcc51b56f71ff7fd679c3ce222ef034ace;origin=https://gitlab.wikimedia.org/repos/data-engineering/gobblin-wmf-deprecated.git;lines=48-57/
0d09e6341b5da20c8869e6cb3b3a30ac76219444
gobblin-wmf-deprecated
analytics
gobblin-wmf-core/src/main/java/org/wikimedia/gobblin/writer/partitioner/TimestampedRecordTimeBasedWriterPartitioner.java
TimestampedRecordTimeBasedWriterPartitioner::getRecordTimestamp(TimestampedRecord<P> rec)
function
@Override public long getRecordTimestamp(TimestampedRecord<P> rec) { // If a kafka timestamp is set, use it Optional<Long> timestamp = rec.getTimestamp(); if (timestamp.isPresent()) { return timestamp.get(); } else { // Otherwise return current timestamp retur...
2,424
9f31707e9dd1aa1198b2aa5c5b2a5269
swh:1:cnt:63ee8ffcc51b56f71ff7fd679c3ce222ef034ace;origin=https://gitlab.wikimedia.org/repos/data-engineering/gobblin-wmf-deprecated.git;lines=59-61/
0d09e6341b5da20c8869e6cb3b3a30ac76219444
gobblin-wmf-deprecated
analytics
gobblin-wmf-core/src/main/java/org/wikimedia/gobblin/writer/partitioner/TimestampedRecordTimeBasedWriterPartitioner.java
TimestampedRecordTimeBasedWriterPartitioner::getNonKafkaTimestamp(P payload)
function
protected long getNonKafkaTimestamp(P payload) { return System.currentTimeMillis(); }
2,425
abee36c88fef86fa03a94561984f9c36
swh:1:cnt:f43929358567e4bb402cca03126b7138509318a6;origin=https://gitlab.wikimedia.org/repos/data-engineering/gobblin-wmf-deprecated.git;lines=31-69/
db929b456f7252e7a3df13de98dfdebff3a5da4e
gobblin-wmf-deprecated
analytics
gobblin-wmf-core/src/test/java/org/wikimedia/gobblin/converter/TestTimestampedRecordConverterWrapper.java
TestTimestampedRecordConverterWrapper
type
public class TestTimestampedRecordConverterWrapper { @Test(expectedExceptions = RuntimeException.class) public void testNoConfig() { WorkUnitState workUnitState = new WorkUnitState(); TimestampedRecordConverterWrapper converter = (TimestampedRecordConverterWrapper) new Timestam...
2,426
c25dbdbfb1c2cf701a946fe8288733ea
swh:1:cnt:f43929358567e4bb402cca03126b7138509318a6;origin=https://gitlab.wikimedia.org/repos/data-engineering/gobblin-wmf-deprecated.git;lines=33-39/
db929b456f7252e7a3df13de98dfdebff3a5da4e
gobblin-wmf-deprecated
analytics
gobblin-wmf-core/src/test/java/org/wikimedia/gobblin/converter/TestTimestampedRecordConverterWrapper.java
TestTimestampedRecordConverterWrapper::testNoConfig()
function
@Test(expectedExceptions = RuntimeException.class) public void testNoConfig() { WorkUnitState workUnitState = new WorkUnitState(); TimestampedRecordConverterWrapper converter = (TimestampedRecordConverterWrapper) new TimestampedRecordConverterWrapper().init(workUnitState); }
2,427
9c1ef4a47775d82e674ab738b9eeafb7
swh:1:cnt:f43929358567e4bb402cca03126b7138509318a6;origin=https://gitlab.wikimedia.org/repos/data-engineering/gobblin-wmf-deprecated.git;lines=52-68/
db929b456f7252e7a3df13de98dfdebff3a5da4e
gobblin-wmf-deprecated
analytics
gobblin-wmf-core/src/test/java/org/wikimedia/gobblin/converter/TestTimestampedRecordConverterWrapper.java
TestTimestampedRecordConverterWrapper::testConvertRecord()
function
@Test public void testConvertRecord() throws DataConversionException { WorkUnitState workUnitState = new WorkUnitState(); workUnitState.setProp( TimestampedRecordConverterWrapper.CONVERTER_TIMESTAMPED_RECORD_WRAPPED, "org.apache.gobblin.converter.string.StringToBytesC...
2,428
437450bd2230e646439b4532ec12744c
swh:1:cnt:f43929358567e4bb402cca03126b7138509318a6;origin=https://gitlab.wikimedia.org/repos/data-engineering/gobblin-wmf-deprecated.git;lines=41-50/
db929b456f7252e7a3df13de98dfdebff3a5da4e
gobblin-wmf-deprecated
analytics
gobblin-wmf-core/src/test/java/org/wikimedia/gobblin/converter/TestTimestampedRecordConverterWrapper.java
TestTimestampedRecordConverterWrapper::testWrongConfig()
function
@Test(expectedExceptions = RuntimeException.class) public void testWrongConfig() { WorkUnitState workUnitState = new WorkUnitState(); workUnitState.setProp( TimestampedRecordConverterWrapper.CONVERTER_TIMESTAMPED_RECORD_WRAPPED, "WrongClass"); TimestampedReco...
2,429
49fea27af17b2174e7ba5b06bc082fd8
swh:1:cnt:e1288cd9a73870f566bff0cfe0746117ad785005;origin=https://gitlab.wikimedia.org/repos/data-engineering/gobblin-wmf-deprecated.git;lines=39-177/
e4aa676e5cc1fa18a4e2d3b2f4a5031fb9efab07
gobblin-wmf-deprecated
analytics
gobblin-wmf-core/src/test/java/org/wikimedia/gobblin/kafka/TestKafka1TimestampedRecordExtractor.java
TestKafka1TimestampedRecordExtractor
type
/** * Tests for {@link Kafka1TimestampedRecordExtractor}. */ @Slf4j public class TestKafka1TimestampedRecordExtractor { private static final String TEST_TOPIC_NAME = "testTopic"; private static final byte[] testPayload = "Hello World".getBytes(UTF_8); private static final long testTimestamp = 14200992000...
2,430
d2fcfb10040a58bf0a93e99eb6cb3aa7
swh:1:cnt:e1288cd9a73870f566bff0cfe0746117ad785005;origin=https://gitlab.wikimedia.org/repos/data-engineering/gobblin-wmf-deprecated.git;lines=50-61/
e4aa676e5cc1fa18a4e2d3b2f4a5031fb9efab07
gobblin-wmf-deprecated
analytics
gobblin-wmf-core/src/test/java/org/wikimedia/gobblin/kafka/TestKafka1TimestampedRecordExtractor.java
TestKafka1TimestampedRecordExtractor::testDecodeKafkaMessageWithoutTimestamp()
function
@Test public void testDecodeKafkaMessageWithoutTimestamp() throws IOException, DataRecordException { WorkUnitState mockWorkUnitState = TestUtils.getMockWorkUnitState(noString, noString, TEST_TOPIC_NAME); Kafka1TimestampedRecordExtractor<byte[]> kTRE = new Kafka1TimestampedRecordExtractor(mockWorkUni...
2,431
e77d3305a7591a6e5999bd8b76b151c4
swh:1:cnt:e1288cd9a73870f566bff0cfe0746117ad785005;origin=https://gitlab.wikimedia.org/repos/data-engineering/gobblin-wmf-deprecated.git;lines=77-88/
e4aa676e5cc1fa18a4e2d3b2f4a5031fb9efab07
gobblin-wmf-deprecated
analytics
gobblin-wmf-core/src/test/java/org/wikimedia/gobblin/kafka/TestKafka1TimestampedRecordExtractor.java
TestKafka1TimestampedRecordExtractor::testDecodeKafkaMessageWitTimestampButNoAcceptedType()
function
@Test public void testDecodeKafkaMessageWitTimestampButNoAcceptedType() throws IOException, DataRecordException { WorkUnitState mockWorkUnitState = TestUtils.getMockWorkUnitState(noString, noString, TEST_TOPIC_NAME); Kafka1TimestampedRecordExtractor<byte[]> kTRE = new Kafka1TimestampedRecordExtracto...
2,432
47ff75dd998d7e1e2113a165b85108f0
swh:1:cnt:e1288cd9a73870f566bff0cfe0746117ad785005;origin=https://gitlab.wikimedia.org/repos/data-engineering/gobblin-wmf-deprecated.git;lines=103-114/
e4aa676e5cc1fa18a4e2d3b2f4a5031fb9efab07
gobblin-wmf-deprecated
analytics
gobblin-wmf-core/src/test/java/org/wikimedia/gobblin/kafka/TestKafka1TimestampedRecordExtractor.java
TestKafka1TimestampedRecordExtractor::testDecodeKafkaMessageWitTimestampAndAcceptedTypeList()
function
@Test public void testDecodeKafkaMessageWitTimestampAndAcceptedTypeList() throws IOException, DataRecordException { WorkUnitState mockWorkUnitState = TestUtils.getMockWorkUnitState(Optional.of("CreateTime,LogAppendTime"), noString, TEST_TOPIC_NAME); Kafka1TimestampedRecordExtractor<byte[]> kTRE = ne...
2,433
5b48a9312d90ef944e199c468158d928
swh:1:cnt:e1288cd9a73870f566bff0cfe0746117ad785005;origin=https://gitlab.wikimedia.org/repos/data-engineering/gobblin-wmf-deprecated.git;lines=129-140/
e4aa676e5cc1fa18a4e2d3b2f4a5031fb9efab07
gobblin-wmf-deprecated
analytics
gobblin-wmf-core/src/test/java/org/wikimedia/gobblin/kafka/TestKafka1TimestampedRecordExtractor.java
TestKafka1TimestampedRecordExtractor::testDecodeKafkaMessageWithoutTimestampAndAcceptedType()
function
@Test public void testDecodeKafkaMessageWithoutTimestampAndAcceptedType() throws IOException, DataRecordException { WorkUnitState mockWorkUnitState = TestUtils.getMockWorkUnitState(Optional.of("CreateTime"), noString, TEST_TOPIC_NAME); Kafka1TimestampedRecordExtractor<byte[]> kTRE = new Kafka1Timest...
2,434
b87567666ffecdc756eb16a1dc1eae30
swh:1:cnt:e1288cd9a73870f566bff0cfe0746117ad785005;origin=https://gitlab.wikimedia.org/repos/data-engineering/gobblin-wmf-deprecated.git;lines=157-161/
e4aa676e5cc1fa18a4e2d3b2f4a5031fb9efab07
gobblin-wmf-deprecated
analytics
gobblin-wmf-core/src/test/java/org/wikimedia/gobblin/kafka/TestKafka1TimestampedRecordExtractor.java
TestKafka1TimestampedRecordExtractor::testWrongExtractedTimestampType()
function
@Test(expectedExceptions = NoSuchElementException.class) public void testWrongExtractedTimestampType() throws IOException, DataRecordException { WorkUnitState mockWorkUnitState = TestUtils.getMockWorkUnitState(Optional.of("Wrong"), noString, TEST_TOPIC_NAME); Kafka1TimestampedRecordExtractor<byte[]>...
2,435
dba2ea6788ada6e0c66ef985b85b5e20
swh:1:cnt:e1288cd9a73870f566bff0cfe0746117ad785005;origin=https://gitlab.wikimedia.org/repos/data-engineering/gobblin-wmf-deprecated.git;lines=90-101/
e4aa676e5cc1fa18a4e2d3b2f4a5031fb9efab07
gobblin-wmf-deprecated
analytics
gobblin-wmf-core/src/test/java/org/wikimedia/gobblin/kafka/TestKafka1TimestampedRecordExtractor.java
TestKafka1TimestampedRecordExtractor::testDecodeKafkaMessageWitTimestampAndAcceptedType()
function
@Test public void testDecodeKafkaMessageWitTimestampAndAcceptedType() throws IOException, DataRecordException { WorkUnitState mockWorkUnitState = TestUtils.getMockWorkUnitState(Optional.of("CreateTime"), noString, TEST_TOPIC_NAME); Kafka1TimestampedRecordExtractor<byte[]> kTRE = new Kafka1Timestampe...
2,436
c64392b225d52e9a17c993c98310f2b8
swh:1:cnt:e1288cd9a73870f566bff0cfe0746117ad785005;origin=https://gitlab.wikimedia.org/repos/data-engineering/gobblin-wmf-deprecated.git;lines=63-75/
e4aa676e5cc1fa18a4e2d3b2f4a5031fb9efab07
gobblin-wmf-deprecated
analytics
gobblin-wmf-core/src/test/java/org/wikimedia/gobblin/kafka/TestKafka1TimestampedRecordExtractor.java
TestKafka1TimestampedRecordExtractor::testDecodeKafkaMessageWithoutTimestampButCurrentDefault()
function
@Test public void testDecodeKafkaMessageWithoutTimestampButCurrentDefault() throws IOException, DataRecordException { WorkUnitState mockWorkUnitState = TestUtils.getMockWorkUnitState(noString, Optional.of("true"), TEST_TOPIC_NAME); Kafka1TimestampedRecordExtractor<byte[]> kTRE = new Kafka1Timestampe...
2,437
7f48fc909ad539b57c29de04fc31657f
swh:1:cnt:e1288cd9a73870f566bff0cfe0746117ad785005;origin=https://gitlab.wikimedia.org/repos/data-engineering/gobblin-wmf-deprecated.git;lines=116-127/
e4aa676e5cc1fa18a4e2d3b2f4a5031fb9efab07
gobblin-wmf-deprecated
analytics
gobblin-wmf-core/src/test/java/org/wikimedia/gobblin/kafka/TestKafka1TimestampedRecordExtractor.java
TestKafka1TimestampedRecordExtractor::testDecodeKafkaMessageWitTimestampAndAcceptedTypeList2()
function
@Test public void testDecodeKafkaMessageWitTimestampAndAcceptedTypeList2() throws IOException, DataRecordException { WorkUnitState mockWorkUnitState = TestUtils.getMockWorkUnitState(Optional.of("CreateTime,LogAppendTime"), noString, TEST_TOPIC_NAME); Kafka1TimestampedRecordExtractor<byte[]> kTRE = n...
2,438
3e92f841232110d74c2e41b801154bf6
swh:1:cnt:e1288cd9a73870f566bff0cfe0746117ad785005;origin=https://gitlab.wikimedia.org/repos/data-engineering/gobblin-wmf-deprecated.git;lines=142-155/
e4aa676e5cc1fa18a4e2d3b2f4a5031fb9efab07
gobblin-wmf-deprecated
analytics
gobblin-wmf-core/src/test/java/org/wikimedia/gobblin/kafka/TestKafka1TimestampedRecordExtractor.java
TestKafka1TimestampedRecordExtractor::testDecodeKafkaMessageWithoutTimestampAndAcceptedTypeAndCurrentTimestampDefault()
function
@Test public void testDecodeKafkaMessageWithoutTimestampAndAcceptedTypeAndCurrentTimestampDefault() throws IOException, DataRecordException { WorkUnitState mockWorkUnitState = TestUtils.getMockWorkUnitState(Optional.of("CreateTime"), Optional.of("true"), TEST_TOPIC_NAME); Kafka1Timestamp...
2,439
7de4cd157fa8d0520dca22ab9ffa72f1
swh:1:cnt:e1288cd9a73870f566bff0cfe0746117ad785005;origin=https://gitlab.wikimedia.org/repos/data-engineering/gobblin-wmf-deprecated.git;lines=163-167/
e4aa676e5cc1fa18a4e2d3b2f4a5031fb9efab07
gobblin-wmf-deprecated
analytics
gobblin-wmf-core/src/test/java/org/wikimedia/gobblin/kafka/TestKafka1TimestampedRecordExtractor.java
TestKafka1TimestampedRecordExtractor::testInvalidExtractedTimestampType()
function
@Test(expectedExceptions = IllegalArgumentException.class) public void testInvalidExtractedTimestampType() throws IOException, DataRecordException { WorkUnitState mockWorkUnitState = TestUtils.getMockWorkUnitState(Optional.of("NoTimestampType"), noString, TEST_TOPIC_NAME); Kafka1TimestampedRecordExt...
2,440
1910fcfd93de6178effd00b5c019909b
swh:1:cnt:e1288cd9a73870f566bff0cfe0746117ad785005;origin=https://gitlab.wikimedia.org/repos/data-engineering/gobblin-wmf-deprecated.git;lines=169-175/
e4aa676e5cc1fa18a4e2d3b2f4a5031fb9efab07
gobblin-wmf-deprecated
analytics
gobblin-wmf-core/src/test/java/org/wikimedia/gobblin/kafka/TestKafka1TimestampedRecordExtractor.java
TestKafka1TimestampedRecordExtractor::testFailDecodeKafkaRecord()
function
@Test(expectedExceptions = IllegalArgumentException.class) public void testFailDecodeKafkaRecord() throws IOException, DataRecordException { WorkUnitState mockWorkUnitState = TestUtils.getMockWorkUnitState(Optional.of("CreateTime,LogAppendTime"), noString, TEST_TOPIC_NAME); Kafka1TimestampedRecordEx...
2,441
ec0dd5b1980199f88d2ef7e1bf9be374
swh:1:cnt:cbd19e49ac0db146f47acec28e70e74c92548faf;origin=https://gitlab.wikimedia.org/repos/data-engineering/gobblin-wmf-deprecated.git;lines=39-88/
7a6d86a5eb7cbd1b8741966e0fd7eaae51447a7f
gobblin-wmf-deprecated
analytics
gobblin-wmf-core/src/test/java/org/wikimedia/gobblin/kafka/TestUtils.java
TestUtils
type
public final class TestUtils { private TestUtils() { // Hiding constructor of utility class } public static WorkUnitState getMockWorkUnitState(Optional<String> extractedTimestampTypes, Optional<String> useCurrentTimestampAsDefault, ...
2,442
cecc68c239c06a81ccb96f0aaf867e9c
swh:1:cnt:cbd19e49ac0db146f47acec28e70e74c92548faf;origin=https://gitlab.wikimedia.org/repos/data-engineering/gobblin-wmf-deprecated.git;lines=45-70/
7a6d86a5eb7cbd1b8741966e0fd7eaae51447a7f
gobblin-wmf-deprecated
analytics
gobblin-wmf-core/src/test/java/org/wikimedia/gobblin/kafka/TestUtils.java
TestUtils::getMockWorkUnitState(Optional<String> extractedTimestampTypes, Optional<String> useCurrentTimestampAsDefault, String testTopicName)
function
public static WorkUnitState getMockWorkUnitState(Optional<String> extractedTimestampTypes, Optional<String> useCurrentTimestampAsDefault, String testTopicName) { WorkUnit mockWorkUnit = WorkUnit.createEmpty(); ...
2,443
b62a897d5faa296ab2514e4fbd13d672
swh:1:cnt:cbd19e49ac0db146f47acec28e70e74c92548faf;origin=https://gitlab.wikimedia.org/repos/data-engineering/gobblin-wmf-deprecated.git;lines=72-87/
7a6d86a5eb7cbd1b8741966e0fd7eaae51447a7f
gobblin-wmf-deprecated
analytics
gobblin-wmf-core/src/test/java/org/wikimedia/gobblin/kafka/TestUtils.java
TestUtils::getMockKafkaConsumerRecord( TimestampType timestampType, long timestamp, byte[] payload, String testTopicName)
function
public static Kafka1ConsumerClient.Kafka1ConsumerRecord<Object, Object> getMockKafkaConsumerRecord( TimestampType timestampType, long timestamp, byte[] payload, String testTopicName) { ConsumerRecord mockConsumerRecord = mock(ConsumerRecord.class); // Values used in base Extractor initializa...
2,444
9e34c63ea0ba0c84e8432a04e0c100ad
swh:1:cnt:0ed5842cab713f111edcf2079b91eb80b5d520fc;origin=https://gitlab.wikimedia.org/repos/data-engineering/gobblin-wmf-deprecated.git;lines=33-51/
066d388587c66d498dd1fe362b48beadc7152177
gobblin-wmf-deprecated
analytics
gobblin-wmf-core/src/test/java/org/wikimedia/gobblin/kafka/TestWikimediaKafkaSource.java
TestWikimediaKafkaSource
type
/** * Tests for {@link WikimediaKafkaSource}. */ @Slf4j public class TestWikimediaKafkaSource { @Test public void testSettingsListToMap() { WikimediaKafkaSource source = new WikimediaKafkaSource() { @Override public Extractor getExtractor(WorkUnitState state) throws IOExceptio...
2,445
b64c4d45d8fb8b323248f398a581c9c7
swh:1:cnt:0ed5842cab713f111edcf2079b91eb80b5d520fc;origin=https://gitlab.wikimedia.org/repos/data-engineering/gobblin-wmf-deprecated.git;lines=39-50/
066d388587c66d498dd1fe362b48beadc7152177
gobblin-wmf-deprecated
analytics
gobblin-wmf-core/src/test/java/org/wikimedia/gobblin/kafka/TestWikimediaKafkaSource.java
TestWikimediaKafkaSource::testSettingsListToMap()
function
@Test public void testSettingsListToMap() { WikimediaKafkaSource source = new WikimediaKafkaSource() { @Override public Extractor getExtractor(WorkUnitState state) throws IOException { return null; } }; Map<String, String> settingsMap = so...
2,446
898d2c21828ea1312c70a5e62794ddda
swh:1:cnt:0ed5842cab713f111edcf2079b91eb80b5d520fc;origin=https://gitlab.wikimedia.org/repos/data-engineering/gobblin-wmf-deprecated.git;lines=42-45/
066d388587c66d498dd1fe362b48beadc7152177
gobblin-wmf-deprecated
analytics
gobblin-wmf-core/src/test/java/org/wikimedia/gobblin/kafka/TestWikimediaKafkaSource.java
TestWikimediaKafkaSource::testSettingsListToMap::getExtractor(WorkUnitState state)
function
@Override public Extractor getExtractor(WorkUnitState state) throws IOException { return null; }
2,447
cd1bb1974709f688c21405c56ef14d70
swh:1:cnt:365d62ca5ae4a26856563be86489bce5fa162860;origin=https://gitlab.wikimedia.org/repos/data-engineering/gobblin-wmf-deprecated.git;lines=37-145/
ccf2c77b2f8cbd3afd4a47d416b03fbc2b6a48dc
gobblin-wmf-deprecated
analytics
gobblin-wmf-core/src/test/java/org/wikimedia/gobblin/publisher/TestTimePartitionedFlagDataPublisher.java
TestTimePartitionedFlagDataPublisher
type
@Test public class TestTimePartitionedFlagDataPublisher { private String publisherDir; private List<File> publishedDirs; private List<File> publishedDirsToFlag; private List<File> publishedDirsNotToFlag; private void prepareTestDirs() { File publishPath = Files.createTempDir(); thi...
2,448
5696a0f139184872dec5115742422acc
swh:1:cnt:365d62ca5ae4a26856563be86489bce5fa162860;origin=https://gitlab.wikimedia.org/repos/data-engineering/gobblin-wmf-deprecated.git;lines=45-66/
ccf2c77b2f8cbd3afd4a47d416b03fbc2b6a48dc
gobblin-wmf-deprecated
analytics
gobblin-wmf-core/src/test/java/org/wikimedia/gobblin/publisher/TestTimePartitionedFlagDataPublisher.java
TestTimePartitionedFlagDataPublisher::prepareTestDirs()
function
private void prepareTestDirs() { File publishPath = Files.createTempDir(); this.publisherDir = publishPath.getAbsolutePath(); this.publishedDirs = new ArrayList<>(); this.publishedDirsToFlag = new ArrayList<>(); this.publishedDirsNotToFlag = new ArrayList<>(); this.publi...
2,449
65ed97aaa0454be247e60c9f7c971910
swh:1:cnt:365d62ca5ae4a26856563be86489bce5fa162860;origin=https://gitlab.wikimedia.org/repos/data-engineering/gobblin-wmf-deprecated.git;lines=103-115/
ccf2c77b2f8cbd3afd4a47d416b03fbc2b6a48dc
gobblin-wmf-deprecated
analytics
gobblin-wmf-core/src/test/java/org/wikimedia/gobblin/publisher/TestTimePartitionedFlagDataPublisher.java
TestTimePartitionedFlagDataPublisher::buildWorkUnitState(WorkUnitState.WorkingState workingState, String tableName, List<String> partitions)
function
private WorkUnitState buildWorkUnitState(WorkUnitState.WorkingState workingState, String tableName, List<String> partitions) { WorkUnitState state = new WorkUnitState(WorkUnit.createEmpty(), new State()); state.setWorkingState(workingState); state.setProp(ConfigurationKeys.EXTRACT_TABLE_NAME_KEY...
2,450
76af3c35e264fdc98be2a3b219bc3d4b
swh:1:cnt:365d62ca5ae4a26856563be86489bce5fa162860;origin=https://gitlab.wikimedia.org/repos/data-engineering/gobblin-wmf-deprecated.git;lines=75-83/
ccf2c77b2f8cbd3afd4a47d416b03fbc2b6a48dc
gobblin-wmf-deprecated
analytics
gobblin-wmf-core/src/test/java/org/wikimedia/gobblin/publisher/TestTimePartitionedFlagDataPublisher.java
TestTimePartitionedFlagDataPublisher::prepareMainState()
function
private State prepareMainState() { State mainState = new State(); mainState.setProp(ConfigurationKeys.DATA_PUBLISHER_FINAL_DIR, this.publisherDir); // Only set parent publisherDir for t1 (others are done in the children tasks) for (File publishedDir: this.publishedDirs) { mai...
2,451
8102f7531d6eabac547c343e33843c57
swh:1:cnt:365d62ca5ae4a26856563be86489bce5fa162860;origin=https://gitlab.wikimedia.org/repos/data-engineering/gobblin-wmf-deprecated.git;lines=85-101/
ccf2c77b2f8cbd3afd4a47d416b03fbc2b6a48dc
gobblin-wmf-deprecated
analytics
gobblin-wmf-core/src/test/java/org/wikimedia/gobblin/publisher/TestTimePartitionedFlagDataPublisher.java
TestTimePartitionedFlagDataPublisher::prepareWorkUnitStates()
function
private List<WorkUnitState> prepareWorkUnitStates() { return Arrays.asList( // t1 should be in the table list and have partition "2021/05/01" to flag buildWorkUnitState(WorkUnitState.WorkingState.COMMITTED, "t1", Arrays.asList("2021/05/01", "2021/05/02", "2021/05/03")), ...
2,452
39f0eaa29c6f67fe4e37b204608859c8
swh:1:cnt:365d62ca5ae4a26856563be86489bce5fa162860;origin=https://gitlab.wikimedia.org/repos/data-engineering/gobblin-wmf-deprecated.git;lines=68-73/
ccf2c77b2f8cbd3afd4a47d416b03fbc2b6a48dc
gobblin-wmf-deprecated
analytics
gobblin-wmf-core/src/test/java/org/wikimedia/gobblin/publisher/TestTimePartitionedFlagDataPublisher.java
TestTimePartitionedFlagDataPublisher::addPublishedDir(String relativePath)
function
private File addPublishedDir(String relativePath) { File publishedDir = new File(this.publisherDir, relativePath); Assert.assertTrue(publishedDir.mkdirs()); this.publishedDirs.add(publishedDir); return publishedDir; }
2,453
7be07dd871c334298e468b4da37f5eb8
swh:1:cnt:365d62ca5ae4a26856563be86489bce5fa162860;origin=https://gitlab.wikimedia.org/repos/data-engineering/gobblin-wmf-deprecated.git;lines=117-131/
ccf2c77b2f8cbd3afd4a47d416b03fbc2b6a48dc
gobblin-wmf-deprecated
analytics
gobblin-wmf-core/src/test/java/org/wikimedia/gobblin/publisher/TestTimePartitionedFlagDataPublisher.java
TestTimePartitionedFlagDataPublisher::checkFlaggedDirs()
function
private void checkFlaggedDirs() { // Check folders that shouldn't have been flagged are empty for (File dirNotFlagged: this.publishedDirsNotToFlag) { Assert.assertEquals(dirNotFlagged.list().length, 0, "Directory " + dirNotFlagged.getAbsolutePath() + " length"); }...
2,454
4be44602576851f026f621802078ce2c
swh:1:cnt:365d62ca5ae4a26856563be86489bce5fa162860;origin=https://gitlab.wikimedia.org/repos/data-engineering/gobblin-wmf-deprecated.git;lines=133-144/
ccf2c77b2f8cbd3afd4a47d416b03fbc2b6a48dc
gobblin-wmf-deprecated
analytics
gobblin-wmf-core/src/test/java/org/wikimedia/gobblin/publisher/TestTimePartitionedFlagDataPublisher.java
TestTimePartitionedFlagDataPublisher::testTimePartitionedFlagDataPublisher()
function
public void testTimePartitionedFlagDataPublisher() throws IOException { prepareTestDirs(); State mainState = prepareMainState(); List<? extends WorkUnitState> childrenStates = prepareWorkUnitStates(); TimePartitionedFlagDataPublisher timePartitionedFlagDataPublisher = new TimePartition...
2,455
ddd168b93aa138b852c9ca9348f0337e
swh:1:cnt:dc8f4e3703e2f323280916f083eb71e6dad29342;origin=https://gitlab.wikimedia.org/repos/data-engineering/gobblin-wmf-deprecated.git;lines=27-90/
4b762e8b6e21867a06719504ea0f64bb172a8647
gobblin-wmf-deprecated
analytics
gobblin-wmf-core/src/test/java/org/wikimedia/gobblin/utils/TestJsonStringTimestampExtractor.java
TestJsonStringTimestampExtractor
type
/** * Tests for {@link JsonStringTimestampExtractor}. */ @Test public class TestJsonStringTimestampExtractor { private JsonStringTimestampExtractor timestampExtractor; private static final List<String> tsColumn = Arrays.asList("meta.dt"); @Test public void testUnixExtractor() { timestampExtr...
2,456
d75f17394024a7ad9f22209c66b1b314
swh:1:cnt:dc8f4e3703e2f323280916f083eb71e6dad29342;origin=https://gitlab.wikimedia.org/repos/data-engineering/gobblin-wmf-deprecated.git;lines=36-40/
4b762e8b6e21867a06719504ea0f64bb172a8647
gobblin-wmf-deprecated
analytics
gobblin-wmf-core/src/test/java/org/wikimedia/gobblin/utils/TestJsonStringTimestampExtractor.java
TestJsonStringTimestampExtractor::testUnixExtractor()
function
@Test public void testUnixExtractor() { timestampExtractor = new JsonStringTimestampExtractor(tsColumn, "unix"); Assert.assertEquals(timestampExtractor.getRecordTimestamp("{\"meta\": {\"dt\": 1420099200}}"), 1420099200000L); }
2,457
d9086905b6c09df77c2d840143c521c0
swh:1:cnt:dc8f4e3703e2f323280916f083eb71e6dad29342;origin=https://gitlab.wikimedia.org/repos/data-engineering/gobblin-wmf-deprecated.git;lines=48-52/
4b762e8b6e21867a06719504ea0f64bb172a8647
gobblin-wmf-deprecated
analytics
gobblin-wmf-core/src/test/java/org/wikimedia/gobblin/utils/TestJsonStringTimestampExtractor.java
TestJsonStringTimestampExtractor::testUnixMillisecondsExtractor()
function
@Test public void testUnixMillisecondsExtractor() { timestampExtractor = new JsonStringTimestampExtractor(tsColumn, "unix_milliseconds"); Assert.assertEquals(timestampExtractor.getRecordTimestamp("{\"meta\": {\"dt\": 1420099200000}}"), 1420099200000L); }
2,458
624f7b8425b4e51e9c39778b8e2e9512
swh:1:cnt:dc8f4e3703e2f323280916f083eb71e6dad29342;origin=https://gitlab.wikimedia.org/repos/data-engineering/gobblin-wmf-deprecated.git;lines=60-64/
4b762e8b6e21867a06719504ea0f64bb172a8647
gobblin-wmf-deprecated
analytics
gobblin-wmf-core/src/test/java/org/wikimedia/gobblin/utils/TestJsonStringTimestampExtractor.java
TestJsonStringTimestampExtractor::testCustomExtractor()
function
@Test public void testCustomExtractor() { timestampExtractor = new JsonStringTimestampExtractor(tsColumn, "dd/MM/yyyy HH:mm:ssX"); Assert.assertEquals(timestampExtractor.getRecordTimestamp("{\"meta\": {\"dt\": \"01/01/2015 08:00:00Z\"}}"), 1420099200000L); }
2,459
5cc0d52842c704ff01d657ce24f0b3a6
swh:1:cnt:dc8f4e3703e2f323280916f083eb71e6dad29342;origin=https://gitlab.wikimedia.org/repos/data-engineering/gobblin-wmf-deprecated.git;lines=72-78/
4b762e8b6e21867a06719504ea0f64bb172a8647
gobblin-wmf-deprecated
analytics
gobblin-wmf-core/src/test/java/org/wikimedia/gobblin/utils/TestJsonStringTimestampExtractor.java
TestJsonStringTimestampExtractor::testWrongColumnExtractor()
function
@Test public void testWrongColumnExtractor() { // Check that returned timestamp is current long currentTime = System.currentTimeMillis(); timestampExtractor = new JsonStringTimestampExtractor(Arrays.asList("meta.wrong"), "unix_milliseconds"); Assert.assertTrue(timestampExtractor.getR...
2,460
adf7e7714d1b1b02aa5a112fb729a281
swh:1:cnt:dc8f4e3703e2f323280916f083eb71e6dad29342;origin=https://gitlab.wikimedia.org/repos/data-engineering/gobblin-wmf-deprecated.git;lines=54-58/
4b762e8b6e21867a06719504ea0f64bb172a8647
gobblin-wmf-deprecated
analytics
gobblin-wmf-core/src/test/java/org/wikimedia/gobblin/utils/TestJsonStringTimestampExtractor.java
TestJsonStringTimestampExtractor::testIso8601Extractor()
function
@Test public void testIso8601Extractor() { timestampExtractor = new JsonStringTimestampExtractor(tsColumn, "ISO_8601"); Assert.assertEquals(timestampExtractor.getRecordTimestamp("{\"meta\": {\"dt\": \"2015-01-01T08:00:00.000Z\"}}"), 1420099200000L); }
2,461
f6d3013739754682f3dcff9cd09f9b98
swh:1:cnt:dc8f4e3703e2f323280916f083eb71e6dad29342;origin=https://gitlab.wikimedia.org/repos/data-engineering/gobblin-wmf-deprecated.git;lines=42-46/
4b762e8b6e21867a06719504ea0f64bb172a8647
gobblin-wmf-deprecated
analytics
gobblin-wmf-core/src/test/java/org/wikimedia/gobblin/utils/TestJsonStringTimestampExtractor.java
TestJsonStringTimestampExtractor::testUnixSecondsExtractor()
function
@Test public void testUnixSecondsExtractor() { timestampExtractor = new JsonStringTimestampExtractor(tsColumn, "unix_seconds"); Assert.assertEquals(timestampExtractor.getRecordTimestamp("{\"meta\": {\"dt\": 1420099200}}"), 1420099200000L); }
2,462
a8328bd90c58bbcb5481b94f662831ba
swh:1:cnt:dc8f4e3703e2f323280916f083eb71e6dad29342;origin=https://gitlab.wikimedia.org/repos/data-engineering/gobblin-wmf-deprecated.git;lines=66-70/
4b762e8b6e21867a06719504ea0f64bb172a8647
gobblin-wmf-deprecated
analytics
gobblin-wmf-core/src/test/java/org/wikimedia/gobblin/utils/TestJsonStringTimestampExtractor.java
TestJsonStringTimestampExtractor::testUnixMultiFieldExtractor()
function
@Test public void testUnixMultiFieldExtractor() { timestampExtractor = new JsonStringTimestampExtractor(Arrays.asList("meta.wrong", "meta.dt"), "unix"); Assert.assertEquals(timestampExtractor.getRecordTimestamp("{\"meta\": {\"dt\": 1420099200}}"), 1420099200000L); }
2,463
758f39df39e12399ff0bd7f1e751f89c
swh:1:cnt:dc8f4e3703e2f323280916f083eb71e6dad29342;origin=https://gitlab.wikimedia.org/repos/data-engineering/gobblin-wmf-deprecated.git;lines=80-83/
4b762e8b6e21867a06719504ea0f64bb172a8647
gobblin-wmf-deprecated
analytics
gobblin-wmf-core/src/test/java/org/wikimedia/gobblin/utils/TestJsonStringTimestampExtractor.java
TestJsonStringTimestampExtractor::testNullFormatExtractor()
function
@Test(expectedExceptions = IllegalArgumentException.class) public void testNullFormatExtractor() { timestampExtractor = new JsonStringTimestampExtractor(tsColumn, null); }
2,464
29b78b329be64de69a6e780b63647f9e
swh:1:cnt:dc8f4e3703e2f323280916f083eb71e6dad29342;origin=https://gitlab.wikimedia.org/repos/data-engineering/gobblin-wmf-deprecated.git;lines=85-88/
4b762e8b6e21867a06719504ea0f64bb172a8647
gobblin-wmf-deprecated
analytics
gobblin-wmf-core/src/test/java/org/wikimedia/gobblin/utils/TestJsonStringTimestampExtractor.java
TestJsonStringTimestampExtractor::testWrongFormatExtractor()
function
@Test(expectedExceptions = IllegalArgumentException.class) public void testWrongFormatExtractor() { timestampExtractor = new JsonStringTimestampExtractor(tsColumn, "wrong format"); }
2,465
459c0d193a890e1d02bbdba18a335ca1
swh:1:cnt:1ec413b8c8007f44b2f7244b8aa3272ef07f83a5;origin=https://gitlab.wikimedia.org/repos/data-engineering/gobblin-wmf-deprecated.git;lines=20-54/
1dec8a0aa6598e1ec422e00efb5e7644310311d1
gobblin-wmf-deprecated
analytics
gobblin-wmf-core/src/test/java/org/wikimedia/gobblin/writer/TestConstants.java
TestConstants
type
/** * Copied and modified from gobblin-core:org.apache.gobblin.writer.TestConstants. */ public final class TestConstants { private TestConstants() { // Hide constructor of utility class } public static final String[] JSON_RECORDS = {"{\"name\": \"Alyssa\", \"favorite_number\": 256, \...
2,466
9e276289122a6ecb82a0c64800326d01
swh:1:cnt:3642268744b111b82e85a0b70f409a7f2ab313fd;origin=https://gitlab.wikimedia.org/repos/data-engineering/gobblin-wmf-deprecated.git;lines=52-294/
3fad61e344a663a5700c909fb5593c02a7baceb5
gobblin-wmf-deprecated
analytics
gobblin-wmf-core/src/test/java/org/wikimedia/gobblin/writer/TestTimestampedStringRecordWriter.java
TestTimestampedStringRecordWriter
type
/** * Tests for {@link TimestampedRecordWriterWrapper}. * Copied and updated from gobblin-core:org.apache.gobblin.writer.SimpleDataWriterTest. */ @Test public class TestTimestampedStringRecordWriter { private String filePath; private final String schema = ""; private final int newLine = "\n".getBytes(UT...
2,467
866a600973ae02265023e3196aa08400
swh:1:cnt:3642268744b111b82e85a0b70f409a7f2ab313fd;origin=https://gitlab.wikimedia.org/repos/data-engineering/gobblin-wmf-deprecated.git;lines=65-89/
3fad61e344a663a5700c909fb5593c02a7baceb5
gobblin-wmf-deprecated
analytics
gobblin-wmf-core/src/test/java/org/wikimedia/gobblin/writer/TestTimestampedStringRecordWriter.java
TestTimestampedStringRecordWriter::setUp()
function
@BeforeMethod public void setUp() throws Exception { properties = new State(); // Making the staging and/or output dirs if necessary File stagingDir = new File(TestConstants.TEST_STAGING_DIR); File outputDir = new File(TestConstants.TEST_OUTPUT_DIR); if (!stagingDir.exists()...
2,468
14393b236bdeb0e0878f2677775a680b
swh:1:cnt:3642268744b111b82e85a0b70f409a7f2ab313fd;origin=https://gitlab.wikimedia.org/repos/data-engineering/gobblin-wmf-deprecated.git;lines=163-191/
3fad61e344a663a5700c909fb5593c02a7baceb5
gobblin-wmf-deprecated
analytics
gobblin-wmf-core/src/test/java/org/wikimedia/gobblin/writer/TestTimestampedStringRecordWriter.java
TestTimestampedStringRecordWriter::testSupportsGzipAndEncryption()
function
@Test public void testSupportsGzipAndEncryption() throws IOException { final String ENCRYPTION_TYPE = "insecure_shift"; final String COMPRESSION_TYPE = "gz"; properties.setProp(ConfigurationKeys.WRITER_CODEC_TYPE, COMPRESSION_TYPE); properties.setProp(ENCRYPT_PREFIX + EncryptionConf...
2,469
93760da44a2c3126d5c29486d31a1320
swh:1:cnt:3642268744b111b82e85a0b70f409a7f2ab313fd;origin=https://gitlab.wikimedia.org/repos/data-engineering/gobblin-wmf-deprecated.git;lines=94-141/
3fad61e344a663a5700c909fb5593c02a7baceb5
gobblin-wmf-deprecated
analytics
gobblin-wmf-core/src/test/java/org/wikimedia/gobblin/writer/TestTimestampedStringRecordWriter.java
TestTimestampedStringRecordWriter::testWriteRandomBytes()
function
/** * Test writing records without a delimiter and make sure it works. * @throws IOException */ /** * Use the data writer to write random bytes to a file and ensure * they are the same when read back. * * @throws IOException */ @Test public void testWriteRandomBytes(...
2,470
0cb19822bea076346e35af05b69932e2
swh:1:cnt:3642268744b111b82e85a0b70f409a7f2ab313fd;origin=https://gitlab.wikimedia.org/repos/data-engineering/gobblin-wmf-deprecated.git;lines=238-283/
3fad61e344a663a5700c909fb5593c02a7baceb5
gobblin-wmf-deprecated
analytics
gobblin-wmf-core/src/test/java/org/wikimedia/gobblin/writer/TestTimestampedStringRecordWriter.java
TestTimestampedStringRecordWriter::testOverwriteExistingStagingFile()
function
/** * If the staging file exists, the data writer should overwrite its contents. * * @throws IOException */ @Test public void testOverwriteExistingStagingFile() throws IOException { String randomStringStage = "staging string"; String randomStringWrite = "to-write string"; ...
2,471
4be7d192e5b5105f1880f270a948d495
swh:1:cnt:3642268744b111b82e85a0b70f409a7f2ab313fd;origin=https://gitlab.wikimedia.org/repos/data-engineering/gobblin-wmf-deprecated.git;lines=91-93/
3fad61e344a663a5700c909fb5593c02a7baceb5
gobblin-wmf-deprecated
analytics
gobblin-wmf-core/src/test/java/org/wikimedia/gobblin/writer/TestTimestampedStringRecordWriter.java
TestTimestampedStringRecordWriter::makeTR(String payload)
function
private TimestampedRecord<String> makeTR(String payload) { return new TimestampedRecord<>(payload, Optional.empty()); }
2,472
fe5c2644cbfd266221a3881b57cc23a2
swh:1:cnt:3642268744b111b82e85a0b70f409a7f2ab313fd;origin=https://gitlab.wikimedia.org/repos/data-engineering/gobblin-wmf-deprecated.git;lines=143-161/
3fad61e344a663a5700c909fb5593c02a7baceb5
gobblin-wmf-deprecated
analytics
gobblin-wmf-core/src/test/java/org/wikimedia/gobblin/writer/TestTimestampedStringRecordWriter.java
TestTimestampedStringRecordWriter::testSupportsGzip()
function
@Test public void testSupportsGzip() throws IOException { properties.setProp(ConfigurationKeys.WRITER_CODEC_TYPE, "gz"); String toWrite = "abcd"; TimestampedRecordWriterWrapper writer = buildTimestampedRecordDataWriter(); writer.write(makeTR(toWrite)); writer.close(); ...
2,473
069c18e74752f03e27b5dd13594619f1
swh:1:cnt:3642268744b111b82e85a0b70f409a7f2ab313fd;origin=https://gitlab.wikimedia.org/repos/data-engineering/gobblin-wmf-deprecated.git;lines=285-292/
3fad61e344a663a5700c909fb5593c02a7baceb5
gobblin-wmf-deprecated
analytics
gobblin-wmf-core/src/test/java/org/wikimedia/gobblin/writer/TestTimestampedStringRecordWriter.java
TestTimestampedStringRecordWriter::tearDown()
function
@AfterMethod public void tearDown() throws IOException { // Clean up the staging and/or output directories if necessary File testRootDir = new File(TestConstants.TEST_ROOT_DIR); if (testRootDir.exists()) { FileUtil.fullyDelete(testRootDir); } }
2,474
8341cdab981fa7d72bf6ce458d4461e2
swh:1:cnt:3642268744b111b82e85a0b70f409a7f2ab313fd;origin=https://gitlab.wikimedia.org/repos/data-engineering/gobblin-wmf-deprecated.git;lines=193-226/
3fad61e344a663a5700c909fb5593c02a7baceb5
gobblin-wmf-deprecated
analytics
gobblin-wmf-core/src/test/java/org/wikimedia/gobblin/writer/TestTimestampedStringRecordWriter.java
TestTimestampedStringRecordWriter::testWrite()
function
/** * Use the writer to write json entries to a file and ensure that * they are the same when read back. * * @throws IOException */ @Test public void testWrite() throws IOException { TimestampedRecordWriterWrapper writer = buildTimestampedRecordDataWriter(); int totalByt...
2,475
7fe8a703c42191bbd7c7754270d2d447
swh:1:cnt:3642268744b111b82e85a0b70f409a7f2ab313fd;origin=https://gitlab.wikimedia.org/repos/data-engineering/gobblin-wmf-deprecated.git;lines=228-236/
3fad61e344a663a5700c909fb5593c02a7baceb5
gobblin-wmf-deprecated
analytics
gobblin-wmf-core/src/test/java/org/wikimedia/gobblin/writer/TestTimestampedStringRecordWriter.java
TestTimestampedStringRecordWriter::buildTimestampedRecordDataWriter()
function
private TimestampedRecordWriterWrapper<String> buildTimestampedRecordDataWriter() throws IOException { SimpleStringWriterBuilder builder = (SimpleStringWriterBuilder)new SimpleStringWriterBuilder() .writeTo(Destination.of(Destination.DestinationType.HDFS, properties)).writeInFormat(...
2,476
87a8bc44e544e857b6c816a0dd95243d
swh:1:cnt:ce4cf0f8c889a1f9c69e5d0d3f3272765f548dbb;origin=https://gitlab.wikimedia.org/repos/data-engineering/gobblin-wmf-deprecated.git;lines=41-163/
4b8915572a3f05dfa0da6bd2021adbbe9619d8dc
gobblin-wmf-deprecated
analytics
gobblin-wmf-core/src/test/java/org/wikimedia/gobblin/writer/partitioner/TestJsonStringTimeBasedWriterPartitioner.java
TestJsonStringTimeBasedWriterPartitioner
type
/** * Tests for {@link JsonStringTimeBasedWriterPartitioner}. * Copied and updated from gobblin-core:org.apache.gobblin.writer.partitioner.TimeBasedAvroWriterPartitionerTest */ @Test public class TestJsonStringTimeBasedWriterPartitioner { private static final String SIMPLE_CLASS_NAME = TestJsonStringTimeBasedWr...
2,477
be03ca355c29947932872f40ba041aab
swh:1:cnt:ce4cf0f8c889a1f9c69e5d0d3f3272765f548dbb;origin=https://gitlab.wikimedia.org/repos/data-engineering/gobblin-wmf-deprecated.git;lines=77-129/
4b8915572a3f05dfa0da6bd2021adbbe9619d8dc
gobblin-wmf-deprecated
analytics
gobblin-wmf-core/src/test/java/org/wikimedia/gobblin/writer/partitioner/TestJsonStringTimeBasedWriterPartitioner.java
TestJsonStringTimeBasedWriterPartitioner::testWriter()
function
/** * Test * 1. Record timestamp of type long * 2. Partition path of a given record */ @Test public void testWriter() throws IOException { State state = getBasicState(); // Write three records, each should be written to a different file DataWriter<Object> millisPar...
2,478
8d040f49c7a660334cac7b888e9d046e
swh:1:cnt:ce4cf0f8c889a1f9c69e5d0d3f3272765f548dbb;origin=https://gitlab.wikimedia.org/repos/data-engineering/gobblin-wmf-deprecated.git;lines=131-134/
4b8915572a3f05dfa0da6bd2021adbbe9619d8dc
gobblin-wmf-deprecated
analytics
gobblin-wmf-core/src/test/java/org/wikimedia/gobblin/writer/partitioner/TestJsonStringTimeBasedWriterPartitioner.java
TestJsonStringTimeBasedWriterPartitioner::tearDown()
function
@AfterClass public void tearDown() throws IOException { FileUtils.deleteDirectory(new File(TEST_ROOT_DIR)); }
2,479
93d789e2d8b5666babe128c4143c7ba2
swh:1:cnt:ce4cf0f8c889a1f9c69e5d0d3f3272765f548dbb;origin=https://gitlab.wikimedia.org/repos/data-engineering/gobblin-wmf-deprecated.git;lines=136-143/
4b8915572a3f05dfa0da6bd2021adbbe9619d8dc
gobblin-wmf-deprecated
analytics
gobblin-wmf-core/src/test/java/org/wikimedia/gobblin/writer/partitioner/TestJsonStringTimeBasedWriterPartitioner.java
TestJsonStringTimeBasedWriterPartitioner::getWriter(State state)
function
private DataWriter<Object> getWriter(State state) throws IOException { // Build a writer to write test records DataWriterBuilder<String, Object> builder = new SimpleStringWriterBuilder() .writeTo(Destination.of(Destination.DestinationType.HDFS, state)).writeInFormat(WriterOut...
2,480
10389996b1320dd18c0a07430d3f120a
swh:1:cnt:ce4cf0f8c889a1f9c69e5d0d3f3272765f548dbb;origin=https://gitlab.wikimedia.org/repos/data-engineering/gobblin-wmf-deprecated.git;lines=145-161/
4b8915572a3f05dfa0da6bd2021adbbe9619d8dc
gobblin-wmf-deprecated
analytics
gobblin-wmf-core/src/test/java/org/wikimedia/gobblin/writer/partitioner/TestJsonStringTimeBasedWriterPartitioner.java
TestJsonStringTimeBasedWriterPartitioner::getBasicState()
function
private State getBasicState() { State properties = new State(); properties.setProp(JsonStringTimeBasedWriterPartitioner.TIMESTAMP_COLUMNS_KEY, TIMESTAMP_COLUMN); properties.setProp(JsonStringTimeBasedWriterPartitioner.TIMESTAMP_FORMAT_KEY, TIMESTAMP_FORMAT); properties.setProp(Configura...
2,481
cd1875aa74336b2e58a3d8bc6c5660fc
swh:1:cnt:ce4cf0f8c889a1f9c69e5d0d3f3272765f548dbb;origin=https://gitlab.wikimedia.org/repos/data-engineering/gobblin-wmf-deprecated.git;lines=59-75/
4b8915572a3f05dfa0da6bd2021adbbe9619d8dc
gobblin-wmf-deprecated
analytics
gobblin-wmf-core/src/test/java/org/wikimedia/gobblin/writer/partitioner/TestJsonStringTimeBasedWriterPartitioner.java
TestJsonStringTimeBasedWriterPartitioner::setUp()
function
@BeforeClass public void setUp() throws IOException { File stagingDir = new File(STAGING_DIR); File outputDir = new File(OUTPUT_DIR); if (!stagingDir.exists()) { stagingDir.mkdirs(); } else { FileUtils.deleteDirectory(stagingDir); } if (!outp...
2,482
16689707ab90cd15975c2b957144628a
swh:1:cnt:a911768dd6842257e04073b99c2d029883c5f1c2;origin=https://gitlab.wikimedia.org/repos/data-engineering/gobblin-wmf-deprecated.git;lines=46-174/
6941c7528c6fa95dba769ce8a3321643e02d246b
gobblin-wmf-deprecated
analytics
gobblin-wmf-core/src/test/java/org/wikimedia/gobblin/writer/partitioner/TestTimestampedRecordOrJsonStringTimeBasedWriterPartitioner.java
TestTimestampedRecordOrJsonStringTimeBasedWriterPartitioner
type
/** * Tests for {@link TimestampedRecordOrJsonStringTimeBasedWriterPartitioner}. * Copied and updated from gobblin-core:org.apache.gobblin.writer.partitioner.TimeBasedAvroWriterPartitionerTest */ @Test public class TestTimestampedRecordOrJsonStringTimeBasedWriterPartitioner { private static final String SIMPLE_...
2,483
8d040f49c7a660334cac7b888e9d046e
swh:1:cnt:a911768dd6842257e04073b99c2d029883c5f1c2;origin=https://gitlab.wikimedia.org/repos/data-engineering/gobblin-wmf-deprecated.git;lines=142-145/
6941c7528c6fa95dba769ce8a3321643e02d246b
gobblin-wmf-deprecated
analytics
gobblin-wmf-core/src/test/java/org/wikimedia/gobblin/writer/partitioner/TestTimestampedRecordOrJsonStringTimeBasedWriterPartitioner.java
TestTimestampedRecordOrJsonStringTimeBasedWriterPartitioner::tearDown()
function
@AfterClass public void tearDown() throws IOException { FileUtils.deleteDirectory(new File(TEST_ROOT_DIR)); }
2,484
f6da0035528fbb479837266f2ef0e085
swh:1:cnt:a911768dd6842257e04073b99c2d029883c5f1c2;origin=https://gitlab.wikimedia.org/repos/data-engineering/gobblin-wmf-deprecated.git;lines=82-140/
6941c7528c6fa95dba769ce8a3321643e02d246b
gobblin-wmf-deprecated
analytics
gobblin-wmf-core/src/test/java/org/wikimedia/gobblin/writer/partitioner/TestTimestampedRecordOrJsonStringTimeBasedWriterPartitioner.java
TestTimestampedRecordOrJsonStringTimeBasedWriterPartitioner::testWriter()
function
/** * Test * 1. Record timestamp of type long * 2. Partition path of a given record */ @Test public void testWriter() throws IOException { State state = getBasicState(); // Write three records, each should be written to a different file DataWriter<Object> millisPar...
2,485
aac474de10beb4d71e7a81c67ae31990
swh:1:cnt:a911768dd6842257e04073b99c2d029883c5f1c2;origin=https://gitlab.wikimedia.org/repos/data-engineering/gobblin-wmf-deprecated.git;lines=147-154/
6941c7528c6fa95dba769ce8a3321643e02d246b
gobblin-wmf-deprecated
analytics
gobblin-wmf-core/src/test/java/org/wikimedia/gobblin/writer/partitioner/TestTimestampedRecordOrJsonStringTimeBasedWriterPartitioner.java
TestTimestampedRecordOrJsonStringTimeBasedWriterPartitioner::getWriter(State state)
function
private DataWriter<Object> getWriter(State state) throws IOException { // Build a writer to write test records DataWriterBuilder<String, Object> builder = new TimestampedStringRecordDataWriterBuilder() .writeTo(Destination.of(Destination.DestinationType.HDFS, state)).writeInF...
2,486
906b4869f24271a6c9bcfc725318c9e1
swh:1:cnt:a911768dd6842257e04073b99c2d029883c5f1c2;origin=https://gitlab.wikimedia.org/repos/data-engineering/gobblin-wmf-deprecated.git;lines=156-172/
6941c7528c6fa95dba769ce8a3321643e02d246b
gobblin-wmf-deprecated
analytics
gobblin-wmf-core/src/test/java/org/wikimedia/gobblin/writer/partitioner/TestTimestampedRecordOrJsonStringTimeBasedWriterPartitioner.java
TestTimestampedRecordOrJsonStringTimeBasedWriterPartitioner::getBasicState()
function
private State getBasicState() { State properties = new State(); properties.setProp(JsonStringTimeBasedWriterPartitioner.TIMESTAMP_COLUMNS_KEY, TIMESTAMP_COLUMN); properties.setProp(JsonStringTimeBasedWriterPartitioner.TIMESTAMP_FORMAT_KEY, TIMESTAMP_FORMAT); properties.setProp(Configura...
2,487
cd1875aa74336b2e58a3d8bc6c5660fc
swh:1:cnt:a911768dd6842257e04073b99c2d029883c5f1c2;origin=https://gitlab.wikimedia.org/repos/data-engineering/gobblin-wmf-deprecated.git;lines=64-80/
6941c7528c6fa95dba769ce8a3321643e02d246b
gobblin-wmf-deprecated
analytics
gobblin-wmf-core/src/test/java/org/wikimedia/gobblin/writer/partitioner/TestTimestampedRecordOrJsonStringTimeBasedWriterPartitioner.java
TestTimestampedRecordOrJsonStringTimeBasedWriterPartitioner::setUp()
function
@BeforeClass public void setUp() throws IOException { File stagingDir = new File(STAGING_DIR); File outputDir = new File(OUTPUT_DIR); if (!stagingDir.exists()) { stagingDir.mkdirs(); } else { FileUtils.deleteDirectory(stagingDir); } if (!outp...
2,488
325d0ff9c6e7fda88c826397d2b56022
swh:1:cnt:17bf3429fd20ce7ac360340f55db31ef58a16682;origin=https://gitlab.wikimedia.org/repos/data-engineering/gobblin-wmf-deprecated.git;lines=46-168/
da7180999fb8ea6155531427d7e167ed69e36bbc
gobblin-wmf-deprecated
analytics
gobblin-wmf-core/src/test/java/org/wikimedia/gobblin/writer/partitioner/TestTimestampedRecordTimeBasedWriterPartitioner.java
TestTimestampedRecordTimeBasedWriterPartitioner
type
/** * Tests for {@link TimestampedRecordTimeBasedWriterPartitioner}. * Copied and updated from gobblin-core:org.apache.gobblin.writer.partitioner.TimeBasedAvroWriterPartitionerTest */ @Test public class TestTimestampedRecordTimeBasedWriterPartitioner { private static final String SIMPLE_CLASS_NAME = TestTimesta...
2,489
737ba9f9f2504bba430d4d32d5a75f12
swh:1:cnt:17bf3429fd20ce7ac360340f55db31ef58a16682;origin=https://gitlab.wikimedia.org/repos/data-engineering/gobblin-wmf-deprecated.git;lines=80-136/
da7180999fb8ea6155531427d7e167ed69e36bbc
gobblin-wmf-deprecated
analytics
gobblin-wmf-core/src/test/java/org/wikimedia/gobblin/writer/partitioner/TestTimestampedRecordTimeBasedWriterPartitioner.java
TestTimestampedRecordTimeBasedWriterPartitioner::testWriter()
function
/** * Test * 1. Record timestamp of type long * 2. Partition path of a given record */ @Test public void testWriter() throws IOException { State state = getBasicState(); // Write three records, each should be written to a different file DataWriter<Object> millisPar...
2,490
8d040f49c7a660334cac7b888e9d046e
swh:1:cnt:17bf3429fd20ce7ac360340f55db31ef58a16682;origin=https://gitlab.wikimedia.org/repos/data-engineering/gobblin-wmf-deprecated.git;lines=138-141/
da7180999fb8ea6155531427d7e167ed69e36bbc
gobblin-wmf-deprecated
analytics
gobblin-wmf-core/src/test/java/org/wikimedia/gobblin/writer/partitioner/TestTimestampedRecordTimeBasedWriterPartitioner.java
TestTimestampedRecordTimeBasedWriterPartitioner::tearDown()
function
@AfterClass public void tearDown() throws IOException { FileUtils.deleteDirectory(new File(TEST_ROOT_DIR)); }
2,491
aac474de10beb4d71e7a81c67ae31990
swh:1:cnt:17bf3429fd20ce7ac360340f55db31ef58a16682;origin=https://gitlab.wikimedia.org/repos/data-engineering/gobblin-wmf-deprecated.git;lines=143-150/
da7180999fb8ea6155531427d7e167ed69e36bbc
gobblin-wmf-deprecated
analytics
gobblin-wmf-core/src/test/java/org/wikimedia/gobblin/writer/partitioner/TestTimestampedRecordTimeBasedWriterPartitioner.java
TestTimestampedRecordTimeBasedWriterPartitioner::getWriter(State state)
function
private DataWriter<Object> getWriter(State state) throws IOException { // Build a writer to write test records DataWriterBuilder<String, Object> builder = new TimestampedStringRecordDataWriterBuilder() .writeTo(Destination.of(Destination.DestinationType.HDFS, state)).writeInF...
2,492
4bf6a0853cff4eff74faf73a69d05d9f
swh:1:cnt:17bf3429fd20ce7ac360340f55db31ef58a16682;origin=https://gitlab.wikimedia.org/repos/data-engineering/gobblin-wmf-deprecated.git;lines=152-166/
da7180999fb8ea6155531427d7e167ed69e36bbc
gobblin-wmf-deprecated
analytics
gobblin-wmf-core/src/test/java/org/wikimedia/gobblin/writer/partitioner/TestTimestampedRecordTimeBasedWriterPartitioner.java
TestTimestampedRecordTimeBasedWriterPartitioner::getBasicState()
function
private State getBasicState() { State properties = new State(); properties.setProp(ConfigurationKeys.SIMPLE_WRITER_DELIMITER, "\n"); properties.setProp(ConfigurationKeys.WRITER_BUFFER_SIZE, ConfigurationKeys.DEFAULT_BUFFER_SIZE); properties.setProp(ConfigurationKeys.WRITER_FILE_SYSTEM_U...
2,493
cd1875aa74336b2e58a3d8bc6c5660fc
swh:1:cnt:17bf3429fd20ce7ac360340f55db31ef58a16682;origin=https://gitlab.wikimedia.org/repos/data-engineering/gobblin-wmf-deprecated.git;lines=62-78/
da7180999fb8ea6155531427d7e167ed69e36bbc
gobblin-wmf-deprecated
analytics
gobblin-wmf-core/src/test/java/org/wikimedia/gobblin/writer/partitioner/TestTimestampedRecordTimeBasedWriterPartitioner.java
TestTimestampedRecordTimeBasedWriterPartitioner::setUp()
function
@BeforeClass public void setUp() throws IOException { File stagingDir = new File(STAGING_DIR); File outputDir = new File(OUTPUT_DIR); if (!stagingDir.exists()) { stagingDir.mkdirs(); } else { FileUtils.deleteDirectory(stagingDir); } if (!outp...
2,494
af7657b82ff1586bbaab8f69ac64c9a3
swh:1:cnt:8f4e3e3c95f2bd078a6d2319969a8a247ff45ede;origin=https://gitlab.wikimedia.org/repos/data-engineering/spark8s.git;lines=36-85/
6450c2816ff0628424401c9e8877aa4723f1dc79
spark8s
analytics
spark-delegation-token/src/main/java/org/wikimedia/kubernetes/hadoop/security/CredentialHelper.java
CredentialHelper
type
public class CredentialHelper { private final Logger logger = LoggerFactory.getLogger(getClass()); private static final String HIVE_DELEGATION_TOKEN_SERVICE_NAME = "DelegationTokenForHiveMetaStoreServer"; private final Configuration conf = new HdfsConfiguration(); private final Path tokenFilePath; p...
2,495
e1d92f4b2a964d1f2586652738dc1bc8
swh:1:cnt:8f4e3e3c95f2bd078a6d2319969a8a247ff45ede;origin=https://gitlab.wikimedia.org/repos/data-engineering/spark8s.git;lines=52-62/
6450c2816ff0628424401c9e8877aa4723f1dc79
spark8s
analytics
spark-delegation-token/src/main/java/org/wikimedia/kubernetes/hadoop/security/CredentialHelper.java
CredentialHelper::addHdfsCredentials()
function
private void addHdfsCredentials() throws IOException { logger.info("Add hdfs token to current user {}", this.user.getShortUserName()); Credentials cred = new Credentials(); FileSystem fs = FileSystem.get(this.conf); fs.addDelegationTokens(this.user.getUserName(), cred); fs.clos...
2,496
fb3a5df67cf11ad6d8959f569b0cf21a
swh:1:cnt:8f4e3e3c95f2bd078a6d2319969a8a247ff45ede;origin=https://gitlab.wikimedia.org/repos/data-engineering/spark8s.git;lines=76-79/
6450c2816ff0628424401c9e8877aa4723f1dc79
spark8s
analytics
spark-delegation-token/src/main/java/org/wikimedia/kubernetes/hadoop/security/CredentialHelper.java
CredentialHelper::addHadoopCredentials()
function
public void addHadoopCredentials() throws IOException, HiveException { this.addHdfsCredentials(); this.addHiveCredentials(); }
2,497
d22f0f444999c5508fb0726c8a753b72
swh:1:cnt:8f4e3e3c95f2bd078a6d2319969a8a247ff45ede;origin=https://gitlab.wikimedia.org/repos/data-engineering/spark8s.git;lines=64-74/
6450c2816ff0628424401c9e8877aa4723f1dc79
spark8s
analytics
spark-delegation-token/src/main/java/org/wikimedia/kubernetes/hadoop/security/CredentialHelper.java
CredentialHelper::addHiveCredentials()
function
private void addHiveCredentials() throws IOException, HiveException { logger.info("Add hive token to current user {}", this.user.getShortUserName()); HiveConf hiveConf = new HiveConf(); org.apache.hadoop.hive.ql.metadata.Hive hive = org.apache.hadoop.hive.ql.metadata.Hive.get(hiveConf); ...
2,498
4a7bc7ab20abfbe973348939cf6c5d1b
swh:1:cnt:8f4e3e3c95f2bd078a6d2319969a8a247ff45ede;origin=https://gitlab.wikimedia.org/repos/data-engineering/spark8s.git;lines=81-84/
6450c2816ff0628424401c9e8877aa4723f1dc79
spark8s
analytics
spark-delegation-token/src/main/java/org/wikimedia/kubernetes/hadoop/security/CredentialHelper.java
CredentialHelper::writeTokenStorageFile()
function
public void writeTokenStorageFile() throws IOException { logger.info("Write Hadoop Delegation Tokens to credential file {}", this.tokenFilePath.toUri()); this.user.getCredentials().writeTokenStorageFile(this.tokenFilePath, this.conf); }
2,499
8e36db3b3dbe27872c4471f001ebf49c
swh:1:cnt:d46bbf6d5f81a9adad2b2e82032fd2dd4c0cf35c;origin=https://gitlab.wikimedia.org/repos/data-engineering/spark8s.git;lines=27-47/
32fbaa798e321340bd4d9473b05ea16a47eee6a2
spark8s
analytics
spark-delegation-token/src/main/java/org/wikimedia/kubernetes/hadoop/security/Main.java
Main
type
public class Main { private static final Logger logger = LoggerFactory.getLogger(Main.class); public static void main(String[] args) throws IOException, InterruptedException { if (args.length == 0) { logger.error("Proper Usage is: java -cp spark-delegation-token.jar:<hadoop classpath>:<hive...