id int32 0 165k | repo stringlengths 7 58 | path stringlengths 12 218 | func_name stringlengths 3 140 | original_string stringlengths 73 34.1k | language stringclasses 1
value | code stringlengths 73 34.1k | code_tokens list | docstring stringlengths 3 16k | docstring_tokens list | sha stringlengths 40 40 | url stringlengths 105 339 |
|---|---|---|---|---|---|---|---|---|---|---|---|
26,000 | apache/incubator-gobblin | gobblin-core-base/src/main/java/org/apache/gobblin/instrumented/converter/InstrumentedConverterBase.java | InstrumentedConverterBase.beforeConvert | public void beforeConvert(SO outputSchema, DI inputRecord, WorkUnitState workUnit) {
Instrumented.markMeter(this.recordsInMeter);
} | java | public void beforeConvert(SO outputSchema, DI inputRecord, WorkUnitState workUnit) {
Instrumented.markMeter(this.recordsInMeter);
} | [
"public",
"void",
"beforeConvert",
"(",
"SO",
"outputSchema",
",",
"DI",
"inputRecord",
",",
"WorkUnitState",
"workUnit",
")",
"{",
"Instrumented",
".",
"markMeter",
"(",
"this",
".",
"recordsInMeter",
")",
";",
"}"
] | Called before conversion.
@param outputSchema output schema of the {@link #convertSchema(Object, WorkUnitState)} method
@param inputRecord an input data record
@param workUnit a {@link WorkUnitState} instance | [
"Called",
"before",
"conversion",
"."
] | f029b4c0fea0fe4aa62f36dda2512344ff708bae | https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-core-base/src/main/java/org/apache/gobblin/instrumented/converter/InstrumentedConverterBase.java#L147-L149 |
26,001 | apache/incubator-gobblin | gobblin-core-base/src/main/java/org/apache/gobblin/instrumented/converter/InstrumentedConverterBase.java | InstrumentedConverterBase.afterConvert | public void afterConvert(Iterable<DO> iterable, long startTimeNanos) {
Instrumented.updateTimer(this.converterTimer, System.nanoTime() - startTimeNanos, TimeUnit.NANOSECONDS);
} | java | public void afterConvert(Iterable<DO> iterable, long startTimeNanos) {
Instrumented.updateTimer(this.converterTimer, System.nanoTime() - startTimeNanos, TimeUnit.NANOSECONDS);
} | [
"public",
"void",
"afterConvert",
"(",
"Iterable",
"<",
"DO",
">",
"iterable",
",",
"long",
"startTimeNanos",
")",
"{",
"Instrumented",
".",
"updateTimer",
"(",
"this",
".",
"converterTimer",
",",
"System",
".",
"nanoTime",
"(",
")",
"-",
"startTimeNanos",
"... | Called after conversion.
@param iterable conversion result.
@param startTimeNanos start time of conversion. | [
"Called",
"after",
"conversion",
"."
] | f029b4c0fea0fe4aa62f36dda2512344ff708bae | https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-core-base/src/main/java/org/apache/gobblin/instrumented/converter/InstrumentedConverterBase.java#L156-L158 |
26,002 | apache/incubator-gobblin | gobblin-restli/gobblin-throttling-service/gobblin-throttling-service-client/src/main/java/org/apache/gobblin/util/limiter/RestClientRequestSender.java | RestClientRequestSender.decorateCallback | protected Callback<Response<PermitAllocation>> decorateCallback(PermitRequest request,
Callback<Response<PermitAllocation>> callback) {
return callback;
} | java | protected Callback<Response<PermitAllocation>> decorateCallback(PermitRequest request,
Callback<Response<PermitAllocation>> callback) {
return callback;
} | [
"protected",
"Callback",
"<",
"Response",
"<",
"PermitAllocation",
">",
">",
"decorateCallback",
"(",
"PermitRequest",
"request",
",",
"Callback",
"<",
"Response",
"<",
"PermitAllocation",
">",
">",
"callback",
")",
"{",
"return",
"callback",
";",
"}"
] | Decorate the callback to intercept some responses. | [
"Decorate",
"the",
"callback",
"to",
"intercept",
"some",
"responses",
"."
] | f029b4c0fea0fe4aa62f36dda2512344ff708bae | https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-restli/gobblin-throttling-service/gobblin-throttling-service-client/src/main/java/org/apache/gobblin/util/limiter/RestClientRequestSender.java#L51-L54 |
26,003 | apache/incubator-gobblin | gobblin-utility/src/main/java/org/apache/gobblin/util/DatasetFilterUtils.java | DatasetFilterUtils.getPatternsFromStrings | public static List<Pattern> getPatternsFromStrings(List<String> strings) {
List<Pattern> patterns = Lists.newArrayList();
for (String s : strings) {
patterns.add(Pattern.compile(s));
}
return patterns;
} | java | public static List<Pattern> getPatternsFromStrings(List<String> strings) {
List<Pattern> patterns = Lists.newArrayList();
for (String s : strings) {
patterns.add(Pattern.compile(s));
}
return patterns;
} | [
"public",
"static",
"List",
"<",
"Pattern",
">",
"getPatternsFromStrings",
"(",
"List",
"<",
"String",
">",
"strings",
")",
"{",
"List",
"<",
"Pattern",
">",
"patterns",
"=",
"Lists",
".",
"newArrayList",
"(",
")",
";",
"for",
"(",
"String",
"s",
":",
... | Convert a list of Strings to a list of Patterns. | [
"Convert",
"a",
"list",
"of",
"Strings",
"to",
"a",
"list",
"of",
"Patterns",
"."
] | f029b4c0fea0fe4aa62f36dda2512344ff708bae | https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-utility/src/main/java/org/apache/gobblin/util/DatasetFilterUtils.java#L49-L55 |
26,004 | apache/incubator-gobblin | gobblin-utility/src/main/java/org/apache/gobblin/util/DatasetFilterUtils.java | DatasetFilterUtils.stringInPatterns | public static boolean stringInPatterns(String s, List<Pattern> patterns) {
for (Pattern pattern : patterns) {
if (pattern.matcher(s).matches()) {
return true;
}
}
return false;
} | java | public static boolean stringInPatterns(String s, List<Pattern> patterns) {
for (Pattern pattern : patterns) {
if (pattern.matcher(s).matches()) {
return true;
}
}
return false;
} | [
"public",
"static",
"boolean",
"stringInPatterns",
"(",
"String",
"s",
",",
"List",
"<",
"Pattern",
">",
"patterns",
")",
"{",
"for",
"(",
"Pattern",
"pattern",
":",
"patterns",
")",
"{",
"if",
"(",
"pattern",
".",
"matcher",
"(",
"s",
")",
".",
"match... | Determines whether a string matches one of the regex patterns. | [
"Determines",
"whether",
"a",
"string",
"matches",
"one",
"of",
"the",
"regex",
"patterns",
"."
] | f029b4c0fea0fe4aa62f36dda2512344ff708bae | https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-utility/src/main/java/org/apache/gobblin/util/DatasetFilterUtils.java#L92-L99 |
26,005 | apache/incubator-gobblin | gobblin-modules/gobblin-compliance/src/main/java/org/apache/gobblin/compliance/HivePartitionFinder.java | HivePartitionFinder.findDatasets | @Override
public List<HivePartitionDataset> findDatasets()
throws IOException {
List<HivePartitionDataset> list = new ArrayList<>();
for (HiveDataset hiveDataset : this.hiveDatasets) {
for (Partition partition : hiveDataset.getPartitionsFromDataset()) {
list.add(new HivePartitionDataset(pa... | java | @Override
public List<HivePartitionDataset> findDatasets()
throws IOException {
List<HivePartitionDataset> list = new ArrayList<>();
for (HiveDataset hiveDataset : this.hiveDatasets) {
for (Partition partition : hiveDataset.getPartitionsFromDataset()) {
list.add(new HivePartitionDataset(pa... | [
"@",
"Override",
"public",
"List",
"<",
"HivePartitionDataset",
">",
"findDatasets",
"(",
")",
"throws",
"IOException",
"{",
"List",
"<",
"HivePartitionDataset",
">",
"list",
"=",
"new",
"ArrayList",
"<>",
"(",
")",
";",
"for",
"(",
"HiveDataset",
"hiveDataset... | Will find all datasets according to whitelist, except the backup, trash and staging tables. | [
"Will",
"find",
"all",
"datasets",
"according",
"to",
"whitelist",
"except",
"the",
"backup",
"trash",
"and",
"staging",
"tables",
"."
] | f029b4c0fea0fe4aa62f36dda2512344ff708bae | https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-modules/gobblin-compliance/src/main/java/org/apache/gobblin/compliance/HivePartitionFinder.java#L82-L96 |
26,006 | apache/incubator-gobblin | gobblin-service/src/main/java/org/apache/gobblin/service/modules/flowgraph/Dag.java | Dag.build | private void build() {
this.startNodes = new ArrayList<>();
this.endNodes = new ArrayList<>();
this.parentChildMap = new HashMap<>();
for (DagNode node : this.nodes) {
//If a Node has no parent Node, add it to the list of start Nodes
if (node.getParentNodes() == null) {
this.startNod... | java | private void build() {
this.startNodes = new ArrayList<>();
this.endNodes = new ArrayList<>();
this.parentChildMap = new HashMap<>();
for (DagNode node : this.nodes) {
//If a Node has no parent Node, add it to the list of start Nodes
if (node.getParentNodes() == null) {
this.startNod... | [
"private",
"void",
"build",
"(",
")",
"{",
"this",
".",
"startNodes",
"=",
"new",
"ArrayList",
"<>",
"(",
")",
";",
"this",
".",
"endNodes",
"=",
"new",
"ArrayList",
"<>",
"(",
")",
";",
"this",
".",
"parentChildMap",
"=",
"new",
"HashMap",
"<>",
"("... | Constructs the dag from the Node list. | [
"Constructs",
"the",
"dag",
"from",
"the",
"Node",
"list",
"."
] | f029b4c0fea0fe4aa62f36dda2512344ff708bae | https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-service/src/main/java/org/apache/gobblin/service/modules/flowgraph/Dag.java#L59-L84 |
26,007 | apache/incubator-gobblin | gobblin-modules/gobblin-crypto/src/main/java/org/apache/gobblin/crypto/GPGFileDecryptor.java | GPGFileDecryptor.decryptFile | public InputStream decryptFile(InputStream inputStream, String passPhrase) throws IOException {
PGPEncryptedDataList enc = getPGPEncryptedDataList(inputStream);
PGPPBEEncryptedData pbe = (PGPPBEEncryptedData) enc.get(0);
InputStream clear;
try {
clear = pbe.getDataStream(new JcePBEDataDecryptorF... | java | public InputStream decryptFile(InputStream inputStream, String passPhrase) throws IOException {
PGPEncryptedDataList enc = getPGPEncryptedDataList(inputStream);
PGPPBEEncryptedData pbe = (PGPPBEEncryptedData) enc.get(0);
InputStream clear;
try {
clear = pbe.getDataStream(new JcePBEDataDecryptorF... | [
"public",
"InputStream",
"decryptFile",
"(",
"InputStream",
"inputStream",
",",
"String",
"passPhrase",
")",
"throws",
"IOException",
"{",
"PGPEncryptedDataList",
"enc",
"=",
"getPGPEncryptedDataList",
"(",
"inputStream",
")",
";",
"PGPPBEEncryptedData",
"pbe",
"=",
"... | Taking in a file inputstream and a passPhrase, generate a decrypted file inputstream.
@param inputStream file inputstream
@param passPhrase passPhrase
@return
@throws IOException | [
"Taking",
"in",
"a",
"file",
"inputstream",
"and",
"a",
"passPhrase",
"generate",
"a",
"decrypted",
"file",
"inputstream",
"."
] | f029b4c0fea0fe4aa62f36dda2512344ff708bae | https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-modules/gobblin-crypto/src/main/java/org/apache/gobblin/crypto/GPGFileDecryptor.java#L62-L79 |
26,008 | apache/incubator-gobblin | gobblin-modules/gobblin-crypto/src/main/java/org/apache/gobblin/crypto/GPGFileDecryptor.java | GPGFileDecryptor.decryptFile | public InputStream decryptFile(InputStream inputStream, InputStream keyIn, String passPhrase)
throws IOException {
try {
PGPEncryptedDataList enc = getPGPEncryptedDataList(inputStream);
Iterator it = enc.getEncryptedDataObjects();
PGPPrivateKey sKey = null;
PGPPublicKeyEncryptedData pb... | java | public InputStream decryptFile(InputStream inputStream, InputStream keyIn, String passPhrase)
throws IOException {
try {
PGPEncryptedDataList enc = getPGPEncryptedDataList(inputStream);
Iterator it = enc.getEncryptedDataObjects();
PGPPrivateKey sKey = null;
PGPPublicKeyEncryptedData pb... | [
"public",
"InputStream",
"decryptFile",
"(",
"InputStream",
"inputStream",
",",
"InputStream",
"keyIn",
",",
"String",
"passPhrase",
")",
"throws",
"IOException",
"{",
"try",
"{",
"PGPEncryptedDataList",
"enc",
"=",
"getPGPEncryptedDataList",
"(",
"inputStream",
")",
... | Taking in a file inputstream, keyring inputstream and a passPhrase, generate a decrypted file inputstream.
@param inputStream file inputstream
@param keyIn keyring inputstream. This InputStream is owned by the caller.
@param passPhrase passPhrase
@return an {@link InputStream} for the decrypted content
@throws IOExcept... | [
"Taking",
"in",
"a",
"file",
"inputstream",
"keyring",
"inputstream",
"and",
"a",
"passPhrase",
"generate",
"a",
"decrypted",
"file",
"inputstream",
"."
] | f029b4c0fea0fe4aa62f36dda2512344ff708bae | https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-modules/gobblin-crypto/src/main/java/org/apache/gobblin/crypto/GPGFileDecryptor.java#L89-L115 |
26,009 | apache/incubator-gobblin | gobblin-modules/gobblin-crypto/src/main/java/org/apache/gobblin/crypto/GPGFileDecryptor.java | GPGFileDecryptor.findSecretKey | private PGPPrivateKey findSecretKey(PGPSecretKeyRingCollection pgpSec, long keyID, String passPhrase)
throws PGPException {
PGPSecretKey pgpSecKey = pgpSec.getSecretKey(keyID);
if (pgpSecKey == null) {
return null;
}
return pgpSecKey.extractPrivateKey(
new JcePBESecretKeyDecryptorBu... | java | private PGPPrivateKey findSecretKey(PGPSecretKeyRingCollection pgpSec, long keyID, String passPhrase)
throws PGPException {
PGPSecretKey pgpSecKey = pgpSec.getSecretKey(keyID);
if (pgpSecKey == null) {
return null;
}
return pgpSecKey.extractPrivateKey(
new JcePBESecretKeyDecryptorBu... | [
"private",
"PGPPrivateKey",
"findSecretKey",
"(",
"PGPSecretKeyRingCollection",
"pgpSec",
",",
"long",
"keyID",
",",
"String",
"passPhrase",
")",
"throws",
"PGPException",
"{",
"PGPSecretKey",
"pgpSecKey",
"=",
"pgpSec",
".",
"getSecretKey",
"(",
"keyID",
")",
";",
... | Private util function that finds the private key from keyring collection based on keyId and passPhrase
@param pgpSec keyring collection
@param keyID keyID for this encryption file
@param passPhrase passPhrase for this encryption file
@throws PGPException | [
"Private",
"util",
"function",
"that",
"finds",
"the",
"private",
"key",
"from",
"keyring",
"collection",
"based",
"on",
"keyId",
"and",
"passPhrase"
] | f029b4c0fea0fe4aa62f36dda2512344ff708bae | https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-modules/gobblin-crypto/src/main/java/org/apache/gobblin/crypto/GPGFileDecryptor.java#L124-L134 |
26,010 | apache/incubator-gobblin | gobblin-modules/gobblin-crypto/src/main/java/org/apache/gobblin/crypto/GPGFileDecryptor.java | GPGFileDecryptor.getPGPEncryptedDataList | private PGPEncryptedDataList getPGPEncryptedDataList(InputStream inputStream) throws IOException {
if (Security.getProvider(BouncyCastleProvider.PROVIDER_NAME) == null) {
Security.addProvider(new BouncyCastleProvider());
}
inputStream = PGPUtil.getDecoderStream(inputStream);
JcaPGPObjectFactory ... | java | private PGPEncryptedDataList getPGPEncryptedDataList(InputStream inputStream) throws IOException {
if (Security.getProvider(BouncyCastleProvider.PROVIDER_NAME) == null) {
Security.addProvider(new BouncyCastleProvider());
}
inputStream = PGPUtil.getDecoderStream(inputStream);
JcaPGPObjectFactory ... | [
"private",
"PGPEncryptedDataList",
"getPGPEncryptedDataList",
"(",
"InputStream",
"inputStream",
")",
"throws",
"IOException",
"{",
"if",
"(",
"Security",
".",
"getProvider",
"(",
"BouncyCastleProvider",
".",
"PROVIDER_NAME",
")",
"==",
"null",
")",
"{",
"Security",
... | Generate a PGPEncryptedDataList from an inputstream
@param inputStream file inputstream that needs to be decrypted
@throws IOException | [
"Generate",
"a",
"PGPEncryptedDataList",
"from",
"an",
"inputstream"
] | f029b4c0fea0fe4aa62f36dda2512344ff708bae | https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-modules/gobblin-crypto/src/main/java/org/apache/gobblin/crypto/GPGFileDecryptor.java#L141-L158 |
26,011 | apache/incubator-gobblin | gobblin-core/src/main/java/org/apache/gobblin/source/extractor/filebased/CsvFileDownloader.java | CsvFileDownloader.downloadFile | @SuppressWarnings("unchecked")
@Override
public Iterator<String[]> downloadFile(String file) throws IOException {
log.info("Beginning to download file: " + file);
final State state = fileBasedExtractor.workUnitState;
CSVReader reader;
try {
if (state.contains(DELIMITER)) {
String del... | java | @SuppressWarnings("unchecked")
@Override
public Iterator<String[]> downloadFile(String file) throws IOException {
log.info("Beginning to download file: " + file);
final State state = fileBasedExtractor.workUnitState;
CSVReader reader;
try {
if (state.contains(DELIMITER)) {
String del... | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"@",
"Override",
"public",
"Iterator",
"<",
"String",
"[",
"]",
">",
"downloadFile",
"(",
"String",
"file",
")",
"throws",
"IOException",
"{",
"log",
".",
"info",
"(",
"\"Beginning to download file: \"",
"+",
... | Provide iterator via OpenCSV's CSVReader.
Provides a way to skip top rows by providing regex.(This is useful when CSV file comes with comments on top rows, but not in fixed size.
It also provides validation on schema by matching header names between property's schema and header name in CSV file.
{@inheritDoc}
@see org... | [
"Provide",
"iterator",
"via",
"OpenCSV",
"s",
"CSVReader",
".",
"Provides",
"a",
"way",
"to",
"skip",
"top",
"rows",
"by",
"providing",
"regex",
".",
"(",
"This",
"is",
"useful",
"when",
"CSV",
"file",
"comes",
"with",
"comments",
"on",
"top",
"rows",
"b... | f029b4c0fea0fe4aa62f36dda2512344ff708bae | https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-core/src/main/java/org/apache/gobblin/source/extractor/filebased/CsvFileDownloader.java#L57-L111 |
26,012 | apache/incubator-gobblin | gobblin-api/src/main/java/org/apache/gobblin/source/workunit/BasicWorkUnitStream.java | BasicWorkUnitStream.transform | public WorkUnitStream transform(Function<WorkUnit, WorkUnit> function) {
if (this.materializedWorkUnits == null) {
return new BasicWorkUnitStream(this, Iterators.transform(this.workUnits, function), null);
} else {
return new BasicWorkUnitStream(this, null, Lists.newArrayList(Lists.transform(this.ma... | java | public WorkUnitStream transform(Function<WorkUnit, WorkUnit> function) {
if (this.materializedWorkUnits == null) {
return new BasicWorkUnitStream(this, Iterators.transform(this.workUnits, function), null);
} else {
return new BasicWorkUnitStream(this, null, Lists.newArrayList(Lists.transform(this.ma... | [
"public",
"WorkUnitStream",
"transform",
"(",
"Function",
"<",
"WorkUnit",
",",
"WorkUnit",
">",
"function",
")",
"{",
"if",
"(",
"this",
".",
"materializedWorkUnits",
"==",
"null",
")",
"{",
"return",
"new",
"BasicWorkUnitStream",
"(",
"this",
",",
"Iterators... | Apply a transformation function to this stream. | [
"Apply",
"a",
"transformation",
"function",
"to",
"this",
"stream",
"."
] | f029b4c0fea0fe4aa62f36dda2512344ff708bae | https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-api/src/main/java/org/apache/gobblin/source/workunit/BasicWorkUnitStream.java#L81-L87 |
26,013 | apache/incubator-gobblin | gobblin-api/src/main/java/org/apache/gobblin/source/workunit/BasicWorkUnitStream.java | BasicWorkUnitStream.filter | public WorkUnitStream filter(Predicate<WorkUnit> predicate) {
if (this.materializedWorkUnits == null) {
return new BasicWorkUnitStream(this, Iterators.filter(this.workUnits, predicate), null);
} else {
return new BasicWorkUnitStream(this, null, Lists.newArrayList(Iterables.filter(this.materializedWo... | java | public WorkUnitStream filter(Predicate<WorkUnit> predicate) {
if (this.materializedWorkUnits == null) {
return new BasicWorkUnitStream(this, Iterators.filter(this.workUnits, predicate), null);
} else {
return new BasicWorkUnitStream(this, null, Lists.newArrayList(Iterables.filter(this.materializedWo... | [
"public",
"WorkUnitStream",
"filter",
"(",
"Predicate",
"<",
"WorkUnit",
">",
"predicate",
")",
"{",
"if",
"(",
"this",
".",
"materializedWorkUnits",
"==",
"null",
")",
"{",
"return",
"new",
"BasicWorkUnitStream",
"(",
"this",
",",
"Iterators",
".",
"filter",
... | Apply a filtering function to this stream. | [
"Apply",
"a",
"filtering",
"function",
"to",
"this",
"stream",
"."
] | f029b4c0fea0fe4aa62f36dda2512344ff708bae | https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-api/src/main/java/org/apache/gobblin/source/workunit/BasicWorkUnitStream.java#L92-L98 |
26,014 | apache/incubator-gobblin | gobblin-admin/src/main/java/org/apache/gobblin/cli/CliTablePrinter.java | CliTablePrinter.printTable | public void printTable() {
if (this.labels != null) {
System.out.printf(this.rowFormat, this.labels.toArray());
}
for (List<String> row : this.data) {
System.out.printf(this.rowFormat, row.toArray());
}
} | java | public void printTable() {
if (this.labels != null) {
System.out.printf(this.rowFormat, this.labels.toArray());
}
for (List<String> row : this.data) {
System.out.printf(this.rowFormat, row.toArray());
}
} | [
"public",
"void",
"printTable",
"(",
")",
"{",
"if",
"(",
"this",
".",
"labels",
"!=",
"null",
")",
"{",
"System",
".",
"out",
".",
"printf",
"(",
"this",
".",
"rowFormat",
",",
"this",
".",
"labels",
".",
"toArray",
"(",
")",
")",
";",
"}",
"for... | Prints the table of data | [
"Prints",
"the",
"table",
"of",
"data"
] | f029b4c0fea0fe4aa62f36dda2512344ff708bae | https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-admin/src/main/java/org/apache/gobblin/cli/CliTablePrinter.java#L136-L143 |
26,015 | apache/incubator-gobblin | gobblin-admin/src/main/java/org/apache/gobblin/cli/CliTablePrinter.java | CliTablePrinter.getColumnMaxWidths | private List<Integer> getColumnMaxWidths() {
int numCols = data.get(0).size();
int[] widths = new int[numCols];
if (this.labels != null) {
for (int i=0; i<numCols; i++) {
widths[i] = this.labels.get(i).length();
}
}
for (List<String> row : this.data) {
for (int i=0;i<row.... | java | private List<Integer> getColumnMaxWidths() {
int numCols = data.get(0).size();
int[] widths = new int[numCols];
if (this.labels != null) {
for (int i=0; i<numCols; i++) {
widths[i] = this.labels.get(i).length();
}
}
for (List<String> row : this.data) {
for (int i=0;i<row.... | [
"private",
"List",
"<",
"Integer",
">",
"getColumnMaxWidths",
"(",
")",
"{",
"int",
"numCols",
"=",
"data",
".",
"get",
"(",
"0",
")",
".",
"size",
"(",
")",
";",
"int",
"[",
"]",
"widths",
"=",
"new",
"int",
"[",
"numCols",
"]",
";",
"if",
"(",
... | A function for determining the max widths of columns, accounting for labels and data.
@return An array of maximum widths for the strings in each column | [
"A",
"function",
"for",
"determining",
"the",
"max",
"widths",
"of",
"columns",
"accounting",
"for",
"labels",
"and",
"data",
"."
] | f029b4c0fea0fe4aa62f36dda2512344ff708bae | https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-admin/src/main/java/org/apache/gobblin/cli/CliTablePrinter.java#L150-L171 |
26,016 | apache/incubator-gobblin | gobblin-admin/src/main/java/org/apache/gobblin/cli/CliTablePrinter.java | CliTablePrinter.getRowFormat | private String getRowFormat(List<Integer> widths) {
StringBuilder rowFormat = new StringBuilder(spaces(this.indentation));
for (int i=0; i< widths.size(); i++) {
rowFormat.append("%");
rowFormat.append(this.flags != null ? this.flags.get(i) : "");
rowFormat.append(widths.get(i).toString());
... | java | private String getRowFormat(List<Integer> widths) {
StringBuilder rowFormat = new StringBuilder(spaces(this.indentation));
for (int i=0; i< widths.size(); i++) {
rowFormat.append("%");
rowFormat.append(this.flags != null ? this.flags.get(i) : "");
rowFormat.append(widths.get(i).toString());
... | [
"private",
"String",
"getRowFormat",
"(",
"List",
"<",
"Integer",
">",
"widths",
")",
"{",
"StringBuilder",
"rowFormat",
"=",
"new",
"StringBuilder",
"(",
"spaces",
"(",
"this",
".",
"indentation",
")",
")",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
... | Generates a simple row format string given a set of widths
@param widths A list of widths for each column in the table
@return A row format for each row in the table | [
"Generates",
"a",
"simple",
"row",
"format",
"string",
"given",
"a",
"set",
"of",
"widths"
] | f029b4c0fea0fe4aa62f36dda2512344ff708bae | https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-admin/src/main/java/org/apache/gobblin/cli/CliTablePrinter.java#L179-L191 |
26,017 | apache/incubator-gobblin | gobblin-compaction/src/main/java/org/apache/gobblin/compaction/source/CompactionSource.java | CompactionSource.copyJarDependencies | private void copyJarDependencies (State state) throws IOException {
if (this.tmpJobDir == null) {
throw new RuntimeException("Job directory is not created");
}
if (!state.contains(ConfigurationKeys.JOB_JAR_FILES_KEY)) {
return;
}
// create sub-dir to save jar files
LocalFileSystem ... | java | private void copyJarDependencies (State state) throws IOException {
if (this.tmpJobDir == null) {
throw new RuntimeException("Job directory is not created");
}
if (!state.contains(ConfigurationKeys.JOB_JAR_FILES_KEY)) {
return;
}
// create sub-dir to save jar files
LocalFileSystem ... | [
"private",
"void",
"copyJarDependencies",
"(",
"State",
"state",
")",
"throws",
"IOException",
"{",
"if",
"(",
"this",
".",
"tmpJobDir",
"==",
"null",
")",
"{",
"throw",
"new",
"RuntimeException",
"(",
"\"Job directory is not created\"",
")",
";",
"}",
"if",
"... | Copy dependent jars to a temporary job directory on HDFS | [
"Copy",
"dependent",
"jars",
"to",
"a",
"temporary",
"job",
"directory",
"on",
"HDFS"
] | f029b4c0fea0fe4aa62f36dda2512344ff708bae | https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-compaction/src/main/java/org/apache/gobblin/compaction/source/CompactionSource.java#L469-L492 |
26,018 | apache/incubator-gobblin | gobblin-modules/gobblin-compliance/src/main/java/org/apache/gobblin/compliance/HiveProxyQueryExecutor.java | HiveProxyQueryExecutor.executeQueries | public void executeQueries(List<String> queries, Optional<String> proxy)
throws SQLException {
Preconditions.checkArgument(!this.statementMap.isEmpty(), "No hive connection. Unable to execute queries");
if (!proxy.isPresent()) {
Preconditions.checkArgument(this.statementMap.size() == 1, "Multiple Hi... | java | public void executeQueries(List<String> queries, Optional<String> proxy)
throws SQLException {
Preconditions.checkArgument(!this.statementMap.isEmpty(), "No hive connection. Unable to execute queries");
if (!proxy.isPresent()) {
Preconditions.checkArgument(this.statementMap.size() == 1, "Multiple Hi... | [
"public",
"void",
"executeQueries",
"(",
"List",
"<",
"String",
">",
"queries",
",",
"Optional",
"<",
"String",
">",
"proxy",
")",
"throws",
"SQLException",
"{",
"Preconditions",
".",
"checkArgument",
"(",
"!",
"this",
".",
"statementMap",
".",
"isEmpty",
"(... | Execute queries.
@param queries the queries
@param proxy the proxy
@throws SQLException the sql exception | [
"Execute",
"queries",
"."
] | f029b4c0fea0fe4aa62f36dda2512344ff708bae | https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-modules/gobblin-compliance/src/main/java/org/apache/gobblin/compliance/HiveProxyQueryExecutor.java#L180-L191 |
26,019 | apache/incubator-gobblin | gobblin-utility/src/main/java/org/apache/gobblin/util/recordcount/IngestionRecordCountProvider.java | IngestionRecordCountProvider.getRecordCount | @Override
public long getRecordCount(Path filepath) {
String[] components = filepath.getName().split(Pattern.quote(SEPARATOR));
Preconditions.checkArgument(components.length >= 2 && StringUtils.isNumeric(components[components.length - 2]),
String.format("Filename %s does not follow the pattern: FILENA... | java | @Override
public long getRecordCount(Path filepath) {
String[] components = filepath.getName().split(Pattern.quote(SEPARATOR));
Preconditions.checkArgument(components.length >= 2 && StringUtils.isNumeric(components[components.length - 2]),
String.format("Filename %s does not follow the pattern: FILENA... | [
"@",
"Override",
"public",
"long",
"getRecordCount",
"(",
"Path",
"filepath",
")",
"{",
"String",
"[",
"]",
"components",
"=",
"filepath",
".",
"getName",
"(",
")",
".",
"split",
"(",
"Pattern",
".",
"quote",
"(",
"SEPARATOR",
")",
")",
";",
"Preconditio... | The record count should be the last component before the filename extension. | [
"The",
"record",
"count",
"should",
"be",
"the",
"last",
"component",
"before",
"the",
"filename",
"extension",
"."
] | f029b4c0fea0fe4aa62f36dda2512344ff708bae | https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-utility/src/main/java/org/apache/gobblin/util/recordcount/IngestionRecordCountProvider.java#L53-L59 |
26,020 | apache/incubator-gobblin | gobblin-modules/gobblin-http/src/main/java/org/apache/gobblin/r2/R2RestRequestBuilder.java | R2RestRequestBuilder.buildWriteRequest | private R2Request<GenericRecord> buildWriteRequest(BufferedRecord<GenericRecord> record) {
if (record == null) {
return null;
}
R2Request<GenericRecord> request = new R2Request<>();
HttpOperation httpOperation = HttpUtils.toHttpOperation(record.getRecord());
// Set uri
URI uri = HttpUtils... | java | private R2Request<GenericRecord> buildWriteRequest(BufferedRecord<GenericRecord> record) {
if (record == null) {
return null;
}
R2Request<GenericRecord> request = new R2Request<>();
HttpOperation httpOperation = HttpUtils.toHttpOperation(record.getRecord());
// Set uri
URI uri = HttpUtils... | [
"private",
"R2Request",
"<",
"GenericRecord",
">",
"buildWriteRequest",
"(",
"BufferedRecord",
"<",
"GenericRecord",
">",
"record",
")",
"{",
"if",
"(",
"record",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
"R2Request",
"<",
"GenericRecord",
">",
"re... | Build a request from a single record | [
"Build",
"a",
"request",
"from",
"a",
"single",
"record"
] | f029b4c0fea0fe4aa62f36dda2512344ff708bae | https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-modules/gobblin-http/src/main/java/org/apache/gobblin/r2/R2RestRequestBuilder.java#L71-L102 |
26,021 | apache/incubator-gobblin | gobblin-modules/gobblin-azkaban/src/main/java/org/apache/gobblin/service/modules/orchestration/AzkabanClient.java | AzkabanClient.createProject | public AzkabanClientStatus createProject(String projectName,
String description) throws AzkabanClientException {
AzkabanMultiCallables.CreateProjectCallable callable =
AzkabanMultiCallables.CreateProjectCallable.builder()
.client(this)
.project... | java | public AzkabanClientStatus createProject(String projectName,
String description) throws AzkabanClientException {
AzkabanMultiCallables.CreateProjectCallable callable =
AzkabanMultiCallables.CreateProjectCallable.builder()
.client(this)
.project... | [
"public",
"AzkabanClientStatus",
"createProject",
"(",
"String",
"projectName",
",",
"String",
"description",
")",
"throws",
"AzkabanClientException",
"{",
"AzkabanMultiCallables",
".",
"CreateProjectCallable",
"callable",
"=",
"AzkabanMultiCallables",
".",
"CreateProjectCall... | Creates a project.
@param projectName project name
@param description project description
@return A status object indicating if AJAX request is successful. | [
"Creates",
"a",
"project",
"."
] | f029b4c0fea0fe4aa62f36dda2512344ff708bae | https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-modules/gobblin-azkaban/src/main/java/org/apache/gobblin/service/modules/orchestration/AzkabanClient.java#L278-L288 |
26,022 | apache/incubator-gobblin | gobblin-modules/gobblin-azkaban/src/main/java/org/apache/gobblin/service/modules/orchestration/AzkabanClient.java | AzkabanClient.deleteProject | public AzkabanClientStatus deleteProject(String projectName) throws AzkabanClientException {
AzkabanMultiCallables.DeleteProjectCallable callable =
AzkabanMultiCallables.DeleteProjectCallable.builder()
.client(this)
.projectName(projectName)
.build();
return runWith... | java | public AzkabanClientStatus deleteProject(String projectName) throws AzkabanClientException {
AzkabanMultiCallables.DeleteProjectCallable callable =
AzkabanMultiCallables.DeleteProjectCallable.builder()
.client(this)
.projectName(projectName)
.build();
return runWith... | [
"public",
"AzkabanClientStatus",
"deleteProject",
"(",
"String",
"projectName",
")",
"throws",
"AzkabanClientException",
"{",
"AzkabanMultiCallables",
".",
"DeleteProjectCallable",
"callable",
"=",
"AzkabanMultiCallables",
".",
"DeleteProjectCallable",
".",
"builder",
"(",
... | Deletes a project. Currently no response message will be returned after finishing
the delete operation. Thus success status is always expected.
@param projectName project name
@return A status object indicating if AJAX request is successful. | [
"Deletes",
"a",
"project",
".",
"Currently",
"no",
"response",
"message",
"will",
"be",
"returned",
"after",
"finishing",
"the",
"delete",
"operation",
".",
"Thus",
"success",
"status",
"is",
"always",
"expected",
"."
] | f029b4c0fea0fe4aa62f36dda2512344ff708bae | https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-modules/gobblin-azkaban/src/main/java/org/apache/gobblin/service/modules/orchestration/AzkabanClient.java#L298-L307 |
26,023 | apache/incubator-gobblin | gobblin-modules/gobblin-azkaban/src/main/java/org/apache/gobblin/service/modules/orchestration/AzkabanClient.java | AzkabanClient.uploadProjectZip | public AzkabanClientStatus uploadProjectZip(String projectName,
File zipFile) throws AzkabanClientException {
AzkabanMultiCallables.UploadProjectCallable callable =
AzkabanMultiCallables.UploadProjectCallable.builder()
.client(this)
.pro... | java | public AzkabanClientStatus uploadProjectZip(String projectName,
File zipFile) throws AzkabanClientException {
AzkabanMultiCallables.UploadProjectCallable callable =
AzkabanMultiCallables.UploadProjectCallable.builder()
.client(this)
.pro... | [
"public",
"AzkabanClientStatus",
"uploadProjectZip",
"(",
"String",
"projectName",
",",
"File",
"zipFile",
")",
"throws",
"AzkabanClientException",
"{",
"AzkabanMultiCallables",
".",
"UploadProjectCallable",
"callable",
"=",
"AzkabanMultiCallables",
".",
"UploadProjectCallabl... | Updates a project by uploading a new zip file. Before uploading any project zip files,
the project should be created first.
@param projectName project name
@param zipFile zip file
@return A status object indicating if AJAX request is successful. | [
"Updates",
"a",
"project",
"by",
"uploading",
"a",
"new",
"zip",
"file",
".",
"Before",
"uploading",
"any",
"project",
"zip",
"files",
"the",
"project",
"should",
"be",
"created",
"first",
"."
] | f029b4c0fea0fe4aa62f36dda2512344ff708bae | https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-modules/gobblin-azkaban/src/main/java/org/apache/gobblin/service/modules/orchestration/AzkabanClient.java#L318-L329 |
26,024 | apache/incubator-gobblin | gobblin-modules/gobblin-azkaban/src/main/java/org/apache/gobblin/service/modules/orchestration/AzkabanClient.java | AzkabanClient.executeFlowWithOptions | public AzkabanExecuteFlowStatus executeFlowWithOptions(String projectName,
String flowName,
Map<String, String> flowOptions,
Map<String, String> flow... | java | public AzkabanExecuteFlowStatus executeFlowWithOptions(String projectName,
String flowName,
Map<String, String> flowOptions,
Map<String, String> flow... | [
"public",
"AzkabanExecuteFlowStatus",
"executeFlowWithOptions",
"(",
"String",
"projectName",
",",
"String",
"flowName",
",",
"Map",
"<",
"String",
",",
"String",
">",
"flowOptions",
",",
"Map",
"<",
"String",
",",
"String",
">",
"flowParameters",
")",
"throws",
... | Execute a flow by providing flow parameters and options. The project and flow should be created first.
@param projectName project name
@param flowName flow name
@param flowOptions flow options
@param flowParameters flow parameters
@return The status object which contains success status and execution id. | [
"Execute",
"a",
"flow",
"by",
"providing",
"flow",
"parameters",
"and",
"options",
".",
"The",
"project",
"and",
"flow",
"should",
"be",
"created",
"first",
"."
] | f029b4c0fea0fe4aa62f36dda2512344ff708bae | https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-modules/gobblin-azkaban/src/main/java/org/apache/gobblin/service/modules/orchestration/AzkabanClient.java#L341-L355 |
26,025 | apache/incubator-gobblin | gobblin-modules/gobblin-azkaban/src/main/java/org/apache/gobblin/service/modules/orchestration/AzkabanClient.java | AzkabanClient.executeFlow | public AzkabanExecuteFlowStatus executeFlow(String projectName,
String flowName,
Map<String, String> flowParameters) throws AzkabanClientException {
return executeFlowWithOptions(projectName, flowName, null, flowParameters);... | java | public AzkabanExecuteFlowStatus executeFlow(String projectName,
String flowName,
Map<String, String> flowParameters) throws AzkabanClientException {
return executeFlowWithOptions(projectName, flowName, null, flowParameters);... | [
"public",
"AzkabanExecuteFlowStatus",
"executeFlow",
"(",
"String",
"projectName",
",",
"String",
"flowName",
",",
"Map",
"<",
"String",
",",
"String",
">",
"flowParameters",
")",
"throws",
"AzkabanClientException",
"{",
"return",
"executeFlowWithOptions",
"(",
"proje... | Execute a flow with flow parameters. The project and flow should be created first.
@param projectName project name
@param flowName flow name
@param flowParameters flow parameters
@return The status object which contains success status and execution id. | [
"Execute",
"a",
"flow",
"with",
"flow",
"parameters",
".",
"The",
"project",
"and",
"flow",
"should",
"be",
"created",
"first",
"."
] | f029b4c0fea0fe4aa62f36dda2512344ff708bae | https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-modules/gobblin-azkaban/src/main/java/org/apache/gobblin/service/modules/orchestration/AzkabanClient.java#L366-L370 |
26,026 | apache/incubator-gobblin | gobblin-modules/gobblin-azkaban/src/main/java/org/apache/gobblin/service/modules/orchestration/AzkabanClient.java | AzkabanClient.cancelFlow | public AzkabanClientStatus cancelFlow(String execId) throws AzkabanClientException {
AzkabanMultiCallables.CancelFlowCallable callable =
AzkabanMultiCallables.CancelFlowCallable.builder()
.client(this)
.execId(execId)
.build();
return runWithRetry(callable, AzkabanCl... | java | public AzkabanClientStatus cancelFlow(String execId) throws AzkabanClientException {
AzkabanMultiCallables.CancelFlowCallable callable =
AzkabanMultiCallables.CancelFlowCallable.builder()
.client(this)
.execId(execId)
.build();
return runWithRetry(callable, AzkabanCl... | [
"public",
"AzkabanClientStatus",
"cancelFlow",
"(",
"String",
"execId",
")",
"throws",
"AzkabanClientException",
"{",
"AzkabanMultiCallables",
".",
"CancelFlowCallable",
"callable",
"=",
"AzkabanMultiCallables",
".",
"CancelFlowCallable",
".",
"builder",
"(",
")",
".",
... | Cancel a flow by execution id. | [
"Cancel",
"a",
"flow",
"by",
"execution",
"id",
"."
] | f029b4c0fea0fe4aa62f36dda2512344ff708bae | https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-modules/gobblin-azkaban/src/main/java/org/apache/gobblin/service/modules/orchestration/AzkabanClient.java#L375-L383 |
26,027 | apache/incubator-gobblin | gobblin-modules/gobblin-azkaban/src/main/java/org/apache/gobblin/service/modules/orchestration/AzkabanClient.java | AzkabanClient.fetchExecutionLog | public AzkabanClientStatus fetchExecutionLog(String execId,
String jobId,
String offset,
String length,
File ouf) throws AzkabanClie... | java | public AzkabanClientStatus fetchExecutionLog(String execId,
String jobId,
String offset,
String length,
File ouf) throws AzkabanClie... | [
"public",
"AzkabanClientStatus",
"fetchExecutionLog",
"(",
"String",
"execId",
",",
"String",
"jobId",
",",
"String",
"offset",
",",
"String",
"length",
",",
"File",
"ouf",
")",
"throws",
"AzkabanClientException",
"{",
"AzkabanMultiCallables",
".",
"FetchExecLogCallab... | Fetch an execution log. | [
"Fetch",
"an",
"execution",
"log",
"."
] | f029b4c0fea0fe4aa62f36dda2512344ff708bae | https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-modules/gobblin-azkaban/src/main/java/org/apache/gobblin/service/modules/orchestration/AzkabanClient.java#L388-L404 |
26,028 | apache/incubator-gobblin | gobblin-modules/gobblin-azkaban/src/main/java/org/apache/gobblin/service/modules/orchestration/AzkabanClient.java | AzkabanClient.fetchFlowExecution | public AzkabanFetchExecuteFlowStatus fetchFlowExecution(String execId) throws AzkabanClientException {
AzkabanMultiCallables.FetchFlowExecCallable callable =
AzkabanMultiCallables.FetchFlowExecCallable.builder()
.client(this)
.execId(execId)
.build();
return runWithR... | java | public AzkabanFetchExecuteFlowStatus fetchFlowExecution(String execId) throws AzkabanClientException {
AzkabanMultiCallables.FetchFlowExecCallable callable =
AzkabanMultiCallables.FetchFlowExecCallable.builder()
.client(this)
.execId(execId)
.build();
return runWithR... | [
"public",
"AzkabanFetchExecuteFlowStatus",
"fetchFlowExecution",
"(",
"String",
"execId",
")",
"throws",
"AzkabanClientException",
"{",
"AzkabanMultiCallables",
".",
"FetchFlowExecCallable",
"callable",
"=",
"AzkabanMultiCallables",
".",
"FetchFlowExecCallable",
".",
"builder",... | Given an execution id, fetches all the detailed information of that execution,
including a list of all the job executions.
@param execId execution id to be fetched.
@return The status object which contains success status and all the detailed
information of that execution. | [
"Given",
"an",
"execution",
"id",
"fetches",
"all",
"the",
"detailed",
"information",
"of",
"that",
"execution",
"including",
"a",
"list",
"of",
"all",
"the",
"job",
"executions",
"."
] | f029b4c0fea0fe4aa62f36dda2512344ff708bae | https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-modules/gobblin-azkaban/src/main/java/org/apache/gobblin/service/modules/orchestration/AzkabanClient.java#L415-L423 |
26,029 | apache/incubator-gobblin | gobblin-modules/gobblin-eventhub/src/main/java/org/apache/gobblin/eventhub/writer/EventhubDataWriterBuilder.java | EventhubDataWriterBuilder.getAsyncDataWriter | public AsyncDataWriter getAsyncDataWriter(Properties properties) {
EventhubDataWriter eventhubDataWriter = new EventhubDataWriter(properties);
EventhubBatchAccumulator accumulator = new EventhubBatchAccumulator(properties);
BatchedEventhubDataWriter batchedEventhubDataWriter = new BatchedEventhubDataWriter(... | java | public AsyncDataWriter getAsyncDataWriter(Properties properties) {
EventhubDataWriter eventhubDataWriter = new EventhubDataWriter(properties);
EventhubBatchAccumulator accumulator = new EventhubBatchAccumulator(properties);
BatchedEventhubDataWriter batchedEventhubDataWriter = new BatchedEventhubDataWriter(... | [
"public",
"AsyncDataWriter",
"getAsyncDataWriter",
"(",
"Properties",
"properties",
")",
"{",
"EventhubDataWriter",
"eventhubDataWriter",
"=",
"new",
"EventhubDataWriter",
"(",
"properties",
")",
";",
"EventhubBatchAccumulator",
"accumulator",
"=",
"new",
"EventhubBatchAccu... | Create an eventhub data writer, wrapped into a buffered async data writer | [
"Create",
"an",
"eventhub",
"data",
"writer",
"wrapped",
"into",
"a",
"buffered",
"async",
"data",
"writer"
] | f029b4c0fea0fe4aa62f36dda2512344ff708bae | https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-modules/gobblin-eventhub/src/main/java/org/apache/gobblin/eventhub/writer/EventhubDataWriterBuilder.java#L42-L47 |
26,030 | apache/incubator-gobblin | gobblin-restli/gobblin-throttling-service/gobblin-throttling-service-server/src/main/java/org/apache/gobblin/restli/throttling/DynamicTokenBucket.java | DynamicTokenBucket.getPermitsAndDelay | public PermitsAndDelay getPermitsAndDelay(long requestedPermits, long minPermits, long timeoutMillis) {
try {
long storedTokens = this.tokenBucket.getStoredTokens();
long eagerTokens = storedTokens / 2;
if (eagerTokens > requestedPermits && this.tokenBucket.getTokens(eagerTokens, 0, TimeUnit.MILL... | java | public PermitsAndDelay getPermitsAndDelay(long requestedPermits, long minPermits, long timeoutMillis) {
try {
long storedTokens = this.tokenBucket.getStoredTokens();
long eagerTokens = storedTokens / 2;
if (eagerTokens > requestedPermits && this.tokenBucket.getTokens(eagerTokens, 0, TimeUnit.MILL... | [
"public",
"PermitsAndDelay",
"getPermitsAndDelay",
"(",
"long",
"requestedPermits",
",",
"long",
"minPermits",
",",
"long",
"timeoutMillis",
")",
"{",
"try",
"{",
"long",
"storedTokens",
"=",
"this",
".",
"tokenBucket",
".",
"getStoredTokens",
"(",
")",
";",
"lo... | Request tokens.
@param requestedPermits the ideal number of tokens to acquire.
@param minPermits the minimum number of tokens useful for the calling process. If this many tokens cannot be acquired,
the method will return 0 instead,
@param timeoutMillis the maximum wait the calling process is willing to wait for tokens.... | [
"Request",
"tokens",
"."
] | f029b4c0fea0fe4aa62f36dda2512344ff708bae | https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-restli/gobblin-throttling-service/gobblin-throttling-service-server/src/main/java/org/apache/gobblin/restli/throttling/DynamicTokenBucket.java#L79-L112 |
26,031 | apache/incubator-gobblin | gobblin-modules/gobblin-crypto-provider/src/main/java/org/apache/gobblin/crypto/GobblinEncryptionProvider.java | GobblinEncryptionProvider.buildStreamEncryptor | public StreamCodec buildStreamEncryptor(Map<String, Object> parameters) {
String encryptionType = EncryptionConfigParser.getEncryptionType(parameters);
if (encryptionType == null) {
throw new IllegalArgumentException("Encryption type not present in parameters!");
}
return buildStreamCryptoProvide... | java | public StreamCodec buildStreamEncryptor(Map<String, Object> parameters) {
String encryptionType = EncryptionConfigParser.getEncryptionType(parameters);
if (encryptionType == null) {
throw new IllegalArgumentException("Encryption type not present in parameters!");
}
return buildStreamCryptoProvide... | [
"public",
"StreamCodec",
"buildStreamEncryptor",
"(",
"Map",
"<",
"String",
",",
"Object",
">",
"parameters",
")",
"{",
"String",
"encryptionType",
"=",
"EncryptionConfigParser",
".",
"getEncryptionType",
"(",
"parameters",
")",
";",
"if",
"(",
"encryptionType",
"... | Return a StreamEncryptor for the given parameters. The algorithm type to use will be extracted
from the parameters object.
@param parameters Configured parameters for algorithm.
@return A StreamCodec for the requested algorithm
@throws IllegalArgumentException If the given algorithm/parameter pair cannot be built | [
"Return",
"a",
"StreamEncryptor",
"for",
"the",
"given",
"parameters",
".",
"The",
"algorithm",
"type",
"to",
"use",
"will",
"be",
"extracted",
"from",
"the",
"parameters",
"object",
"."
] | f029b4c0fea0fe4aa62f36dda2512344ff708bae | https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-modules/gobblin-crypto-provider/src/main/java/org/apache/gobblin/crypto/GobblinEncryptionProvider.java#L60-L67 |
26,032 | apache/incubator-gobblin | gobblin-modules/gobblin-crypto-provider/src/main/java/org/apache/gobblin/crypto/GobblinEncryptionProvider.java | GobblinEncryptionProvider.buildCredentialStore | public CredentialStore buildCredentialStore(Map<String, Object> parameters) {
String ks_type = EncryptionConfigParser.getKeystoreType(parameters);
String ks_path = EncryptionConfigParser.getKeystorePath(parameters);
String ks_password = EncryptionConfigParser.getKeystorePassword(parameters);
try {
... | java | public CredentialStore buildCredentialStore(Map<String, Object> parameters) {
String ks_type = EncryptionConfigParser.getKeystoreType(parameters);
String ks_path = EncryptionConfigParser.getKeystorePath(parameters);
String ks_password = EncryptionConfigParser.getKeystorePassword(parameters);
try {
... | [
"public",
"CredentialStore",
"buildCredentialStore",
"(",
"Map",
"<",
"String",
",",
"Object",
">",
"parameters",
")",
"{",
"String",
"ks_type",
"=",
"EncryptionConfigParser",
".",
"getKeystoreType",
"(",
"parameters",
")",
";",
"String",
"ks_path",
"=",
"Encrypti... | Build a credential store with the given parameters. | [
"Build",
"a",
"credential",
"store",
"with",
"the",
"given",
"parameters",
"."
] | f029b4c0fea0fe4aa62f36dda2512344ff708bae | https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-modules/gobblin-crypto-provider/src/main/java/org/apache/gobblin/crypto/GobblinEncryptionProvider.java#L111-L131 |
26,033 | apache/incubator-gobblin | gobblin-modules/gobblin-metadata/src/main/java/org/apache/gobblin/type/ContentTypeUtils.java | ContentTypeUtils.getCharset | public String getCharset(String contentType) {
String charSet = knownCharsets.get(contentType);
if (charSet != null) {
return charSet;
}
// Special cases
if (contentType.startsWith("text/") || contentType.endsWith("+json") || contentType.endsWith("+xml")) {
return "UTF-8";
}
re... | java | public String getCharset(String contentType) {
String charSet = knownCharsets.get(contentType);
if (charSet != null) {
return charSet;
}
// Special cases
if (contentType.startsWith("text/") || contentType.endsWith("+json") || contentType.endsWith("+xml")) {
return "UTF-8";
}
re... | [
"public",
"String",
"getCharset",
"(",
"String",
"contentType",
")",
"{",
"String",
"charSet",
"=",
"knownCharsets",
".",
"get",
"(",
"contentType",
")",
";",
"if",
"(",
"charSet",
"!=",
"null",
")",
"{",
"return",
"charSet",
";",
"}",
"// Special cases",
... | Check which character set a given content-type corresponds to.
@param contentType Content-type to check
@return Charset the mimetype represents. "BINARY" if binary data. | [
"Check",
"which",
"character",
"set",
"a",
"given",
"content",
"-",
"type",
"corresponds",
"to",
"."
] | f029b4c0fea0fe4aa62f36dda2512344ff708bae | https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-modules/gobblin-metadata/src/main/java/org/apache/gobblin/type/ContentTypeUtils.java#L45-L57 |
26,034 | apache/incubator-gobblin | gobblin-modules/gobblin-metadata/src/main/java/org/apache/gobblin/type/ContentTypeUtils.java | ContentTypeUtils.inferPrintableFromMetadata | public boolean inferPrintableFromMetadata(Metadata md) {
String inferredCharset = "BINARY";
List<String> transferEncoding = md.getGlobalMetadata().getTransferEncoding();
if (transferEncoding != null) {
inferredCharset = getCharset(transferEncoding.get(transferEncoding.size() - 1));
} else if (md.... | java | public boolean inferPrintableFromMetadata(Metadata md) {
String inferredCharset = "BINARY";
List<String> transferEncoding = md.getGlobalMetadata().getTransferEncoding();
if (transferEncoding != null) {
inferredCharset = getCharset(transferEncoding.get(transferEncoding.size() - 1));
} else if (md.... | [
"public",
"boolean",
"inferPrintableFromMetadata",
"(",
"Metadata",
"md",
")",
"{",
"String",
"inferredCharset",
"=",
"\"BINARY\"",
";",
"List",
"<",
"String",
">",
"transferEncoding",
"=",
"md",
".",
"getGlobalMetadata",
"(",
")",
".",
"getTransferEncoding",
"(",... | Heuristic to infer if content is printable from metadata. | [
"Heuristic",
"to",
"infer",
"if",
"content",
"is",
"printable",
"from",
"metadata",
"."
] | f029b4c0fea0fe4aa62f36dda2512344ff708bae | https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-modules/gobblin-metadata/src/main/java/org/apache/gobblin/type/ContentTypeUtils.java#L62-L73 |
26,035 | apache/incubator-gobblin | gobblin-modules/gobblin-metadata/src/main/java/org/apache/gobblin/type/ContentTypeUtils.java | ContentTypeUtils.registerCharsetMapping | public void registerCharsetMapping(String contentType, String charSet) {
if (knownCharsets.contains(contentType)) {
log.warn("{} is already registered; re-registering");
}
knownCharsets.put(contentType, charSet);
} | java | public void registerCharsetMapping(String contentType, String charSet) {
if (knownCharsets.contains(contentType)) {
log.warn("{} is already registered; re-registering");
}
knownCharsets.put(contentType, charSet);
} | [
"public",
"void",
"registerCharsetMapping",
"(",
"String",
"contentType",
",",
"String",
"charSet",
")",
"{",
"if",
"(",
"knownCharsets",
".",
"contains",
"(",
"contentType",
")",
")",
"{",
"log",
".",
"warn",
"(",
"\"{} is already registered; re-registering\"",
"... | Register a new contentType to charSet mapping.
@param contentType Content-type to register
@param charSet charSet associated with the content-type | [
"Register",
"a",
"new",
"contentType",
"to",
"charSet",
"mapping",
"."
] | f029b4c0fea0fe4aa62f36dda2512344ff708bae | https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-modules/gobblin-metadata/src/main/java/org/apache/gobblin/type/ContentTypeUtils.java#L80-L86 |
26,036 | apache/incubator-gobblin | gobblin-compaction/src/main/java/org/apache/gobblin/compaction/verify/CompactionAuditCountVerifier.java | CompactionAuditCountVerifier.getClientFactory | private static AuditCountClientFactory getClientFactory (State state) {
if (!state.contains(AuditCountClientFactory.AUDIT_COUNT_CLIENT_FACTORY)) {
return new EmptyAuditCountClientFactory ();
}
try {
String factoryName = state.getProp(AuditCountClientFactory.AUDIT_COUNT_CLIENT_FACTORY);
C... | java | private static AuditCountClientFactory getClientFactory (State state) {
if (!state.contains(AuditCountClientFactory.AUDIT_COUNT_CLIENT_FACTORY)) {
return new EmptyAuditCountClientFactory ();
}
try {
String factoryName = state.getProp(AuditCountClientFactory.AUDIT_COUNT_CLIENT_FACTORY);
C... | [
"private",
"static",
"AuditCountClientFactory",
"getClientFactory",
"(",
"State",
"state",
")",
"{",
"if",
"(",
"!",
"state",
".",
"contains",
"(",
"AuditCountClientFactory",
".",
"AUDIT_COUNT_CLIENT_FACTORY",
")",
")",
"{",
"return",
"new",
"EmptyAuditCountClientFact... | Obtain a client factory
@param state job state
@return a factory which creates {@link AuditCountClient}.
If no factory is set or an error occurred, a {@link EmptyAuditCountClientFactory} is
returned which creates a <code>null</code> {@link AuditCountClient} | [
"Obtain",
"a",
"client",
"factory"
] | f029b4c0fea0fe4aa62f36dda2512344ff708bae | https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-compaction/src/main/java/org/apache/gobblin/compaction/verify/CompactionAuditCountVerifier.java#L95-L109 |
26,037 | apache/incubator-gobblin | gobblin-modules/google-ingestion/src/main/java/org/apache/gobblin/source/extractor/extract/google/GoogleCommon.java | GoogleCommon.buildCredentialFromP12 | private static Credential buildCredentialFromP12(String privateKeyPath,
Optional<String> fsUri,
Optional<String> id,
HttpTransport transport,
... | java | private static Credential buildCredentialFromP12(String privateKeyPath,
Optional<String> fsUri,
Optional<String> id,
HttpTransport transport,
... | [
"private",
"static",
"Credential",
"buildCredentialFromP12",
"(",
"String",
"privateKeyPath",
",",
"Optional",
"<",
"String",
">",
"fsUri",
",",
"Optional",
"<",
"String",
">",
"id",
",",
"HttpTransport",
"transport",
",",
"Collection",
"<",
"String",
">",
"serv... | As Google API only accepts java.io.File for private key, and this method copies private key into local file system.
Once Google credential is instantiated, it deletes copied private key file.
@param privateKeyPath
@param fsUri
@param id
@param transport
@param serviceAccountScopes
@return Credential
@throws IOExceptio... | [
"As",
"Google",
"API",
"only",
"accepts",
"java",
".",
"io",
".",
"File",
"for",
"private",
"key",
"and",
"this",
"method",
"copies",
"private",
"key",
"into",
"local",
"file",
"system",
".",
"Once",
"Google",
"credential",
"is",
"instantiated",
"it",
"del... | f029b4c0fea0fe4aa62f36dda2512344ff708bae | https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-modules/google-ingestion/src/main/java/org/apache/gobblin/source/extractor/extract/google/GoogleCommon.java#L145-L171 |
26,038 | apache/incubator-gobblin | gobblin-modules/google-ingestion/src/main/java/org/apache/gobblin/source/extractor/extract/google/GoogleCommon.java | GoogleCommon.getPrivateKey | private static Path getPrivateKey(FileSystem fs, String privateKeyPath) throws IOException {
Path keyPath = new Path(privateKeyPath);
FileStatus fileStatus = fs.getFileStatus(keyPath);
Preconditions.checkArgument(USER_READ_PERMISSION_ONLY.equals(fileStatus.getPermission()),
"... | java | private static Path getPrivateKey(FileSystem fs, String privateKeyPath) throws IOException {
Path keyPath = new Path(privateKeyPath);
FileStatus fileStatus = fs.getFileStatus(keyPath);
Preconditions.checkArgument(USER_READ_PERMISSION_ONLY.equals(fileStatus.getPermission()),
"... | [
"private",
"static",
"Path",
"getPrivateKey",
"(",
"FileSystem",
"fs",
",",
"String",
"privateKeyPath",
")",
"throws",
"IOException",
"{",
"Path",
"keyPath",
"=",
"new",
"Path",
"(",
"privateKeyPath",
")",
";",
"FileStatus",
"fileStatus",
"=",
"fs",
".",
"getF... | Before retrieving private key, it makes sure that original private key's permission is read only on the owner.
This is a way to ensure to keep private key private.
@param fs
@param privateKeyPath
@return
@throws IOException | [
"Before",
"retrieving",
"private",
"key",
"it",
"makes",
"sure",
"that",
"original",
"private",
"key",
"s",
"permission",
"is",
"read",
"only",
"on",
"the",
"owner",
".",
"This",
"is",
"a",
"way",
"to",
"ensure",
"to",
"keep",
"private",
"key",
"private",
... | f029b4c0fea0fe4aa62f36dda2512344ff708bae | https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-modules/google-ingestion/src/main/java/org/apache/gobblin/source/extractor/extract/google/GoogleCommon.java#L181-L187 |
26,039 | apache/incubator-gobblin | gobblin-modules/google-ingestion/src/main/java/org/apache/gobblin/source/extractor/extract/google/GoogleCommon.java | GoogleCommon.newTransport | public static HttpTransport newTransport(String proxyUrl, String portStr) throws NumberFormatException, GeneralSecurityException, IOException {
if (!StringUtils.isEmpty(proxyUrl) && !StringUtils.isEmpty(portStr)) {
return new NetHttpTransport.Builder()
.trustCertificates(Googl... | java | public static HttpTransport newTransport(String proxyUrl, String portStr) throws NumberFormatException, GeneralSecurityException, IOException {
if (!StringUtils.isEmpty(proxyUrl) && !StringUtils.isEmpty(portStr)) {
return new NetHttpTransport.Builder()
.trustCertificates(Googl... | [
"public",
"static",
"HttpTransport",
"newTransport",
"(",
"String",
"proxyUrl",
",",
"String",
"portStr",
")",
"throws",
"NumberFormatException",
",",
"GeneralSecurityException",
",",
"IOException",
"{",
"if",
"(",
"!",
"StringUtils",
".",
"isEmpty",
"(",
"proxyUrl"... | Provides HttpTransport. If both proxyUrl and postStr is defined, it provides transport with Proxy.
@param proxyUrl Optional.
@param portStr Optional. String type for port so that user can easily pass null. (e.g: state.getProp(key))
@return
@throws NumberFormatException
@throws GeneralSecurityException
@throws IOExcepti... | [
"Provides",
"HttpTransport",
".",
"If",
"both",
"proxyUrl",
"and",
"postStr",
"is",
"defined",
"it",
"provides",
"transport",
"with",
"Proxy",
"."
] | f029b4c0fea0fe4aa62f36dda2512344ff708bae | https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-modules/google-ingestion/src/main/java/org/apache/gobblin/source/extractor/extract/google/GoogleCommon.java#L218-L226 |
26,040 | apache/incubator-gobblin | gobblin-runtime/src/main/java/org/apache/gobblin/runtime/embedded/EmbeddedGobblin.java | EmbeddedGobblin.mrMode | public EmbeddedGobblin mrMode() throws IOException {
this.sysConfigOverrides.put(ConfigurationKeys.JOB_LAUNCHER_TYPE_KEY, JobLauncherFactory.JobLauncherType.MAPREDUCE.name());
this.builtConfigMap.put(ConfigurationKeys.FS_URI_KEY, FileSystem.get(new Configuration()).getUri().toString());
this.builtConfigMap.... | java | public EmbeddedGobblin mrMode() throws IOException {
this.sysConfigOverrides.put(ConfigurationKeys.JOB_LAUNCHER_TYPE_KEY, JobLauncherFactory.JobLauncherType.MAPREDUCE.name());
this.builtConfigMap.put(ConfigurationKeys.FS_URI_KEY, FileSystem.get(new Configuration()).getUri().toString());
this.builtConfigMap.... | [
"public",
"EmbeddedGobblin",
"mrMode",
"(",
")",
"throws",
"IOException",
"{",
"this",
".",
"sysConfigOverrides",
".",
"put",
"(",
"ConfigurationKeys",
".",
"JOB_LAUNCHER_TYPE_KEY",
",",
"JobLauncherFactory",
".",
"JobLauncherType",
".",
"MAPREDUCE",
".",
"name",
"(... | Specify job should run in MR mode. | [
"Specify",
"job",
"should",
"run",
"in",
"MR",
"mode",
"."
] | f029b4c0fea0fe4aa62f36dda2512344ff708bae | https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-runtime/src/main/java/org/apache/gobblin/runtime/embedded/EmbeddedGobblin.java#L176-L189 |
26,041 | apache/incubator-gobblin | gobblin-runtime/src/main/java/org/apache/gobblin/runtime/embedded/EmbeddedGobblin.java | EmbeddedGobblin.sysConfig | public EmbeddedGobblin sysConfig(String key, String value) {
this.sysConfigOverrides.put(key, value);
return this;
} | java | public EmbeddedGobblin sysConfig(String key, String value) {
this.sysConfigOverrides.put(key, value);
return this;
} | [
"public",
"EmbeddedGobblin",
"sysConfig",
"(",
"String",
"key",
",",
"String",
"value",
")",
"{",
"this",
".",
"sysConfigOverrides",
".",
"put",
"(",
"key",
",",
"value",
")",
";",
"return",
"this",
";",
"}"
] | Override a Gobblin system configuration. | [
"Override",
"a",
"Gobblin",
"system",
"configuration",
"."
] | f029b4c0fea0fe4aa62f36dda2512344ff708bae | https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-runtime/src/main/java/org/apache/gobblin/runtime/embedded/EmbeddedGobblin.java#L258-L261 |
26,042 | apache/incubator-gobblin | gobblin-runtime/src/main/java/org/apache/gobblin/runtime/embedded/EmbeddedGobblin.java | EmbeddedGobblin.setConfiguration | public EmbeddedGobblin setConfiguration(String key, String value) {
this.userConfigMap.put(key, value);
return this;
} | java | public EmbeddedGobblin setConfiguration(String key, String value) {
this.userConfigMap.put(key, value);
return this;
} | [
"public",
"EmbeddedGobblin",
"setConfiguration",
"(",
"String",
"key",
",",
"String",
"value",
")",
"{",
"this",
".",
"userConfigMap",
".",
"put",
"(",
"key",
",",
"value",
")",
";",
"return",
"this",
";",
"}"
] | Manually set a key-value pair in the job configuration. | [
"Manually",
"set",
"a",
"key",
"-",
"value",
"pair",
"in",
"the",
"job",
"configuration",
"."
] | f029b4c0fea0fe4aa62f36dda2512344ff708bae | https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-runtime/src/main/java/org/apache/gobblin/runtime/embedded/EmbeddedGobblin.java#L305-L308 |
26,043 | apache/incubator-gobblin | gobblin-runtime/src/main/java/org/apache/gobblin/runtime/embedded/EmbeddedGobblin.java | EmbeddedGobblin.setJobTimeout | public EmbeddedGobblin setJobTimeout(String timeout) {
return setJobTimeout(Period.parse(timeout).getSeconds(), TimeUnit.SECONDS);
} | java | public EmbeddedGobblin setJobTimeout(String timeout) {
return setJobTimeout(Period.parse(timeout).getSeconds(), TimeUnit.SECONDS);
} | [
"public",
"EmbeddedGobblin",
"setJobTimeout",
"(",
"String",
"timeout",
")",
"{",
"return",
"setJobTimeout",
"(",
"Period",
".",
"parse",
"(",
"timeout",
")",
".",
"getSeconds",
"(",
")",
",",
"TimeUnit",
".",
"SECONDS",
")",
";",
"}"
] | Set the timeout for the Gobblin job execution from ISO-style period. | [
"Set",
"the",
"timeout",
"for",
"the",
"Gobblin",
"job",
"execution",
"from",
"ISO",
"-",
"style",
"period",
"."
] | f029b4c0fea0fe4aa62f36dda2512344ff708bae | https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-runtime/src/main/java/org/apache/gobblin/runtime/embedded/EmbeddedGobblin.java#L332-L334 |
26,044 | apache/incubator-gobblin | gobblin-runtime/src/main/java/org/apache/gobblin/runtime/embedded/EmbeddedGobblin.java | EmbeddedGobblin.setLaunchTimeout | public EmbeddedGobblin setLaunchTimeout(String timeout) {
return setLaunchTimeout(Period.parse(timeout).getSeconds(), TimeUnit.SECONDS);
} | java | public EmbeddedGobblin setLaunchTimeout(String timeout) {
return setLaunchTimeout(Period.parse(timeout).getSeconds(), TimeUnit.SECONDS);
} | [
"public",
"EmbeddedGobblin",
"setLaunchTimeout",
"(",
"String",
"timeout",
")",
"{",
"return",
"setLaunchTimeout",
"(",
"Period",
".",
"parse",
"(",
"timeout",
")",
".",
"getSeconds",
"(",
")",
",",
"TimeUnit",
".",
"SECONDS",
")",
";",
"}"
] | Set the timeout for launching the Gobblin job from ISO-style period. | [
"Set",
"the",
"timeout",
"for",
"launching",
"the",
"Gobblin",
"job",
"from",
"ISO",
"-",
"style",
"period",
"."
] | f029b4c0fea0fe4aa62f36dda2512344ff708bae | https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-runtime/src/main/java/org/apache/gobblin/runtime/embedded/EmbeddedGobblin.java#L347-L349 |
26,045 | apache/incubator-gobblin | gobblin-runtime/src/main/java/org/apache/gobblin/runtime/embedded/EmbeddedGobblin.java | EmbeddedGobblin.setShutdownTimeout | public EmbeddedGobblin setShutdownTimeout(String timeout) {
return setShutdownTimeout(Period.parse(timeout).getSeconds(), TimeUnit.SECONDS);
} | java | public EmbeddedGobblin setShutdownTimeout(String timeout) {
return setShutdownTimeout(Period.parse(timeout).getSeconds(), TimeUnit.SECONDS);
} | [
"public",
"EmbeddedGobblin",
"setShutdownTimeout",
"(",
"String",
"timeout",
")",
"{",
"return",
"setShutdownTimeout",
"(",
"Period",
".",
"parse",
"(",
"timeout",
")",
".",
"getSeconds",
"(",
")",
",",
"TimeUnit",
".",
"SECONDS",
")",
";",
"}"
] | Set the timeout for shutting down the Gobblin instance driver after the job is done from ISO-style period. | [
"Set",
"the",
"timeout",
"for",
"shutting",
"down",
"the",
"Gobblin",
"instance",
"driver",
"after",
"the",
"job",
"is",
"done",
"from",
"ISO",
"-",
"style",
"period",
"."
] | f029b4c0fea0fe4aa62f36dda2512344ff708bae | https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-runtime/src/main/java/org/apache/gobblin/runtime/embedded/EmbeddedGobblin.java#L362-L364 |
26,046 | apache/incubator-gobblin | gobblin-runtime/src/main/java/org/apache/gobblin/runtime/embedded/EmbeddedGobblin.java | EmbeddedGobblin.useStateStore | public EmbeddedGobblin useStateStore(String rootDir) {
this.setConfiguration(ConfigurationKeys.STATE_STORE_ENABLED, "true");
this.setConfiguration(ConfigurationKeys.STATE_STORE_ROOT_DIR_KEY, rootDir);
return this;
} | java | public EmbeddedGobblin useStateStore(String rootDir) {
this.setConfiguration(ConfigurationKeys.STATE_STORE_ENABLED, "true");
this.setConfiguration(ConfigurationKeys.STATE_STORE_ROOT_DIR_KEY, rootDir);
return this;
} | [
"public",
"EmbeddedGobblin",
"useStateStore",
"(",
"String",
"rootDir",
")",
"{",
"this",
".",
"setConfiguration",
"(",
"ConfigurationKeys",
".",
"STATE_STORE_ENABLED",
",",
"\"true\"",
")",
";",
"this",
".",
"setConfiguration",
"(",
"ConfigurationKeys",
".",
"STATE... | Enable state store. | [
"Enable",
"state",
"store",
"."
] | f029b4c0fea0fe4aa62f36dda2512344ff708bae | https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-runtime/src/main/java/org/apache/gobblin/runtime/embedded/EmbeddedGobblin.java#L377-L381 |
26,047 | apache/incubator-gobblin | gobblin-runtime/src/main/java/org/apache/gobblin/runtime/embedded/EmbeddedGobblin.java | EmbeddedGobblin.enableMetrics | public EmbeddedGobblin enableMetrics() {
this.usePlugin(new GobblinMetricsPlugin.Factory());
this.sysConfig(ConfigurationKeys.METRICS_ENABLED_KEY, Boolean.toString(true));
return this;
} | java | public EmbeddedGobblin enableMetrics() {
this.usePlugin(new GobblinMetricsPlugin.Factory());
this.sysConfig(ConfigurationKeys.METRICS_ENABLED_KEY, Boolean.toString(true));
return this;
} | [
"public",
"EmbeddedGobblin",
"enableMetrics",
"(",
")",
"{",
"this",
".",
"usePlugin",
"(",
"new",
"GobblinMetricsPlugin",
".",
"Factory",
"(",
")",
")",
";",
"this",
".",
"sysConfig",
"(",
"ConfigurationKeys",
".",
"METRICS_ENABLED_KEY",
",",
"Boolean",
".",
... | Enable metrics. Does not start any reporters. | [
"Enable",
"metrics",
".",
"Does",
"not",
"start",
"any",
"reporters",
"."
] | f029b4c0fea0fe4aa62f36dda2512344ff708bae | https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-runtime/src/main/java/org/apache/gobblin/runtime/embedded/EmbeddedGobblin.java#L386-L390 |
26,048 | apache/incubator-gobblin | gobblin-runtime/src/main/java/org/apache/gobblin/runtime/embedded/EmbeddedGobblin.java | EmbeddedGobblin.run | @NotOnCli
public JobExecutionResult run() throws InterruptedException, TimeoutException, ExecutionException {
JobExecutionDriver jobDriver = runAsync();
return jobDriver.get(this.jobTimeout.getTimeout(), this.jobTimeout.getTimeUnit());
} | java | @NotOnCli
public JobExecutionResult run() throws InterruptedException, TimeoutException, ExecutionException {
JobExecutionDriver jobDriver = runAsync();
return jobDriver.get(this.jobTimeout.getTimeout(), this.jobTimeout.getTimeUnit());
} | [
"@",
"NotOnCli",
"public",
"JobExecutionResult",
"run",
"(",
")",
"throws",
"InterruptedException",
",",
"TimeoutException",
",",
"ExecutionException",
"{",
"JobExecutionDriver",
"jobDriver",
"=",
"runAsync",
"(",
")",
";",
"return",
"jobDriver",
".",
"get",
"(",
... | Run the Gobblin job. This call will block until the job is done.
@return a {@link JobExecutionResult} containing the result of the execution. | [
"Run",
"the",
"Gobblin",
"job",
".",
"This",
"call",
"will",
"block",
"until",
"the",
"job",
"is",
"done",
"."
] | f029b4c0fea0fe4aa62f36dda2512344ff708bae | https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-runtime/src/main/java/org/apache/gobblin/runtime/embedded/EmbeddedGobblin.java#L404-L408 |
26,049 | apache/incubator-gobblin | gobblin-runtime/src/main/java/org/apache/gobblin/runtime/embedded/EmbeddedGobblin.java | EmbeddedGobblin.loadCoreGobblinJarsToDistributedJars | private void loadCoreGobblinJarsToDistributedJars() {
// Gobblin-api
distributeJarByClassWithPriority(State.class, 0);
// Gobblin-core
distributeJarByClassWithPriority(ConstructState.class, 0);
// Gobblin-core-base
distributeJarByClassWithPriority(InstrumentedExtractorBase.class, 0);
// Gobb... | java | private void loadCoreGobblinJarsToDistributedJars() {
// Gobblin-api
distributeJarByClassWithPriority(State.class, 0);
// Gobblin-core
distributeJarByClassWithPriority(ConstructState.class, 0);
// Gobblin-core-base
distributeJarByClassWithPriority(InstrumentedExtractorBase.class, 0);
// Gobb... | [
"private",
"void",
"loadCoreGobblinJarsToDistributedJars",
"(",
")",
"{",
"// Gobblin-api",
"distributeJarByClassWithPriority",
"(",
"State",
".",
"class",
",",
"0",
")",
";",
"// Gobblin-core",
"distributeJarByClassWithPriority",
"(",
"ConstructState",
".",
"class",
",",... | This returns the set of jars required by a basic Gobblin ingestion job. In general, these need to be distributed
to workers in a distributed environment. | [
"This",
"returns",
"the",
"set",
"of",
"jars",
"required",
"by",
"a",
"basic",
"Gobblin",
"ingestion",
"job",
".",
"In",
"general",
"these",
"need",
"to",
"be",
"distributed",
"to",
"workers",
"in",
"a",
"distributed",
"environment",
"."
] | f029b4c0fea0fe4aa62f36dda2512344ff708bae | https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-runtime/src/main/java/org/apache/gobblin/runtime/embedded/EmbeddedGobblin.java#L545-L582 |
26,050 | apache/incubator-gobblin | gobblin-runtime/src/main/java/org/apache/gobblin/runtime/job_catalog/NonObservingFSJobCatalog.java | NonObservingFSJobCatalog.put | @Override
public synchronized void put(JobSpec jobSpec) {
Preconditions.checkState(state() == State.RUNNING, String.format("%s is not running.", this.getClass().getName()));
Preconditions.checkNotNull(jobSpec);
try {
long startTime = System.currentTimeMillis();
Path jobSpecPath = getPathForURI... | java | @Override
public synchronized void put(JobSpec jobSpec) {
Preconditions.checkState(state() == State.RUNNING, String.format("%s is not running.", this.getClass().getName()));
Preconditions.checkNotNull(jobSpec);
try {
long startTime = System.currentTimeMillis();
Path jobSpecPath = getPathForURI... | [
"@",
"Override",
"public",
"synchronized",
"void",
"put",
"(",
"JobSpec",
"jobSpec",
")",
"{",
"Preconditions",
".",
"checkState",
"(",
"state",
"(",
")",
"==",
"State",
".",
"RUNNING",
",",
"String",
".",
"format",
"(",
"\"%s is not running.\"",
",",
"this"... | Allow user to programmatically add a new JobSpec.
The method will materialized the jobSpec into real file.
@param jobSpec The target JobSpec Object to be materialized.
Noted that the URI return by getUri is a relative path. | [
"Allow",
"user",
"to",
"programmatically",
"add",
"a",
"new",
"JobSpec",
".",
"The",
"method",
"will",
"materialized",
"the",
"jobSpec",
"into",
"real",
"file",
"."
] | f029b4c0fea0fe4aa62f36dda2512344ff708bae | https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-runtime/src/main/java/org/apache/gobblin/runtime/job_catalog/NonObservingFSJobCatalog.java#L75-L96 |
26,051 | apache/incubator-gobblin | gobblin-runtime/src/main/java/org/apache/gobblin/runtime/job_catalog/NonObservingFSJobCatalog.java | NonObservingFSJobCatalog.remove | @Override
public synchronized void remove(URI jobURI) {
Preconditions.checkState(state() == State.RUNNING, String.format("%s is not running.", this.getClass().getName()));
try {
long startTime = System.currentTimeMillis();
JobSpec jobSpec = getJobSpec(jobURI);
Path jobSpecPath = getPathForUR... | java | @Override
public synchronized void remove(URI jobURI) {
Preconditions.checkState(state() == State.RUNNING, String.format("%s is not running.", this.getClass().getName()));
try {
long startTime = System.currentTimeMillis();
JobSpec jobSpec = getJobSpec(jobURI);
Path jobSpecPath = getPathForUR... | [
"@",
"Override",
"public",
"synchronized",
"void",
"remove",
"(",
"URI",
"jobURI",
")",
"{",
"Preconditions",
".",
"checkState",
"(",
"state",
"(",
")",
"==",
"State",
".",
"RUNNING",
",",
"String",
".",
"format",
"(",
"\"%s is not running.\"",
",",
"this",
... | Allow user to programmatically delete a new JobSpec.
This method is designed to be reentrant.
@param jobURI The relative Path that specified by user, need to make it into complete path. | [
"Allow",
"user",
"to",
"programmatically",
"delete",
"a",
"new",
"JobSpec",
".",
"This",
"method",
"is",
"designed",
"to",
"be",
"reentrant",
"."
] | f029b4c0fea0fe4aa62f36dda2512344ff708bae | https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-runtime/src/main/java/org/apache/gobblin/runtime/job_catalog/NonObservingFSJobCatalog.java#L103-L123 |
26,052 | apache/incubator-gobblin | gobblin-metrics-libs/gobblin-metrics-base/src/main/java/org/apache/gobblin/metrics/reporter/MetricReportReporter.java | MetricReportReporter.serializeValue | protected Metric serializeValue(String name, Number value, String... path) {
return new Metric(MetricRegistry.name(name, path), value.doubleValue());
} | java | protected Metric serializeValue(String name, Number value, String... path) {
return new Metric(MetricRegistry.name(name, path), value.doubleValue());
} | [
"protected",
"Metric",
"serializeValue",
"(",
"String",
"name",
",",
"Number",
"value",
",",
"String",
"...",
"path",
")",
"{",
"return",
"new",
"Metric",
"(",
"MetricRegistry",
".",
"name",
"(",
"name",
",",
"path",
")",
",",
"value",
".",
"doubleValue",
... | Converts a single key-value pair into a metric.
@param name name of the metric
@param value value of the metric to report
@param path additional suffixes to further identify the meaning of the reported value
@return a {@link org.apache.gobblin.metrics.Metric}. | [
"Converts",
"a",
"single",
"key",
"-",
"value",
"pair",
"into",
"a",
"metric",
"."
] | f029b4c0fea0fe4aa62f36dda2512344ff708bae | https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-metrics-libs/gobblin-metrics-base/src/main/java/org/apache/gobblin/metrics/reporter/MetricReportReporter.java#L243-L245 |
26,053 | apache/incubator-gobblin | gobblin-core/src/main/java/org/apache/gobblin/converter/avro/JsonRecordAvroSchemaToAvroConverter.java | JsonRecordAvroSchemaToAvroConverter.convertSchema | @Override
public Schema convertSchema(SI inputSchema, WorkUnitState workUnit) throws SchemaConversionException {
Preconditions.checkArgument(workUnit.contains(ConfigurationKeys.CONVERTER_AVRO_SCHEMA_KEY));
this.schema = new Schema.Parser().parse(workUnit.getProp(ConfigurationKeys.CONVERTER_AVRO_SCHEMA_KEY));
... | java | @Override
public Schema convertSchema(SI inputSchema, WorkUnitState workUnit) throws SchemaConversionException {
Preconditions.checkArgument(workUnit.contains(ConfigurationKeys.CONVERTER_AVRO_SCHEMA_KEY));
this.schema = new Schema.Parser().parse(workUnit.getProp(ConfigurationKeys.CONVERTER_AVRO_SCHEMA_KEY));
... | [
"@",
"Override",
"public",
"Schema",
"convertSchema",
"(",
"SI",
"inputSchema",
",",
"WorkUnitState",
"workUnit",
")",
"throws",
"SchemaConversionException",
"{",
"Preconditions",
".",
"checkArgument",
"(",
"workUnit",
".",
"contains",
"(",
"ConfigurationKeys",
".",
... | Ignore input schema and parse in Avro schema from config | [
"Ignore",
"input",
"schema",
"and",
"parse",
"in",
"Avro",
"schema",
"from",
"config"
] | f029b4c0fea0fe4aa62f36dda2512344ff708bae | https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-core/src/main/java/org/apache/gobblin/converter/avro/JsonRecordAvroSchemaToAvroConverter.java#L58-L63 |
26,054 | apache/incubator-gobblin | gobblin-config-management/gobblin-config-client/src/main/java/org/apache/gobblin/config/client/ConfigClientUtils.java | ConfigClientUtils.isAncestorOrSame | public static boolean isAncestorOrSame(URI descendant, URI ancestor) {
Preconditions.checkNotNull(descendant, "input can not be null");
Preconditions.checkNotNull(ancestor, "input can not be null");
if (!stringSame(descendant.getScheme(), ancestor.getScheme())) {
return false;
}
if (!stringS... | java | public static boolean isAncestorOrSame(URI descendant, URI ancestor) {
Preconditions.checkNotNull(descendant, "input can not be null");
Preconditions.checkNotNull(ancestor, "input can not be null");
if (!stringSame(descendant.getScheme(), ancestor.getScheme())) {
return false;
}
if (!stringS... | [
"public",
"static",
"boolean",
"isAncestorOrSame",
"(",
"URI",
"descendant",
",",
"URI",
"ancestor",
")",
"{",
"Preconditions",
".",
"checkNotNull",
"(",
"descendant",
",",
"\"input can not be null\"",
")",
";",
"Preconditions",
".",
"checkNotNull",
"(",
"ancestor",... | Utility method to check whether one URI is the ancestor of the other
return true iff both URI's scheme/authority name match and ancestor's path is the prefix of the descendant's path
@param descendant: the descendant URI to check
@param ancestor : the ancestor URI to check
@return | [
"Utility",
"method",
"to",
"check",
"whether",
"one",
"URI",
"is",
"the",
"ancestor",
"of",
"the",
"other"
] | f029b4c0fea0fe4aa62f36dda2512344ff708bae | https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-config-management/gobblin-config-client/src/main/java/org/apache/gobblin/config/client/ConfigClientUtils.java#L156-L169 |
26,055 | apache/incubator-gobblin | gobblin-modules/gobblin-kafka-common/src/main/java/org/apache/gobblin/kafka/schemareg/ConfigDrivenMd5SchemaRegistry.java | ConfigDrivenMd5SchemaRegistry.register | @Override
public synchronized MD5Digest register(String name, Schema schema)
throws IOException, SchemaRegistryException {
MD5Digest md5Digest = generateId(schema);
if (!_schemaHashMap.containsKey(md5Digest)) {
_schemaHashMap.put(md5Digest, schema);
_topicSchemaMap.put(name, schema);
}
... | java | @Override
public synchronized MD5Digest register(String name, Schema schema)
throws IOException, SchemaRegistryException {
MD5Digest md5Digest = generateId(schema);
if (!_schemaHashMap.containsKey(md5Digest)) {
_schemaHashMap.put(md5Digest, schema);
_topicSchemaMap.put(name, schema);
}
... | [
"@",
"Override",
"public",
"synchronized",
"MD5Digest",
"register",
"(",
"String",
"name",
",",
"Schema",
"schema",
")",
"throws",
"IOException",
",",
"SchemaRegistryException",
"{",
"MD5Digest",
"md5Digest",
"=",
"generateId",
"(",
"schema",
")",
";",
"if",
"("... | Register this schema under the provided name
@param name
@param schema
@return
@throws IOException
@throws SchemaRegistryException | [
"Register",
"this",
"schema",
"under",
"the",
"provided",
"name"
] | f029b4c0fea0fe4aa62f36dda2512344ff708bae | https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-modules/gobblin-kafka-common/src/main/java/org/apache/gobblin/kafka/schemareg/ConfigDrivenMd5SchemaRegistry.java#L94-L104 |
26,056 | apache/incubator-gobblin | gobblin-modules/gobblin-kafka-common/src/main/java/org/apache/gobblin/kafka/schemareg/ConfigDrivenMd5SchemaRegistry.java | ConfigDrivenMd5SchemaRegistry.getById | @Override
public Schema getById(MD5Digest id)
throws IOException, SchemaRegistryException {
if (_schemaHashMap.containsKey(id))
{
return _schemaHashMap.get(id);
}
else
{
throw new SchemaRegistryException("Could not find schema with id : " + id.asString());
}
... | java | @Override
public Schema getById(MD5Digest id)
throws IOException, SchemaRegistryException {
if (_schemaHashMap.containsKey(id))
{
return _schemaHashMap.get(id);
}
else
{
throw new SchemaRegistryException("Could not find schema with id : " + id.asString());
}
... | [
"@",
"Override",
"public",
"Schema",
"getById",
"(",
"MD5Digest",
"id",
")",
"throws",
"IOException",
",",
"SchemaRegistryException",
"{",
"if",
"(",
"_schemaHashMap",
".",
"containsKey",
"(",
"id",
")",
")",
"{",
"return",
"_schemaHashMap",
".",
"get",
"(",
... | Get a schema given an id
@param id
@return
@throws IOException
@throws SchemaRegistryException | [
"Get",
"a",
"schema",
"given",
"an",
"id"
] | f029b4c0fea0fe4aa62f36dda2512344ff708bae | https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-modules/gobblin-kafka-common/src/main/java/org/apache/gobblin/kafka/schemareg/ConfigDrivenMd5SchemaRegistry.java#L113-L124 |
26,057 | apache/incubator-gobblin | gobblin-compaction/src/main/java/org/apache/gobblin/compaction/verify/InputRecordCountHelper.java | InputRecordCountHelper.calculateRecordCount | public long calculateRecordCount (Collection<Path> paths) throws IOException {
long sum = 0;
for (Path path: paths) {
sum += inputRecordCountProvider.getRecordCount(DatasetHelper.getApplicableFilePaths(this.fs, path, Lists.newArrayList(AVRO)));
}
return sum;
} | java | public long calculateRecordCount (Collection<Path> paths) throws IOException {
long sum = 0;
for (Path path: paths) {
sum += inputRecordCountProvider.getRecordCount(DatasetHelper.getApplicableFilePaths(this.fs, path, Lists.newArrayList(AVRO)));
}
return sum;
} | [
"public",
"long",
"calculateRecordCount",
"(",
"Collection",
"<",
"Path",
">",
"paths",
")",
"throws",
"IOException",
"{",
"long",
"sum",
"=",
"0",
";",
"for",
"(",
"Path",
"path",
":",
"paths",
")",
"{",
"sum",
"+=",
"inputRecordCountProvider",
".",
"getR... | Calculate record count at given paths
@param paths all paths where the record count are calculated
@return record count after parsing all files under given paths | [
"Calculate",
"record",
"count",
"at",
"given",
"paths"
] | f029b4c0fea0fe4aa62f36dda2512344ff708bae | https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-compaction/src/main/java/org/apache/gobblin/compaction/verify/InputRecordCountHelper.java#L88-L94 |
26,058 | apache/incubator-gobblin | gobblin-compaction/src/main/java/org/apache/gobblin/compaction/verify/InputRecordCountHelper.java | InputRecordCountHelper.saveState | public void saveState (Path dir, State state) throws IOException {
saveState(this.fs, dir, state);
} | java | public void saveState (Path dir, State state) throws IOException {
saveState(this.fs, dir, state);
} | [
"public",
"void",
"saveState",
"(",
"Path",
"dir",
",",
"State",
"state",
")",
"throws",
"IOException",
"{",
"saveState",
"(",
"this",
".",
"fs",
",",
"dir",
",",
"state",
")",
";",
"}"
] | Save compaction state file | [
"Save",
"compaction",
"state",
"file"
] | f029b4c0fea0fe4aa62f36dda2512344ff708bae | https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-compaction/src/main/java/org/apache/gobblin/compaction/verify/InputRecordCountHelper.java#L116-L118 |
26,059 | apache/incubator-gobblin | gobblin-utility/src/main/java/org/apache/gobblin/util/executors/ScalingQueue.java | ScalingQueue.offer | @Override
public synchronized boolean offer(Runnable runnable) {
int allWorkingThreads = this.executor.getActiveCount() + super.size();
return allWorkingThreads < this.executor.getPoolSize() && super.offer(runnable);
} | java | @Override
public synchronized boolean offer(Runnable runnable) {
int allWorkingThreads = this.executor.getActiveCount() + super.size();
return allWorkingThreads < this.executor.getPoolSize() && super.offer(runnable);
} | [
"@",
"Override",
"public",
"synchronized",
"boolean",
"offer",
"(",
"Runnable",
"runnable",
")",
"{",
"int",
"allWorkingThreads",
"=",
"this",
".",
"executor",
".",
"getActiveCount",
"(",
")",
"+",
"super",
".",
"size",
"(",
")",
";",
"return",
"allWorkingTh... | Inserts the specified element at the tail of this queue if there is at least one available thread to run the
current task. If all pool threads are actively busy, it rejects the offer.
@param runnable the element to add.
@return true if it was possible to add the element to this queue, else false
@see ThreadPoolExecuto... | [
"Inserts",
"the",
"specified",
"element",
"at",
"the",
"tail",
"of",
"this",
"queue",
"if",
"there",
"is",
"at",
"least",
"one",
"available",
"thread",
"to",
"run",
"the",
"current",
"task",
".",
"If",
"all",
"pool",
"threads",
"are",
"actively",
"busy",
... | f029b4c0fea0fe4aa62f36dda2512344ff708bae | https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-utility/src/main/java/org/apache/gobblin/util/executors/ScalingQueue.java#L72-L76 |
26,060 | apache/incubator-gobblin | gobblin-restli/gobblin-flow-config-service/gobblin-flow-config-service-server/src/main/java/org/apache/gobblin/service/FlowConfigResourceLocalHandler.java | FlowConfigResourceLocalHandler.getFlowConfig | public FlowConfig getFlowConfig(FlowId flowId) throws FlowConfigLoggedException {
log.info("[GAAS-REST] Get called with flowGroup {} flowName {}", flowId.getFlowGroup(), flowId.getFlowName());
try {
URI flowUri = FlowUriUtils.createFlowSpecUri(flowId);
FlowSpec spec = (FlowSpec) flowCatalog.getSpec... | java | public FlowConfig getFlowConfig(FlowId flowId) throws FlowConfigLoggedException {
log.info("[GAAS-REST] Get called with flowGroup {} flowName {}", flowId.getFlowGroup(), flowId.getFlowName());
try {
URI flowUri = FlowUriUtils.createFlowSpecUri(flowId);
FlowSpec spec = (FlowSpec) flowCatalog.getSpec... | [
"public",
"FlowConfig",
"getFlowConfig",
"(",
"FlowId",
"flowId",
")",
"throws",
"FlowConfigLoggedException",
"{",
"log",
".",
"info",
"(",
"\"[GAAS-REST] Get called with flowGroup {} flowName {}\"",
",",
"flowId",
".",
"getFlowGroup",
"(",
")",
",",
"flowId",
".",
"g... | Get flow config | [
"Get",
"flow",
"config"
] | f029b4c0fea0fe4aa62f36dda2512344ff708bae | https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-restli/gobblin-flow-config-service/gobblin-flow-config-service-server/src/main/java/org/apache/gobblin/service/FlowConfigResourceLocalHandler.java#L61-L104 |
26,061 | apache/incubator-gobblin | gobblin-restli/gobblin-flow-config-service/gobblin-flow-config-service-server/src/main/java/org/apache/gobblin/service/FlowConfigResourceLocalHandler.java | FlowConfigResourceLocalHandler.createFlowConfig | public CreateResponse createFlowConfig(FlowConfig flowConfig, boolean triggerListener) throws FlowConfigLoggedException {
log.info("[GAAS-REST] Create called with flowGroup " + flowConfig.getId().getFlowGroup() + " flowName " + flowConfig.getId().getFlowName());
if (flowConfig.hasExplain()) {
//Return Er... | java | public CreateResponse createFlowConfig(FlowConfig flowConfig, boolean triggerListener) throws FlowConfigLoggedException {
log.info("[GAAS-REST] Create called with flowGroup " + flowConfig.getId().getFlowGroup() + " flowName " + flowConfig.getId().getFlowName());
if (flowConfig.hasExplain()) {
//Return Er... | [
"public",
"CreateResponse",
"createFlowConfig",
"(",
"FlowConfig",
"flowConfig",
",",
"boolean",
"triggerListener",
")",
"throws",
"FlowConfigLoggedException",
"{",
"log",
".",
"info",
"(",
"\"[GAAS-REST] Create called with flowGroup \"",
"+",
"flowConfig",
".",
"getId",
... | Add flowConfig locally and trigger all listeners iff @param triggerListener is set to true | [
"Add",
"flowConfig",
"locally",
"and",
"trigger",
"all",
"listeners",
"iff"
] | f029b4c0fea0fe4aa62f36dda2512344ff708bae | https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-restli/gobblin-flow-config-service/gobblin-flow-config-service-server/src/main/java/org/apache/gobblin/service/FlowConfigResourceLocalHandler.java#L109-L127 |
26,062 | apache/incubator-gobblin | gobblin-restli/gobblin-flow-config-service/gobblin-flow-config-service-server/src/main/java/org/apache/gobblin/service/FlowConfigResourceLocalHandler.java | FlowConfigResourceLocalHandler.updateFlowConfig | public UpdateResponse updateFlowConfig(FlowId flowId, FlowConfig flowConfig, boolean triggerListener) {
log.info("[GAAS-REST] Update called with flowGroup {} flowName {}", flowId.getFlowGroup(), flowId.getFlowName());
if (!flowId.getFlowGroup().equals(flowConfig.getId().getFlowGroup()) || !flowId.getFlowName()... | java | public UpdateResponse updateFlowConfig(FlowId flowId, FlowConfig flowConfig, boolean triggerListener) {
log.info("[GAAS-REST] Update called with flowGroup {} flowName {}", flowId.getFlowGroup(), flowId.getFlowName());
if (!flowId.getFlowGroup().equals(flowConfig.getId().getFlowGroup()) || !flowId.getFlowName()... | [
"public",
"UpdateResponse",
"updateFlowConfig",
"(",
"FlowId",
"flowId",
",",
"FlowConfig",
"flowConfig",
",",
"boolean",
"triggerListener",
")",
"{",
"log",
".",
"info",
"(",
"\"[GAAS-REST] Update called with flowGroup {} flowName {}\"",
",",
"flowId",
".",
"getFlowGroup... | Update flowConfig locally and trigger all listeners iff @param triggerListener is set to true | [
"Update",
"flowConfig",
"locally",
"and",
"trigger",
"all",
"listeners",
"iff"
] | f029b4c0fea0fe4aa62f36dda2512344ff708bae | https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-restli/gobblin-flow-config-service/gobblin-flow-config-service-server/src/main/java/org/apache/gobblin/service/FlowConfigResourceLocalHandler.java#L139-L155 |
26,063 | apache/incubator-gobblin | gobblin-restli/gobblin-flow-config-service/gobblin-flow-config-service-server/src/main/java/org/apache/gobblin/service/FlowConfigResourceLocalHandler.java | FlowConfigResourceLocalHandler.updateFlowConfig | public UpdateResponse updateFlowConfig(FlowId flowId, FlowConfig flowConfig) throws FlowConfigLoggedException {
return updateFlowConfig(flowId, flowConfig, true);
} | java | public UpdateResponse updateFlowConfig(FlowId flowId, FlowConfig flowConfig) throws FlowConfigLoggedException {
return updateFlowConfig(flowId, flowConfig, true);
} | [
"public",
"UpdateResponse",
"updateFlowConfig",
"(",
"FlowId",
"flowId",
",",
"FlowConfig",
"flowConfig",
")",
"throws",
"FlowConfigLoggedException",
"{",
"return",
"updateFlowConfig",
"(",
"flowId",
",",
"flowConfig",
",",
"true",
")",
";",
"}"
] | Update flowConfig locally and trigger all listeners | [
"Update",
"flowConfig",
"locally",
"and",
"trigger",
"all",
"listeners"
] | f029b4c0fea0fe4aa62f36dda2512344ff708bae | https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-restli/gobblin-flow-config-service/gobblin-flow-config-service-server/src/main/java/org/apache/gobblin/service/FlowConfigResourceLocalHandler.java#L164-L166 |
26,064 | apache/incubator-gobblin | gobblin-restli/gobblin-flow-config-service/gobblin-flow-config-service-server/src/main/java/org/apache/gobblin/service/FlowConfigResourceLocalHandler.java | FlowConfigResourceLocalHandler.deleteFlowConfig | public UpdateResponse deleteFlowConfig(FlowId flowId, Properties header, boolean triggerListener) throws FlowConfigLoggedException {
log.info("[GAAS-REST] Delete called with flowGroup {} flowName {}", flowId.getFlowGroup(), flowId.getFlowName());
URI flowUri = null;
try {
flowUri = FlowUriUtils.crea... | java | public UpdateResponse deleteFlowConfig(FlowId flowId, Properties header, boolean triggerListener) throws FlowConfigLoggedException {
log.info("[GAAS-REST] Delete called with flowGroup {} flowName {}", flowId.getFlowGroup(), flowId.getFlowName());
URI flowUri = null;
try {
flowUri = FlowUriUtils.crea... | [
"public",
"UpdateResponse",
"deleteFlowConfig",
"(",
"FlowId",
"flowId",
",",
"Properties",
"header",
",",
"boolean",
"triggerListener",
")",
"throws",
"FlowConfigLoggedException",
"{",
"log",
".",
"info",
"(",
"\"[GAAS-REST] Delete called with flowGroup {} flowName {}\"",
... | Delete flowConfig locally and trigger all listeners iff @param triggerListener is set to true | [
"Delete",
"flowConfig",
"locally",
"and",
"trigger",
"all",
"listeners",
"iff"
] | f029b4c0fea0fe4aa62f36dda2512344ff708bae | https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-restli/gobblin-flow-config-service/gobblin-flow-config-service-server/src/main/java/org/apache/gobblin/service/FlowConfigResourceLocalHandler.java#L171-L183 |
26,065 | apache/incubator-gobblin | gobblin-restli/gobblin-flow-config-service/gobblin-flow-config-service-server/src/main/java/org/apache/gobblin/service/FlowConfigResourceLocalHandler.java | FlowConfigResourceLocalHandler.deleteFlowConfig | public UpdateResponse deleteFlowConfig(FlowId flowId, Properties header) throws FlowConfigLoggedException {
return deleteFlowConfig(flowId, header, true);
} | java | public UpdateResponse deleteFlowConfig(FlowId flowId, Properties header) throws FlowConfigLoggedException {
return deleteFlowConfig(flowId, header, true);
} | [
"public",
"UpdateResponse",
"deleteFlowConfig",
"(",
"FlowId",
"flowId",
",",
"Properties",
"header",
")",
"throws",
"FlowConfigLoggedException",
"{",
"return",
"deleteFlowConfig",
"(",
"flowId",
",",
"header",
",",
"true",
")",
";",
"}"
] | Delete flowConfig locally and trigger all listeners | [
"Delete",
"flowConfig",
"locally",
"and",
"trigger",
"all",
"listeners"
] | f029b4c0fea0fe4aa62f36dda2512344ff708bae | https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-restli/gobblin-flow-config-service/gobblin-flow-config-service-server/src/main/java/org/apache/gobblin/service/FlowConfigResourceLocalHandler.java#L188-L190 |
26,066 | apache/incubator-gobblin | gobblin-modules/gobblin-compliance/src/main/java/org/apache/gobblin/compliance/purger/HivePurgerSource.java | HivePurgerSource.createWorkUnits | protected void createWorkUnits(SourceState state)
throws IOException {
createWorkunitsFromPreviousState(state);
if (this.datasets.isEmpty()) {
return;
}
for (HivePartitionDataset dataset : this.datasets) {
Optional<String> owner = dataset.getOwner();
if (workUnitsExceeded()) {
... | java | protected void createWorkUnits(SourceState state)
throws IOException {
createWorkunitsFromPreviousState(state);
if (this.datasets.isEmpty()) {
return;
}
for (HivePartitionDataset dataset : this.datasets) {
Optional<String> owner = dataset.getOwner();
if (workUnitsExceeded()) {
... | [
"protected",
"void",
"createWorkUnits",
"(",
"SourceState",
"state",
")",
"throws",
"IOException",
"{",
"createWorkunitsFromPreviousState",
"(",
"state",
")",
";",
"if",
"(",
"this",
".",
"datasets",
".",
"isEmpty",
"(",
")",
")",
"{",
"return",
";",
"}",
"f... | This method creates the list of all work units needed for the current execution.
Fresh work units are created for each partition starting from watermark and failed work units from the
previous run will be added to the list. | [
"This",
"method",
"creates",
"the",
"list",
"of",
"all",
"work",
"units",
"needed",
"for",
"the",
"current",
"execution",
".",
"Fresh",
"work",
"units",
"are",
"created",
"for",
"each",
"partition",
"starting",
"from",
"watermark",
"and",
"failed",
"work",
"... | f029b4c0fea0fe4aa62f36dda2512344ff708bae | https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-modules/gobblin-compliance/src/main/java/org/apache/gobblin/compliance/purger/HivePurgerSource.java#L178-L202 |
26,067 | apache/incubator-gobblin | gobblin-modules/gobblin-compliance/src/main/java/org/apache/gobblin/compliance/purger/HivePurgerSource.java | HivePurgerSource.sortHiveDatasets | protected List<HivePartitionDataset> sortHiveDatasets(List<HivePartitionDataset> datasets) {
Collections.sort(datasets, new Comparator<HivePartitionDataset>() {
@Override
public int compare(HivePartitionDataset o1, HivePartitionDataset o2) {
return o1.datasetURN().compareTo(o2.datasetURN());
... | java | protected List<HivePartitionDataset> sortHiveDatasets(List<HivePartitionDataset> datasets) {
Collections.sort(datasets, new Comparator<HivePartitionDataset>() {
@Override
public int compare(HivePartitionDataset o1, HivePartitionDataset o2) {
return o1.datasetURN().compareTo(o2.datasetURN());
... | [
"protected",
"List",
"<",
"HivePartitionDataset",
">",
"sortHiveDatasets",
"(",
"List",
"<",
"HivePartitionDataset",
">",
"datasets",
")",
"{",
"Collections",
".",
"sort",
"(",
"datasets",
",",
"new",
"Comparator",
"<",
"HivePartitionDataset",
">",
"(",
")",
"{"... | Sort all HiveDatasets on the basis of complete name ie dbName.tableName | [
"Sort",
"all",
"HiveDatasets",
"on",
"the",
"basis",
"of",
"complete",
"name",
"ie",
"dbName",
".",
"tableName"
] | f029b4c0fea0fe4aa62f36dda2512344ff708bae | https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-modules/gobblin-compliance/src/main/java/org/apache/gobblin/compliance/purger/HivePurgerSource.java#L220-L228 |
26,068 | apache/incubator-gobblin | gobblin-modules/gobblin-compliance/src/main/java/org/apache/gobblin/compliance/purger/HivePurgerSource.java | HivePurgerSource.createWorkunitsFromPreviousState | protected void createWorkunitsFromPreviousState(SourceState state) {
if (this.lowWatermark.equalsIgnoreCase(ComplianceConfigurationKeys.NO_PREVIOUS_WATERMARK)) {
return;
}
if (Iterables.isEmpty(state.getPreviousWorkUnitStates())) {
return;
}
for (WorkUnitState workUnitState : state.getPr... | java | protected void createWorkunitsFromPreviousState(SourceState state) {
if (this.lowWatermark.equalsIgnoreCase(ComplianceConfigurationKeys.NO_PREVIOUS_WATERMARK)) {
return;
}
if (Iterables.isEmpty(state.getPreviousWorkUnitStates())) {
return;
}
for (WorkUnitState workUnitState : state.getPr... | [
"protected",
"void",
"createWorkunitsFromPreviousState",
"(",
"SourceState",
"state",
")",
"{",
"if",
"(",
"this",
".",
"lowWatermark",
".",
"equalsIgnoreCase",
"(",
"ComplianceConfigurationKeys",
".",
"NO_PREVIOUS_WATERMARK",
")",
")",
"{",
"return",
";",
"}",
"if"... | Add failed work units in a workUnitMap with partition name as Key.
New work units are created using required configuration from the old work unit. | [
"Add",
"failed",
"work",
"units",
"in",
"a",
"workUnitMap",
"with",
"partition",
"name",
"as",
"Key",
".",
"New",
"work",
"units",
"are",
"created",
"using",
"required",
"configuration",
"from",
"the",
"old",
"work",
"unit",
"."
] | f029b4c0fea0fe4aa62f36dda2512344ff708bae | https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-modules/gobblin-compliance/src/main/java/org/apache/gobblin/compliance/purger/HivePurgerSource.java#L234-L262 |
26,069 | apache/incubator-gobblin | gobblin-modules/gobblin-compliance/src/main/java/org/apache/gobblin/compliance/purger/HivePurgerSource.java | HivePurgerSource.setLowWatermark | protected void setLowWatermark(SourceState state) {
this.lowWatermark = getWatermarkFromPreviousWorkUnits(state, ComplianceConfigurationKeys.HIVE_PURGER_WATERMARK);
log.info("Setting low watermark for the job: " + this.lowWatermark);
} | java | protected void setLowWatermark(SourceState state) {
this.lowWatermark = getWatermarkFromPreviousWorkUnits(state, ComplianceConfigurationKeys.HIVE_PURGER_WATERMARK);
log.info("Setting low watermark for the job: " + this.lowWatermark);
} | [
"protected",
"void",
"setLowWatermark",
"(",
"SourceState",
"state",
")",
"{",
"this",
".",
"lowWatermark",
"=",
"getWatermarkFromPreviousWorkUnits",
"(",
"state",
",",
"ComplianceConfigurationKeys",
".",
"HIVE_PURGER_WATERMARK",
")",
";",
"log",
".",
"info",
"(",
"... | Sets the local watermark, which is a class variable. Local watermark is a complete partition name which act as the starting point for the creation of fresh work units. | [
"Sets",
"the",
"local",
"watermark",
"which",
"is",
"a",
"class",
"variable",
".",
"Local",
"watermark",
"is",
"a",
"complete",
"partition",
"name",
"which",
"act",
"as",
"the",
"starting",
"point",
"for",
"the",
"creation",
"of",
"fresh",
"work",
"units",
... | f029b4c0fea0fe4aa62f36dda2512344ff708bae | https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-modules/gobblin-compliance/src/main/java/org/apache/gobblin/compliance/purger/HivePurgerSource.java#L281-L284 |
26,070 | apache/incubator-gobblin | gobblin-modules/gobblin-compliance/src/main/java/org/apache/gobblin/compliance/purger/HivePurgerSource.java | HivePurgerSource.submitCycleCompletionEvent | protected void submitCycleCompletionEvent() {
if (!this.lowWatermark.equalsIgnoreCase(ComplianceConfigurationKeys.NO_PREVIOUS_WATERMARK)) {
return;
}
if (this.executionCount > 1) {
// Cycle completed
Map<String, String> metadata = new HashMap<>();
metadata.put(ComplianceConfiguration... | java | protected void submitCycleCompletionEvent() {
if (!this.lowWatermark.equalsIgnoreCase(ComplianceConfigurationKeys.NO_PREVIOUS_WATERMARK)) {
return;
}
if (this.executionCount > 1) {
// Cycle completed
Map<String, String> metadata = new HashMap<>();
metadata.put(ComplianceConfiguration... | [
"protected",
"void",
"submitCycleCompletionEvent",
"(",
")",
"{",
"if",
"(",
"!",
"this",
".",
"lowWatermark",
".",
"equalsIgnoreCase",
"(",
"ComplianceConfigurationKeys",
".",
"NO_PREVIOUS_WATERMARK",
")",
")",
"{",
"return",
";",
"}",
"if",
"(",
"this",
".",
... | If low watermark is at the reset point, then either cycle is completed or starting for the first time
If executionCount is greater than 1, then cycle is completed
If cycle is completed, executionCount will be reset and cycle completion event will be submitted | [
"If",
"low",
"watermark",
"is",
"at",
"the",
"reset",
"point",
"then",
"either",
"cycle",
"is",
"completed",
"or",
"starting",
"for",
"the",
"first",
"time",
"If",
"executionCount",
"is",
"greater",
"than",
"1",
"then",
"cycle",
"is",
"completed",
"If",
"c... | f029b4c0fea0fe4aa62f36dda2512344ff708bae | https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-modules/gobblin-compliance/src/main/java/org/apache/gobblin/compliance/purger/HivePurgerSource.java#L306-L317 |
26,071 | apache/incubator-gobblin | gobblin-modules/gobblin-compliance/src/main/java/org/apache/gobblin/compliance/purger/HivePurgerSource.java | HivePurgerSource.setJobWatermark | protected void setJobWatermark(SourceState state, String watermark) {
state.setProp(ComplianceConfigurationKeys.HIVE_PURGER_WATERMARK, watermark);
log.info("Setting job watermark for the job: " + watermark);
} | java | protected void setJobWatermark(SourceState state, String watermark) {
state.setProp(ComplianceConfigurationKeys.HIVE_PURGER_WATERMARK, watermark);
log.info("Setting job watermark for the job: " + watermark);
} | [
"protected",
"void",
"setJobWatermark",
"(",
"SourceState",
"state",
",",
"String",
"watermark",
")",
"{",
"state",
".",
"setProp",
"(",
"ComplianceConfigurationKeys",
".",
"HIVE_PURGER_WATERMARK",
",",
"watermark",
")",
";",
"log",
".",
"info",
"(",
"\"Setting jo... | Sets Job Watermark in the SourceState which will be copied to all WorkUnitStates. Job Watermark is a complete partition name.
During next run of this job, fresh work units will be created starting from this partition. | [
"Sets",
"Job",
"Watermark",
"in",
"the",
"SourceState",
"which",
"will",
"be",
"copied",
"to",
"all",
"WorkUnitStates",
".",
"Job",
"Watermark",
"is",
"a",
"complete",
"partition",
"name",
".",
"During",
"next",
"run",
"of",
"this",
"job",
"fresh",
"work",
... | f029b4c0fea0fe4aa62f36dda2512344ff708bae | https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-modules/gobblin-compliance/src/main/java/org/apache/gobblin/compliance/purger/HivePurgerSource.java#L327-L330 |
26,072 | apache/incubator-gobblin | gobblin-modules/gobblin-compliance/src/main/java/org/apache/gobblin/compliance/purger/HivePurgerSource.java | HivePurgerSource.getWatermarkFromPreviousWorkUnits | protected static String getWatermarkFromPreviousWorkUnits(SourceState state, String watermark) {
if (state.getPreviousWorkUnitStates().isEmpty()) {
return ComplianceConfigurationKeys.NO_PREVIOUS_WATERMARK;
}
return state.getPreviousWorkUnitStates().get(0)
.getProp(watermark, ComplianceConfigur... | java | protected static String getWatermarkFromPreviousWorkUnits(SourceState state, String watermark) {
if (state.getPreviousWorkUnitStates().isEmpty()) {
return ComplianceConfigurationKeys.NO_PREVIOUS_WATERMARK;
}
return state.getPreviousWorkUnitStates().get(0)
.getProp(watermark, ComplianceConfigur... | [
"protected",
"static",
"String",
"getWatermarkFromPreviousWorkUnits",
"(",
"SourceState",
"state",
",",
"String",
"watermark",
")",
"{",
"if",
"(",
"state",
".",
"getPreviousWorkUnitStates",
"(",
")",
".",
"isEmpty",
"(",
")",
")",
"{",
"return",
"ComplianceConfig... | Fetches the value of a watermark given its key from the previous run. | [
"Fetches",
"the",
"value",
"of",
"a",
"watermark",
"given",
"its",
"key",
"from",
"the",
"previous",
"run",
"."
] | f029b4c0fea0fe4aa62f36dda2512344ff708bae | https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-modules/gobblin-compliance/src/main/java/org/apache/gobblin/compliance/purger/HivePurgerSource.java#L335-L341 |
26,073 | apache/incubator-gobblin | gobblin-restli/gobblin-restli-utils/src/main/java/org/apache/gobblin/restli/SharedRestClientFactory.java | SharedRestClientFactory.resolveUriPrefix | public static String resolveUriPrefix(Config config, SharedRestClientKey key) throws URISyntaxException, NotConfiguredException {
List<String> connectionPrefixes = parseConnectionPrefixes(config, key);
Preconditions.checkArgument(connectionPrefixes.size() > 0, "No uris found for service " + key.serviceName);
... | java | public static String resolveUriPrefix(Config config, SharedRestClientKey key) throws URISyntaxException, NotConfiguredException {
List<String> connectionPrefixes = parseConnectionPrefixes(config, key);
Preconditions.checkArgument(connectionPrefixes.size() > 0, "No uris found for service " + key.serviceName);
... | [
"public",
"static",
"String",
"resolveUriPrefix",
"(",
"Config",
"config",
",",
"SharedRestClientKey",
"key",
")",
"throws",
"URISyntaxException",
",",
"NotConfiguredException",
"{",
"List",
"<",
"String",
">",
"connectionPrefixes",
"=",
"parseConnectionPrefixes",
"(",
... | Get a uri prefix from the input configuration. | [
"Get",
"a",
"uri",
"prefix",
"from",
"the",
"input",
"configuration",
"."
] | f029b4c0fea0fe4aa62f36dda2512344ff708bae | https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-restli/gobblin-restli-utils/src/main/java/org/apache/gobblin/restli/SharedRestClientFactory.java#L108-L114 |
26,074 | apache/incubator-gobblin | gobblin-restli/gobblin-restli-utils/src/main/java/org/apache/gobblin/restli/SharedRestClientFactory.java | SharedRestClientFactory.parseConnectionPrefixes | public static List<String> parseConnectionPrefixes(Config config, SharedRestClientKey key) throws URISyntaxException, NotConfiguredException {
if (key instanceof UriRestClientKey) {
return Lists.newArrayList(((UriRestClientKey) key).getUri());
}
if (!config.hasPath(SERVER_URI_KEY)) {
throw new ... | java | public static List<String> parseConnectionPrefixes(Config config, SharedRestClientKey key) throws URISyntaxException, NotConfiguredException {
if (key instanceof UriRestClientKey) {
return Lists.newArrayList(((UriRestClientKey) key).getUri());
}
if (!config.hasPath(SERVER_URI_KEY)) {
throw new ... | [
"public",
"static",
"List",
"<",
"String",
">",
"parseConnectionPrefixes",
"(",
"Config",
"config",
",",
"SharedRestClientKey",
"key",
")",
"throws",
"URISyntaxException",
",",
"NotConfiguredException",
"{",
"if",
"(",
"key",
"instanceof",
"UriRestClientKey",
")",
"... | Parse the list of available input prefixes from the input configuration. | [
"Parse",
"the",
"list",
"of",
"available",
"input",
"prefixes",
"from",
"the",
"input",
"configuration",
"."
] | f029b4c0fea0fe4aa62f36dda2512344ff708bae | https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-restli/gobblin-restli-utils/src/main/java/org/apache/gobblin/restli/SharedRestClientFactory.java#L119-L133 |
26,075 | apache/incubator-gobblin | gobblin-restli/gobblin-restli-utils/src/main/java/org/apache/gobblin/restli/SharedRestClientFactory.java | SharedRestClientFactory.resolveUriPrefix | public static String resolveUriPrefix(URI serverURI)
throws URISyntaxException {
if (RESTLI_SCHEMES.contains(serverURI.getScheme())) {
return new URI(serverURI.getScheme(), serverURI.getAuthority(), null, null, null).toString() + "/";
}
throw new RuntimeException("Unrecognized scheme for URI " ... | java | public static String resolveUriPrefix(URI serverURI)
throws URISyntaxException {
if (RESTLI_SCHEMES.contains(serverURI.getScheme())) {
return new URI(serverURI.getScheme(), serverURI.getAuthority(), null, null, null).toString() + "/";
}
throw new RuntimeException("Unrecognized scheme for URI " ... | [
"public",
"static",
"String",
"resolveUriPrefix",
"(",
"URI",
"serverURI",
")",
"throws",
"URISyntaxException",
"{",
"if",
"(",
"RESTLI_SCHEMES",
".",
"contains",
"(",
"serverURI",
".",
"getScheme",
"(",
")",
")",
")",
"{",
"return",
"new",
"URI",
"(",
"serv... | Convert the input URI into a correctly formatted uri prefix. In the future, may also resolve d2 uris. | [
"Convert",
"the",
"input",
"URI",
"into",
"a",
"correctly",
"formatted",
"uri",
"prefix",
".",
"In",
"the",
"future",
"may",
"also",
"resolve",
"d2",
"uris",
"."
] | f029b4c0fea0fe4aa62f36dda2512344ff708bae | https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-restli/gobblin-restli-utils/src/main/java/org/apache/gobblin/restli/SharedRestClientFactory.java#L138-L145 |
26,076 | apache/incubator-gobblin | gobblin-modules/gobblin-metadata/src/main/java/org/apache/gobblin/metadata/types/GlobalMetadata.java | GlobalMetadata.addAll | public void addAll(GlobalMetadata other) {
throwIfImmutable();
datasetLevel.putAll(other.datasetLevel);
for (Map.Entry<String, Map<String, Object>> e : other.fileLevel.entrySet()) {
Map<String, Object> val = new ConcurrentHashMap<>();
val.putAll(e.getValue());
fileLevel.put(e.getKey(), va... | java | public void addAll(GlobalMetadata other) {
throwIfImmutable();
datasetLevel.putAll(other.datasetLevel);
for (Map.Entry<String, Map<String, Object>> e : other.fileLevel.entrySet()) {
Map<String, Object> val = new ConcurrentHashMap<>();
val.putAll(e.getValue());
fileLevel.put(e.getKey(), va... | [
"public",
"void",
"addAll",
"(",
"GlobalMetadata",
"other",
")",
"{",
"throwIfImmutable",
"(",
")",
";",
"datasetLevel",
".",
"putAll",
"(",
"other",
".",
"datasetLevel",
")",
";",
"for",
"(",
"Map",
".",
"Entry",
"<",
"String",
",",
"Map",
"<",
"String"... | Merge another GlobalMetadata object into this one. All keys from 'other' will be placed into
this object, replacing any already existing keys.
@param other Metadata object to add | [
"Merge",
"another",
"GlobalMetadata",
"object",
"into",
"this",
"one",
".",
"All",
"keys",
"from",
"other",
"will",
"be",
"placed",
"into",
"this",
"object",
"replacing",
"any",
"already",
"existing",
"keys",
"."
] | f029b4c0fea0fe4aa62f36dda2512344ff708bae | https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-modules/gobblin-metadata/src/main/java/org/apache/gobblin/metadata/types/GlobalMetadata.java#L104-L115 |
26,077 | apache/incubator-gobblin | gobblin-modules/gobblin-metadata/src/main/java/org/apache/gobblin/metadata/types/GlobalMetadata.java | GlobalMetadata.toJsonUtf8 | public byte[] toJsonUtf8() {
try {
ByteArrayOutputStream bOs = new ByteArrayOutputStream(512);
try (JsonGenerator generator = jsonFactory.createJsonGenerator(bOs, JsonEncoding.UTF8)
.setCodec(objectMapper)) {
toJsonUtf8(generator);
}
return bOs.toByteArray();
} catch ... | java | public byte[] toJsonUtf8() {
try {
ByteArrayOutputStream bOs = new ByteArrayOutputStream(512);
try (JsonGenerator generator = jsonFactory.createJsonGenerator(bOs, JsonEncoding.UTF8)
.setCodec(objectMapper)) {
toJsonUtf8(generator);
}
return bOs.toByteArray();
} catch ... | [
"public",
"byte",
"[",
"]",
"toJsonUtf8",
"(",
")",
"{",
"try",
"{",
"ByteArrayOutputStream",
"bOs",
"=",
"new",
"ByteArrayOutputStream",
"(",
"512",
")",
";",
"try",
"(",
"JsonGenerator",
"generator",
"=",
"jsonFactory",
".",
"createJsonGenerator",
"(",
"bOs"... | Serialize as a UTF8 encoded JSON string. | [
"Serialize",
"as",
"a",
"UTF8",
"encoded",
"JSON",
"string",
"."
] | f029b4c0fea0fe4aa62f36dda2512344ff708bae | https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-modules/gobblin-metadata/src/main/java/org/apache/gobblin/metadata/types/GlobalMetadata.java#L148-L161 |
26,078 | apache/incubator-gobblin | gobblin-modules/gobblin-metadata/src/main/java/org/apache/gobblin/metadata/types/GlobalMetadata.java | GlobalMetadata.bodyToJsonUtf8 | protected void bodyToJsonUtf8(JsonGenerator generator)
throws IOException {
generator.writeObjectField("dataset", datasetLevel);
generator.writeObjectFieldStart("file");
for (Map.Entry<String, Map<String, Object>> entry : fileLevel.entrySet()) {
generator.writeObjectField(entry.getKey(), entry.... | java | protected void bodyToJsonUtf8(JsonGenerator generator)
throws IOException {
generator.writeObjectField("dataset", datasetLevel);
generator.writeObjectFieldStart("file");
for (Map.Entry<String, Map<String, Object>> entry : fileLevel.entrySet()) {
generator.writeObjectField(entry.getKey(), entry.... | [
"protected",
"void",
"bodyToJsonUtf8",
"(",
"JsonGenerator",
"generator",
")",
"throws",
"IOException",
"{",
"generator",
".",
"writeObjectField",
"(",
"\"dataset\"",
",",
"datasetLevel",
")",
";",
"generator",
".",
"writeObjectFieldStart",
"(",
"\"file\"",
")",
";"... | Write this object out to an existing JSON stream | [
"Write",
"this",
"object",
"out",
"to",
"an",
"existing",
"JSON",
"stream"
] | f029b4c0fea0fe4aa62f36dda2512344ff708bae | https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-modules/gobblin-metadata/src/main/java/org/apache/gobblin/metadata/types/GlobalMetadata.java#L187-L197 |
26,079 | apache/incubator-gobblin | gobblin-modules/gobblin-metadata/src/main/java/org/apache/gobblin/metadata/types/GlobalMetadata.java | GlobalMetadata.setDatasetMetadata | public void setDatasetMetadata(String key, Object val) {
throwIfImmutable();
datasetLevel.put(key, val);
cachedId = null;
} | java | public void setDatasetMetadata(String key, Object val) {
throwIfImmutable();
datasetLevel.put(key, val);
cachedId = null;
} | [
"public",
"void",
"setDatasetMetadata",
"(",
"String",
"key",
",",
"Object",
"val",
")",
"{",
"throwIfImmutable",
"(",
")",
";",
"datasetLevel",
".",
"put",
"(",
"key",
",",
"val",
")",
";",
"cachedId",
"=",
"null",
";",
"}"
] | Set an arbitrary dataset-level metadata key | [
"Set",
"an",
"arbitrary",
"dataset",
"-",
"level",
"metadata",
"key"
] | f029b4c0fea0fe4aa62f36dda2512344ff708bae | https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-modules/gobblin-metadata/src/main/java/org/apache/gobblin/metadata/types/GlobalMetadata.java#L268-L272 |
26,080 | apache/incubator-gobblin | gobblin-modules/gobblin-metadata/src/main/java/org/apache/gobblin/metadata/types/GlobalMetadata.java | GlobalMetadata.addTransferEncoding | public synchronized void addTransferEncoding(String encoding) {
throwIfImmutable();
List<String> encodings = getTransferEncoding();
if (encodings == null) {
encodings = new ArrayList<>();
}
encodings.add(encoding);
setDatasetMetadata(TRANSFER_ENCODING_KEY, encodings);
} | java | public synchronized void addTransferEncoding(String encoding) {
throwIfImmutable();
List<String> encodings = getTransferEncoding();
if (encodings == null) {
encodings = new ArrayList<>();
}
encodings.add(encoding);
setDatasetMetadata(TRANSFER_ENCODING_KEY, encodings);
} | [
"public",
"synchronized",
"void",
"addTransferEncoding",
"(",
"String",
"encoding",
")",
"{",
"throwIfImmutable",
"(",
")",
";",
"List",
"<",
"String",
">",
"encodings",
"=",
"getTransferEncoding",
"(",
")",
";",
"if",
"(",
"encodings",
"==",
"null",
")",
"{... | Convenience method to add a new transfer-encoding to a dataset | [
"Convenience",
"method",
"to",
"add",
"a",
"new",
"transfer",
"-",
"encoding",
"to",
"a",
"dataset"
] | f029b4c0fea0fe4aa62f36dda2512344ff708bae | https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-modules/gobblin-metadata/src/main/java/org/apache/gobblin/metadata/types/GlobalMetadata.java#L285-L295 |
26,081 | apache/incubator-gobblin | gobblin-modules/gobblin-metadata/src/main/java/org/apache/gobblin/metadata/types/GlobalMetadata.java | GlobalMetadata.getFileMetadata | public Object getFileMetadata(String file, String key) {
Map<String, Object> fileKeys = fileLevel.get(file);
if (fileKeys == null) {
return null;
}
return fileKeys.get(key);
} | java | public Object getFileMetadata(String file, String key) {
Map<String, Object> fileKeys = fileLevel.get(file);
if (fileKeys == null) {
return null;
}
return fileKeys.get(key);
} | [
"public",
"Object",
"getFileMetadata",
"(",
"String",
"file",
",",
"String",
"key",
")",
"{",
"Map",
"<",
"String",
",",
"Object",
">",
"fileKeys",
"=",
"fileLevel",
".",
"get",
"(",
"file",
")",
";",
"if",
"(",
"fileKeys",
"==",
"null",
")",
"{",
"r... | Get an arbitrary file-level metadata key | [
"Get",
"an",
"arbitrary",
"file",
"-",
"level",
"metadata",
"key"
] | f029b4c0fea0fe4aa62f36dda2512344ff708bae | https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-modules/gobblin-metadata/src/main/java/org/apache/gobblin/metadata/types/GlobalMetadata.java#L313-L320 |
26,082 | apache/incubator-gobblin | gobblin-modules/gobblin-metadata/src/main/java/org/apache/gobblin/metadata/types/GlobalMetadata.java | GlobalMetadata.setFileMetadata | public void setFileMetadata(String file, String key, Object val) {
throwIfImmutable();
Map<String, Object> fileKeys = fileLevel.get(file);
if (fileKeys == null) {
fileKeys = new ConcurrentHashMap<>();
fileLevel.put(file, fileKeys);
}
fileKeys.put(key, val);
cachedId = null;
} | java | public void setFileMetadata(String file, String key, Object val) {
throwIfImmutable();
Map<String, Object> fileKeys = fileLevel.get(file);
if (fileKeys == null) {
fileKeys = new ConcurrentHashMap<>();
fileLevel.put(file, fileKeys);
}
fileKeys.put(key, val);
cachedId = null;
} | [
"public",
"void",
"setFileMetadata",
"(",
"String",
"file",
",",
"String",
"key",
",",
"Object",
"val",
")",
"{",
"throwIfImmutable",
"(",
")",
";",
"Map",
"<",
"String",
",",
"Object",
">",
"fileKeys",
"=",
"fileLevel",
".",
"get",
"(",
"file",
")",
"... | Set an arbitrary file-level metadata key | [
"Set",
"an",
"arbitrary",
"file",
"-",
"level",
"metadata",
"key"
] | f029b4c0fea0fe4aa62f36dda2512344ff708bae | https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-modules/gobblin-metadata/src/main/java/org/apache/gobblin/metadata/types/GlobalMetadata.java#L325-L335 |
26,083 | apache/incubator-gobblin | gobblin-utility/src/main/java/org/apache/gobblin/util/ExponentialBackoff.java | ExponentialBackoff.awaitNextRetry | public void awaitNextRetry() throws InterruptedException, NoMoreRetriesException {
this.retryNumber++;
if (this.retryNumber > this.maxRetries) {
throw new NoMoreRetriesException("Reached maximum number of retries: " + this.maxRetries);
} else if (this.totalWait > this.maxWait) {
throw new NoMore... | java | public void awaitNextRetry() throws InterruptedException, NoMoreRetriesException {
this.retryNumber++;
if (this.retryNumber > this.maxRetries) {
throw new NoMoreRetriesException("Reached maximum number of retries: " + this.maxRetries);
} else if (this.totalWait > this.maxWait) {
throw new NoMore... | [
"public",
"void",
"awaitNextRetry",
"(",
")",
"throws",
"InterruptedException",
",",
"NoMoreRetriesException",
"{",
"this",
".",
"retryNumber",
"++",
";",
"if",
"(",
"this",
".",
"retryNumber",
">",
"this",
".",
"maxRetries",
")",
"{",
"throw",
"new",
"NoMoreR... | Block until next retry can be executed.
This method throws an exception if the max number of retries has been reached. For an alternative see
{@link #awaitNextRetryIfAvailable()}.
@throws NoMoreRetriesException If maximum number of retries has been reached. | [
"Block",
"until",
"next",
"retry",
"can",
"be",
"executed",
"."
] | f029b4c0fea0fe4aa62f36dda2512344ff708bae | https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-utility/src/main/java/org/apache/gobblin/util/ExponentialBackoff.java#L68-L78 |
26,084 | apache/incubator-gobblin | gobblin-utility/src/main/java/org/apache/gobblin/util/ExponentialBackoff.java | ExponentialBackoff.evaluateConditionUntilTrue | @Builder(builderMethodName = "awaitCondition", buildMethodName = "await")
private static boolean evaluateConditionUntilTrue(Callable<Boolean> callable, Double alpha, Integer maxRetries,
Long maxWait, Long maxDelay, Long initialDelay) throws ExecutionException, InterruptedException {
ExponentialBackoff expo... | java | @Builder(builderMethodName = "awaitCondition", buildMethodName = "await")
private static boolean evaluateConditionUntilTrue(Callable<Boolean> callable, Double alpha, Integer maxRetries,
Long maxWait, Long maxDelay, Long initialDelay) throws ExecutionException, InterruptedException {
ExponentialBackoff expo... | [
"@",
"Builder",
"(",
"builderMethodName",
"=",
"\"awaitCondition\"",
",",
"buildMethodName",
"=",
"\"await\"",
")",
"private",
"static",
"boolean",
"evaluateConditionUntilTrue",
"(",
"Callable",
"<",
"Boolean",
">",
"callable",
",",
"Double",
"alpha",
",",
"Integer"... | Evaluate a condition until true with exponential backoff.
@param callable Condition.
@return true if the condition returned true.
@throws ExecutionException if the condition throws an exception. | [
"Evaluate",
"a",
"condition",
"until",
"true",
"with",
"exponential",
"backoff",
"."
] | f029b4c0fea0fe4aa62f36dda2512344ff708bae | https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-utility/src/main/java/org/apache/gobblin/util/ExponentialBackoff.java#L112-L128 |
26,085 | apache/incubator-gobblin | gobblin-compaction/src/main/java/org/apache/gobblin/compaction/mapreduce/avro/MRCompactorAvroKeyDedupJobRunner.java | MRCompactorAvroKeyDedupJobRunner.isKeySchemaValid | public static boolean isKeySchemaValid(Schema keySchema, Schema topicSchema) {
return SchemaCompatibility.checkReaderWriterCompatibility(keySchema, topicSchema).getType()
.equals(SchemaCompatibilityType.COMPATIBLE);
} | java | public static boolean isKeySchemaValid(Schema keySchema, Schema topicSchema) {
return SchemaCompatibility.checkReaderWriterCompatibility(keySchema, topicSchema).getType()
.equals(SchemaCompatibilityType.COMPATIBLE);
} | [
"public",
"static",
"boolean",
"isKeySchemaValid",
"(",
"Schema",
"keySchema",
",",
"Schema",
"topicSchema",
")",
"{",
"return",
"SchemaCompatibility",
".",
"checkReaderWriterCompatibility",
"(",
"keySchema",
",",
"topicSchema",
")",
".",
"getType",
"(",
")",
".",
... | keySchema is valid if a record with newestSchema can be converted to a record with keySchema. | [
"keySchema",
"is",
"valid",
"if",
"a",
"record",
"with",
"newestSchema",
"can",
"be",
"converted",
"to",
"a",
"record",
"with",
"keySchema",
"."
] | f029b4c0fea0fe4aa62f36dda2512344ff708bae | https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-compaction/src/main/java/org/apache/gobblin/compaction/mapreduce/avro/MRCompactorAvroKeyDedupJobRunner.java#L215-L218 |
26,086 | apache/incubator-gobblin | gobblin-core/src/main/java/org/apache/gobblin/async/AsyncRequest.java | AsyncRequest.markRecord | public void markRecord(BufferedRecord<D> record, int bytesWritten) {
synchronized (this) {
thunks.add(new Thunk<>(record, bytesWritten));
byteSize += bytesWritten;
}
} | java | public void markRecord(BufferedRecord<D> record, int bytesWritten) {
synchronized (this) {
thunks.add(new Thunk<>(record, bytesWritten));
byteSize += bytesWritten;
}
} | [
"public",
"void",
"markRecord",
"(",
"BufferedRecord",
"<",
"D",
">",
"record",
",",
"int",
"bytesWritten",
")",
"{",
"synchronized",
"(",
"this",
")",
"{",
"thunks",
".",
"add",
"(",
"new",
"Thunk",
"<>",
"(",
"record",
",",
"bytesWritten",
")",
")",
... | Mark the record associated with this request
@param record buffered record
@param bytesWritten bytes of the record written into the request | [
"Mark",
"the",
"record",
"associated",
"with",
"this",
"request"
] | f029b4c0fea0fe4aa62f36dda2512344ff708bae | https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-core/src/main/java/org/apache/gobblin/async/AsyncRequest.java#L71-L76 |
26,087 | apache/incubator-gobblin | gobblin-runtime/src/main/java/org/apache/gobblin/runtime/mapreduce/MRJobLauncher.java | MRJobLauncher.interruptGracefully | private void interruptGracefully() throws IOException {
LOG.info("Attempting graceful interruption of job " + this.jobContext.getJobId());
this.fs.createNewFile(this.interruptPath);
long waitTimeStart = System.currentTimeMillis();
while (!this.job.isComplete() && System.currentTimeMillis() < waitTimeS... | java | private void interruptGracefully() throws IOException {
LOG.info("Attempting graceful interruption of job " + this.jobContext.getJobId());
this.fs.createNewFile(this.interruptPath);
long waitTimeStart = System.currentTimeMillis();
while (!this.job.isComplete() && System.currentTimeMillis() < waitTimeS... | [
"private",
"void",
"interruptGracefully",
"(",
")",
"throws",
"IOException",
"{",
"LOG",
".",
"info",
"(",
"\"Attempting graceful interruption of job \"",
"+",
"this",
".",
"jobContext",
".",
"getJobId",
"(",
")",
")",
";",
"this",
".",
"fs",
".",
"createNewFile... | Attempt a gracious interruption of the running job | [
"Attempt",
"a",
"gracious",
"interruption",
"of",
"the",
"running",
"job"
] | f029b4c0fea0fe4aa62f36dda2512344ff708bae | https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-runtime/src/main/java/org/apache/gobblin/runtime/mapreduce/MRJobLauncher.java#L333-L351 |
26,088 | apache/incubator-gobblin | gobblin-runtime/src/main/java/org/apache/gobblin/runtime/mapreduce/MRJobLauncher.java | MRJobLauncher.addDependencies | private void addDependencies(Configuration conf) throws IOException {
TimingEvent distributedCacheSetupTimer =
this.eventSubmitter.getTimingEvent(TimingEvent.RunJobTimings.MR_DISTRIBUTED_CACHE_SETUP);
Path jarFileDir = this.jarsDir;
// Add framework jars to the classpath for the mappers/reducer
... | java | private void addDependencies(Configuration conf) throws IOException {
TimingEvent distributedCacheSetupTimer =
this.eventSubmitter.getTimingEvent(TimingEvent.RunJobTimings.MR_DISTRIBUTED_CACHE_SETUP);
Path jarFileDir = this.jarsDir;
// Add framework jars to the classpath for the mappers/reducer
... | [
"private",
"void",
"addDependencies",
"(",
"Configuration",
"conf",
")",
"throws",
"IOException",
"{",
"TimingEvent",
"distributedCacheSetupTimer",
"=",
"this",
".",
"eventSubmitter",
".",
"getTimingEvent",
"(",
"TimingEvent",
".",
"RunJobTimings",
".",
"MR_DISTRIBUTED_... | Add dependent jars and files. | [
"Add",
"dependent",
"jars",
"and",
"files",
"."
] | f029b4c0fea0fe4aa62f36dda2512344ff708bae | https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-runtime/src/main/java/org/apache/gobblin/runtime/mapreduce/MRJobLauncher.java#L363-L396 |
26,089 | apache/incubator-gobblin | gobblin-runtime/src/main/java/org/apache/gobblin/runtime/mapreduce/MRJobLauncher.java | MRJobLauncher.addJars | @SuppressWarnings("deprecation")
private void addJars(Path jarFileDir, String jarFileList, Configuration conf) throws IOException {
LocalFileSystem lfs = FileSystem.getLocal(conf);
for (String jarFile : SPLITTER.split(jarFileList)) {
Path srcJarFile = new Path(jarFile);
FileStatus[] fileStatusList... | java | @SuppressWarnings("deprecation")
private void addJars(Path jarFileDir, String jarFileList, Configuration conf) throws IOException {
LocalFileSystem lfs = FileSystem.getLocal(conf);
for (String jarFile : SPLITTER.split(jarFileList)) {
Path srcJarFile = new Path(jarFile);
FileStatus[] fileStatusList... | [
"@",
"SuppressWarnings",
"(",
"\"deprecation\"",
")",
"private",
"void",
"addJars",
"(",
"Path",
"jarFileDir",
",",
"String",
"jarFileList",
",",
"Configuration",
"conf",
")",
"throws",
"IOException",
"{",
"LocalFileSystem",
"lfs",
"=",
"FileSystem",
".",
"getLoca... | Add framework or job-specific jars to the classpath through DistributedCache
so the mappers can use them. | [
"Add",
"framework",
"or",
"job",
"-",
"specific",
"jars",
"to",
"the",
"classpath",
"through",
"DistributedCache",
"so",
"the",
"mappers",
"can",
"use",
"them",
"."
] | f029b4c0fea0fe4aa62f36dda2512344ff708bae | https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-runtime/src/main/java/org/apache/gobblin/runtime/mapreduce/MRJobLauncher.java#L471-L514 |
26,090 | apache/incubator-gobblin | gobblin-runtime/src/main/java/org/apache/gobblin/runtime/mapreduce/MRJobLauncher.java | MRJobLauncher.addLocalFiles | @SuppressWarnings("deprecation")
private void addLocalFiles(Path jobFileDir, String jobFileList, Configuration conf) throws IOException {
DistributedCache.createSymlink(conf);
for (String jobFile : SPLITTER.split(jobFileList)) {
Path srcJobFile = new Path(jobFile);
// DistributedCache requires abs... | java | @SuppressWarnings("deprecation")
private void addLocalFiles(Path jobFileDir, String jobFileList, Configuration conf) throws IOException {
DistributedCache.createSymlink(conf);
for (String jobFile : SPLITTER.split(jobFileList)) {
Path srcJobFile = new Path(jobFile);
// DistributedCache requires abs... | [
"@",
"SuppressWarnings",
"(",
"\"deprecation\"",
")",
"private",
"void",
"addLocalFiles",
"(",
"Path",
"jobFileDir",
",",
"String",
"jobFileList",
",",
"Configuration",
"conf",
")",
"throws",
"IOException",
"{",
"DistributedCache",
".",
"createSymlink",
"(",
"conf",... | Add local non-jar files the job depends on to DistributedCache. | [
"Add",
"local",
"non",
"-",
"jar",
"files",
"the",
"job",
"depends",
"on",
"to",
"DistributedCache",
"."
] | f029b4c0fea0fe4aa62f36dda2512344ff708bae | https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-runtime/src/main/java/org/apache/gobblin/runtime/mapreduce/MRJobLauncher.java#L530-L545 |
26,091 | apache/incubator-gobblin | gobblin-runtime/src/main/java/org/apache/gobblin/runtime/mapreduce/MRJobLauncher.java | MRJobLauncher.addHDFSFiles | @SuppressWarnings("deprecation")
private void addHDFSFiles(String jobFileList, Configuration conf) {
DistributedCache.createSymlink(conf);
jobFileList = PasswordManager.getInstance(this.jobProps).readPassword(jobFileList);
for (String jobFile : SPLITTER.split(jobFileList)) {
Path srcJobFile = new Pa... | java | @SuppressWarnings("deprecation")
private void addHDFSFiles(String jobFileList, Configuration conf) {
DistributedCache.createSymlink(conf);
jobFileList = PasswordManager.getInstance(this.jobProps).readPassword(jobFileList);
for (String jobFile : SPLITTER.split(jobFileList)) {
Path srcJobFile = new Pa... | [
"@",
"SuppressWarnings",
"(",
"\"deprecation\"",
")",
"private",
"void",
"addHDFSFiles",
"(",
"String",
"jobFileList",
",",
"Configuration",
"conf",
")",
"{",
"DistributedCache",
".",
"createSymlink",
"(",
"conf",
")",
";",
"jobFileList",
"=",
"PasswordManager",
"... | Add non-jar files already on HDFS that the job depends on to DistributedCache. | [
"Add",
"non",
"-",
"jar",
"files",
"already",
"on",
"HDFS",
"that",
"the",
"job",
"depends",
"on",
"to",
"DistributedCache",
"."
] | f029b4c0fea0fe4aa62f36dda2512344ff708bae | https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-runtime/src/main/java/org/apache/gobblin/runtime/mapreduce/MRJobLauncher.java#L550-L562 |
26,092 | apache/incubator-gobblin | gobblin-runtime/src/main/java/org/apache/gobblin/runtime/mapreduce/MRJobLauncher.java | MRJobLauncher.prepareJobInput | private void prepareJobInput(List<WorkUnit> workUnits) throws IOException {
Closer closer = Closer.create();
try {
ParallelRunner parallelRunner = closer.register(new ParallelRunner(this.parallelRunnerThreads, this.fs));
int multiTaskIdSequence = 0;
// Serialize each work unit into a file nam... | java | private void prepareJobInput(List<WorkUnit> workUnits) throws IOException {
Closer closer = Closer.create();
try {
ParallelRunner parallelRunner = closer.register(new ParallelRunner(this.parallelRunnerThreads, this.fs));
int multiTaskIdSequence = 0;
// Serialize each work unit into a file nam... | [
"private",
"void",
"prepareJobInput",
"(",
"List",
"<",
"WorkUnit",
">",
"workUnits",
")",
"throws",
"IOException",
"{",
"Closer",
"closer",
"=",
"Closer",
".",
"create",
"(",
")",
";",
"try",
"{",
"ParallelRunner",
"parallelRunner",
"=",
"closer",
".",
"reg... | Prepare the job input.
@throws IOException | [
"Prepare",
"the",
"job",
"input",
"."
] | f029b4c0fea0fe4aa62f36dda2512344ff708bae | https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-runtime/src/main/java/org/apache/gobblin/runtime/mapreduce/MRJobLauncher.java#L581-L609 |
26,093 | apache/incubator-gobblin | gobblin-compaction/src/main/java/org/apache/gobblin/compaction/mapreduce/avro/AvroKeyMapper.java | AvroKeyMapper.populateComparableKeyRecord | private void populateComparableKeyRecord(GenericRecord source, GenericRecord target) {
for (Field field : target.getSchema().getFields()) {
if (field.schema().getType() == Schema.Type.UNION) {
// Since a UNION has multiple types, we need to use induce() to get the actual type in the record.
O... | java | private void populateComparableKeyRecord(GenericRecord source, GenericRecord target) {
for (Field field : target.getSchema().getFields()) {
if (field.schema().getType() == Schema.Type.UNION) {
// Since a UNION has multiple types, we need to use induce() to get the actual type in the record.
O... | [
"private",
"void",
"populateComparableKeyRecord",
"(",
"GenericRecord",
"source",
",",
"GenericRecord",
"target",
")",
"{",
"for",
"(",
"Field",
"field",
":",
"target",
".",
"getSchema",
"(",
")",
".",
"getFields",
"(",
")",
")",
"{",
"if",
"(",
"field",
"... | Populate the target record, based on the field values in the source record.
Target record's schema should be a subset of source record's schema.
Target record's schema cannot have MAP, ARRAY or ENUM fields, or UNION fields that
contain these fields. | [
"Populate",
"the",
"target",
"record",
"based",
"on",
"the",
"field",
"values",
"in",
"the",
"source",
"record",
".",
"Target",
"record",
"s",
"schema",
"should",
"be",
"a",
"subset",
"of",
"source",
"record",
"s",
"schema",
".",
"Target",
"record",
"s",
... | f029b4c0fea0fe4aa62f36dda2512344ff708bae | https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-compaction/src/main/java/org/apache/gobblin/compaction/mapreduce/avro/AvroKeyMapper.java#L86-L119 |
26,094 | apache/incubator-gobblin | gobblin-core/src/main/java/org/apache/gobblin/converter/csv/CsvToJsonConverterV2.java | CsvToJsonConverterV2.convertValue | private JsonElement convertValue(String value, JsonObject dataType) {
if (dataType == null || !dataType.has(TYPE)) {
return new JsonPrimitive(value);
}
String type = dataType.get(TYPE).getAsString().toUpperCase();
ValueType valueType = ValueType.valueOf(type);
return valueType.convert(value);... | java | private JsonElement convertValue(String value, JsonObject dataType) {
if (dataType == null || !dataType.has(TYPE)) {
return new JsonPrimitive(value);
}
String type = dataType.get(TYPE).getAsString().toUpperCase();
ValueType valueType = ValueType.valueOf(type);
return valueType.convert(value);... | [
"private",
"JsonElement",
"convertValue",
"(",
"String",
"value",
",",
"JsonObject",
"dataType",
")",
"{",
"if",
"(",
"dataType",
"==",
"null",
"||",
"!",
"dataType",
".",
"has",
"(",
"TYPE",
")",
")",
"{",
"return",
"new",
"JsonPrimitive",
"(",
"value",
... | Convert string value to the expected type | [
"Convert",
"string",
"value",
"to",
"the",
"expected",
"type"
] | f029b4c0fea0fe4aa62f36dda2512344ff708bae | https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-core/src/main/java/org/apache/gobblin/converter/csv/CsvToJsonConverterV2.java#L219-L227 |
26,095 | apache/incubator-gobblin | gobblin-data-management/src/main/java/org/apache/gobblin/data/management/conversion/hive/writer/HiveQueryExecutionWriter.java | HiveQueryExecutionWriter.addPropsForPublisher | private void addPropsForPublisher(QueryBasedHiveConversionEntity hiveConversionEntity) {
if (!hiveConversionEntity.getPartition().isPresent()) {
return;
}
ConvertibleHiveDataset convertibleHiveDataset = hiveConversionEntity.getConvertibleHiveDataset();
for (String format : convertibleHiveDataset.g... | java | private void addPropsForPublisher(QueryBasedHiveConversionEntity hiveConversionEntity) {
if (!hiveConversionEntity.getPartition().isPresent()) {
return;
}
ConvertibleHiveDataset convertibleHiveDataset = hiveConversionEntity.getConvertibleHiveDataset();
for (String format : convertibleHiveDataset.g... | [
"private",
"void",
"addPropsForPublisher",
"(",
"QueryBasedHiveConversionEntity",
"hiveConversionEntity",
")",
"{",
"if",
"(",
"!",
"hiveConversionEntity",
".",
"getPartition",
"(",
")",
".",
"isPresent",
"(",
")",
")",
"{",
"return",
";",
"}",
"ConvertibleHiveDatas... | Method to add properties needed by publisher to preserve partition params | [
"Method",
"to",
"add",
"properties",
"needed",
"by",
"publisher",
"to",
"preserve",
"partition",
"params"
] | f029b4c0fea0fe4aa62f36dda2512344ff708bae | https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-data-management/src/main/java/org/apache/gobblin/data/management/conversion/hive/writer/HiveQueryExecutionWriter.java#L81-L108 |
26,096 | apache/incubator-gobblin | gobblin-core/src/main/java/org/apache/gobblin/publisher/NoopPublisher.java | NoopPublisher.publishData | @Override
public void publishData(Collection<? extends WorkUnitState> states)
throws IOException {
for (WorkUnitState state: states)
{
if (state.getWorkingState() == WorkUnitState.WorkingState.SUCCESSFUL)
{
state.setWorkingState(WorkUnitState.WorkingState.COMMITTED);
log.info... | java | @Override
public void publishData(Collection<? extends WorkUnitState> states)
throws IOException {
for (WorkUnitState state: states)
{
if (state.getWorkingState() == WorkUnitState.WorkingState.SUCCESSFUL)
{
state.setWorkingState(WorkUnitState.WorkingState.COMMITTED);
log.info... | [
"@",
"Override",
"public",
"void",
"publishData",
"(",
"Collection",
"<",
"?",
"extends",
"WorkUnitState",
">",
"states",
")",
"throws",
"IOException",
"{",
"for",
"(",
"WorkUnitState",
"state",
":",
"states",
")",
"{",
"if",
"(",
"state",
".",
"getWorkingSt... | Publish the data for the given tasks.
@param states | [
"Publish",
"the",
"data",
"for",
"the",
"given",
"tasks",
"."
] | f029b4c0fea0fe4aa62f36dda2512344ff708bae | https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-core/src/main/java/org/apache/gobblin/publisher/NoopPublisher.java#L53-L64 |
26,097 | apache/incubator-gobblin | gobblin-api/src/main/java/org/apache/gobblin/source/workunit/Extract.java | Extract.setFullTrue | @Deprecated
public void setFullTrue(long extractFullRunTime) {
setProp(ConfigurationKeys.EXTRACT_IS_FULL_KEY, true);
setProp(ConfigurationKeys.EXTRACT_FULL_RUN_TIME_KEY, extractFullRunTime);
} | java | @Deprecated
public void setFullTrue(long extractFullRunTime) {
setProp(ConfigurationKeys.EXTRACT_IS_FULL_KEY, true);
setProp(ConfigurationKeys.EXTRACT_FULL_RUN_TIME_KEY, extractFullRunTime);
} | [
"@",
"Deprecated",
"public",
"void",
"setFullTrue",
"(",
"long",
"extractFullRunTime",
")",
"{",
"setProp",
"(",
"ConfigurationKeys",
".",
"EXTRACT_IS_FULL_KEY",
",",
"true",
")",
";",
"setProp",
"(",
"ConfigurationKeys",
".",
"EXTRACT_FULL_RUN_TIME_KEY",
",",
"extr... | Set full drop date from the given time.
@param extractFullRunTime full extract time
@deprecated It is recommend to set this information in {@code WorkUnit} instead of {@code Extract}. | [
"Set",
"full",
"drop",
"date",
"from",
"the",
"given",
"time",
"."
] | f029b4c0fea0fe4aa62f36dda2512344ff708bae | https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-api/src/main/java/org/apache/gobblin/source/workunit/Extract.java#L220-L224 |
26,098 | apache/incubator-gobblin | gobblin-api/src/main/java/org/apache/gobblin/source/workunit/Extract.java | Extract.setPrimaryKeys | @Deprecated
public void setPrimaryKeys(String... primaryKeyFieldName) {
setProp(ConfigurationKeys.EXTRACT_PRIMARY_KEY_FIELDS_KEY, Joiner.on(",").join(primaryKeyFieldName));
} | java | @Deprecated
public void setPrimaryKeys(String... primaryKeyFieldName) {
setProp(ConfigurationKeys.EXTRACT_PRIMARY_KEY_FIELDS_KEY, Joiner.on(",").join(primaryKeyFieldName));
} | [
"@",
"Deprecated",
"public",
"void",
"setPrimaryKeys",
"(",
"String",
"...",
"primaryKeyFieldName",
")",
"{",
"setProp",
"(",
"ConfigurationKeys",
".",
"EXTRACT_PRIMARY_KEY_FIELDS_KEY",
",",
"Joiner",
".",
"on",
"(",
"\",\"",
")",
".",
"join",
"(",
"primaryKeyFiel... | Set primary keys.
<p>
The order of primary keys does not matter.
</p>
@param primaryKeyFieldName primary key names
@deprecated It is recommended to set primary keys in {@code WorkUnit} instead of {@code Extract}. | [
"Set",
"primary",
"keys",
"."
] | f029b4c0fea0fe4aa62f36dda2512344ff708bae | https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-api/src/main/java/org/apache/gobblin/source/workunit/Extract.java#L236-L239 |
26,099 | apache/incubator-gobblin | gobblin-api/src/main/java/org/apache/gobblin/source/workunit/Extract.java | Extract.addPrimaryKey | @Deprecated
public void addPrimaryKey(String... primaryKeyFieldName) {
StringBuilder sb = new StringBuilder(getProp(ConfigurationKeys.EXTRACT_PRIMARY_KEY_FIELDS_KEY, ""));
Joiner.on(",").appendTo(sb, primaryKeyFieldName);
setProp(ConfigurationKeys.EXTRACT_PRIMARY_KEY_FIELDS_KEY, sb.toString());
} | java | @Deprecated
public void addPrimaryKey(String... primaryKeyFieldName) {
StringBuilder sb = new StringBuilder(getProp(ConfigurationKeys.EXTRACT_PRIMARY_KEY_FIELDS_KEY, ""));
Joiner.on(",").appendTo(sb, primaryKeyFieldName);
setProp(ConfigurationKeys.EXTRACT_PRIMARY_KEY_FIELDS_KEY, sb.toString());
} | [
"@",
"Deprecated",
"public",
"void",
"addPrimaryKey",
"(",
"String",
"...",
"primaryKeyFieldName",
")",
"{",
"StringBuilder",
"sb",
"=",
"new",
"StringBuilder",
"(",
"getProp",
"(",
"ConfigurationKeys",
".",
"EXTRACT_PRIMARY_KEY_FIELDS_KEY",
",",
"\"\"",
")",
")",
... | Add more primary keys to the existing set of primary keys.
@param primaryKeyFieldName primary key names
@deprecated @deprecated It is recommended to add primary keys in {@code WorkUnit} instead of {@code Extract}. | [
"Add",
"more",
"primary",
"keys",
"to",
"the",
"existing",
"set",
"of",
"primary",
"keys",
"."
] | f029b4c0fea0fe4aa62f36dda2512344ff708bae | https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-api/src/main/java/org/apache/gobblin/source/workunit/Extract.java#L247-L252 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.