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
25,600
devnied/EMV-NFC-Paycard-Enrollment
library/src/main/java/com/github/devnied/emvnfccard/utils/ResponseUtils.java
ResponseUtils.contains
public static boolean contains(final byte[] pByte, final SwEnum... pEnum) { SwEnum val = SwEnum.getSW(pByte); if (LOGGER.isDebugEnabled() && pByte != null) { LOGGER.debug("Response Status <" + BytesUtils.bytesToStringNoSpace(Arrays.copyOfRange(pByte, Math.max(pByte.length - 2, 0), pByte.length)) + "> : " ...
java
public static boolean contains(final byte[] pByte, final SwEnum... pEnum) { SwEnum val = SwEnum.getSW(pByte); if (LOGGER.isDebugEnabled() && pByte != null) { LOGGER.debug("Response Status <" + BytesUtils.bytesToStringNoSpace(Arrays.copyOfRange(pByte, Math.max(pByte.length - 2, 0), pByte.length)) + "> : " ...
[ "public", "static", "boolean", "contains", "(", "final", "byte", "[", "]", "pByte", ",", "final", "SwEnum", "...", "pEnum", ")", "{", "SwEnum", "val", "=", "SwEnum", ".", "getSW", "(", "pByte", ")", ";", "if", "(", "LOGGER", ".", "isDebugEnabled", "(",...
Method used to check equality with the last command return SW1SW2 == pEnum @param pByte response to the last command @param pEnum responses to check @return true if the response of the last command is contained in pEnum
[ "Method", "used", "to", "check", "equality", "with", "the", "last", "command", "return", "SW1SW2", "==", "pEnum" ]
bfbd3960708689154a7a75c8a9a934197d738a5b
https://github.com/devnied/EMV-NFC-Paycard-Enrollment/blob/bfbd3960708689154a7a75c8a9a934197d738a5b/library/src/main/java/com/github/devnied/emvnfccard/utils/ResponseUtils.java#L75-L83
25,601
devnied/EMV-NFC-Paycard-Enrollment
library/src/main/java/com/github/devnied/emvnfccard/parser/impl/EmvParser.java
EmvParser.extractPublicData
protected boolean extractPublicData(final Application pApplication) throws CommunicationException { boolean ret = false; // Select AID byte[] data = selectAID(pApplication.getAid()); // check response // Add SW_6285 to fix Interact issue if (ResponseUtils.contains(data, SwEnum.SW_9000, SwEnum.SW_6285)) { ...
java
protected boolean extractPublicData(final Application pApplication) throws CommunicationException { boolean ret = false; // Select AID byte[] data = selectAID(pApplication.getAid()); // check response // Add SW_6285 to fix Interact issue if (ResponseUtils.contains(data, SwEnum.SW_9000, SwEnum.SW_6285)) { ...
[ "protected", "boolean", "extractPublicData", "(", "final", "Application", "pApplication", ")", "throws", "CommunicationException", "{", "boolean", "ret", "=", "false", ";", "// Select AID", "byte", "[", "]", "data", "=", "selectAID", "(", "pApplication", ".", "get...
Read public card data from parameter AID @param pApplication application data @return true if succeed false otherwise @throws CommunicationException communication error
[ "Read", "public", "card", "data", "from", "parameter", "AID" ]
bfbd3960708689154a7a75c8a9a934197d738a5b
https://github.com/devnied/EMV-NFC-Paycard-Enrollment/blob/bfbd3960708689154a7a75c8a9a934197d738a5b/library/src/main/java/com/github/devnied/emvnfccard/parser/impl/EmvParser.java#L96-L126
25,602
devnied/EMV-NFC-Paycard-Enrollment
library/src/main/java/com/github/devnied/emvnfccard/parser/impl/EmvParser.java
EmvParser.findCardScheme
protected EmvCardScheme findCardScheme(final String pAid, final String pCardNumber) { EmvCardScheme type = EmvCardScheme.getCardTypeByAid(pAid); // Get real type for french card if (type == EmvCardScheme.CB) { type = EmvCardScheme.getCardTypeByCardNumber(pCardNumber); if (type != null) { LOGGER.debug("R...
java
protected EmvCardScheme findCardScheme(final String pAid, final String pCardNumber) { EmvCardScheme type = EmvCardScheme.getCardTypeByAid(pAid); // Get real type for french card if (type == EmvCardScheme.CB) { type = EmvCardScheme.getCardTypeByCardNumber(pCardNumber); if (type != null) { LOGGER.debug("R...
[ "protected", "EmvCardScheme", "findCardScheme", "(", "final", "String", "pAid", ",", "final", "String", "pCardNumber", ")", "{", "EmvCardScheme", "type", "=", "EmvCardScheme", ".", "getCardTypeByAid", "(", "pAid", ")", ";", "// Get real type for french card", "if", ...
Method used to find the real card scheme @param pAid card complete AID @param pCardNumber card number @return card scheme
[ "Method", "used", "to", "find", "the", "real", "card", "scheme" ]
bfbd3960708689154a7a75c8a9a934197d738a5b
https://github.com/devnied/EMV-NFC-Paycard-Enrollment/blob/bfbd3960708689154a7a75c8a9a934197d738a5b/library/src/main/java/com/github/devnied/emvnfccard/parser/impl/EmvParser.java#L137-L147
25,603
devnied/EMV-NFC-Paycard-Enrollment
library/src/main/java/com/github/devnied/emvnfccard/parser/impl/EmvParser.java
EmvParser.parse
protected boolean parse(final byte[] pSelectResponse, final Application pApplication) throws CommunicationException { boolean ret = false; // Get TLV log entry byte[] logEntry = getLogEntry(pSelectResponse); // Get PDOL byte[] pdol = TlvUtil.getValue(pSelectResponse, EmvTags.PDOL); // Send GPO Command byt...
java
protected boolean parse(final byte[] pSelectResponse, final Application pApplication) throws CommunicationException { boolean ret = false; // Get TLV log entry byte[] logEntry = getLogEntry(pSelectResponse); // Get PDOL byte[] pdol = TlvUtil.getValue(pSelectResponse, EmvTags.PDOL); // Send GPO Command byt...
[ "protected", "boolean", "parse", "(", "final", "byte", "[", "]", "pSelectResponse", ",", "final", "Application", "pApplication", ")", "throws", "CommunicationException", "{", "boolean", "ret", "=", "false", ";", "// Get TLV log entry", "byte", "[", "]", "logEntry"...
Method used to parse EMV card @param pSelectResponse select response data @param pApplication application selected @return true if the parsing succeed false otherwise @throws CommunicationException communication error
[ "Method", "used", "to", "parse", "EMV", "card" ]
bfbd3960708689154a7a75c8a9a934197d738a5b
https://github.com/devnied/EMV-NFC-Paycard-Enrollment/blob/bfbd3960708689154a7a75c8a9a934197d738a5b/library/src/main/java/com/github/devnied/emvnfccard/parser/impl/EmvParser.java#L161-L198
25,604
devnied/EMV-NFC-Paycard-Enrollment
library/src/main/java/com/github/devnied/emvnfccard/parser/impl/EmvParser.java
EmvParser.extractCommonsCardData
protected boolean extractCommonsCardData(final byte[] pGpo) throws CommunicationException { boolean ret = false; // Extract data from Message Template 1 byte data[] = TlvUtil.getValue(pGpo, EmvTags.RESPONSE_MESSAGE_TEMPLATE_1); if (data != null) { data = ArrayUtils.subarray(data, 2, data.length); } else { ...
java
protected boolean extractCommonsCardData(final byte[] pGpo) throws CommunicationException { boolean ret = false; // Extract data from Message Template 1 byte data[] = TlvUtil.getValue(pGpo, EmvTags.RESPONSE_MESSAGE_TEMPLATE_1); if (data != null) { data = ArrayUtils.subarray(data, 2, data.length); } else { ...
[ "protected", "boolean", "extractCommonsCardData", "(", "final", "byte", "[", "]", "pGpo", ")", "throws", "CommunicationException", "{", "boolean", "ret", "=", "false", ";", "// Extract data from Message Template 1", "byte", "data", "[", "]", "=", "TlvUtil", ".", "...
Method used to extract commons card data @param pGpo global processing options response @return true if the extraction succeed @throws CommunicationException communication error
[ "Method", "used", "to", "extract", "commons", "card", "data" ]
bfbd3960708689154a7a75c8a9a934197d738a5b
https://github.com/devnied/EMV-NFC-Paycard-Enrollment/blob/bfbd3960708689154a7a75c8a9a934197d738a5b/library/src/main/java/com/github/devnied/emvnfccard/parser/impl/EmvParser.java#L208-L243
25,605
devnied/EMV-NFC-Paycard-Enrollment
library/src/main/java/com/github/devnied/emvnfccard/parser/impl/EmvParser.java
EmvParser.extractAfl
protected List<Afl> extractAfl(final byte[] pAfl) { List<Afl> list = new ArrayList<Afl>(); ByteArrayInputStream bai = new ByteArrayInputStream(pAfl); while (bai.available() >= 4) { Afl afl = new Afl(); afl.setSfi(bai.read() >> 3); afl.setFirstRecord(bai.read()); afl.setLastRecord(bai.read()); afl.s...
java
protected List<Afl> extractAfl(final byte[] pAfl) { List<Afl> list = new ArrayList<Afl>(); ByteArrayInputStream bai = new ByteArrayInputStream(pAfl); while (bai.available() >= 4) { Afl afl = new Afl(); afl.setSfi(bai.read() >> 3); afl.setFirstRecord(bai.read()); afl.setLastRecord(bai.read()); afl.s...
[ "protected", "List", "<", "Afl", ">", "extractAfl", "(", "final", "byte", "[", "]", "pAfl", ")", "{", "List", "<", "Afl", ">", "list", "=", "new", "ArrayList", "<", "Afl", ">", "(", ")", ";", "ByteArrayInputStream", "bai", "=", "new", "ByteArrayInputSt...
Extract list of application file locator from Afl response @param pAfl AFL data @return list of AFL
[ "Extract", "list", "of", "application", "file", "locator", "from", "Afl", "response" ]
bfbd3960708689154a7a75c8a9a934197d738a5b
https://github.com/devnied/EMV-NFC-Paycard-Enrollment/blob/bfbd3960708689154a7a75c8a9a934197d738a5b/library/src/main/java/com/github/devnied/emvnfccard/parser/impl/EmvParser.java#L253-L265
25,606
devnied/EMV-NFC-Paycard-Enrollment
library/src/main/java/com/github/devnied/emvnfccard/parser/impl/EmvParser.java
EmvParser.getGetProcessingOptions
protected byte[] getGetProcessingOptions(final byte[] pPdol) throws CommunicationException { // List Tag and length from PDOL List<TagAndLength> list = TlvUtil.parseTagAndLength(pPdol); ByteArrayOutputStream out = new ByteArrayOutputStream(); try { out.write(EmvTags.COMMAND_TEMPLATE.getTagBytes()); // COMMAN...
java
protected byte[] getGetProcessingOptions(final byte[] pPdol) throws CommunicationException { // List Tag and length from PDOL List<TagAndLength> list = TlvUtil.parseTagAndLength(pPdol); ByteArrayOutputStream out = new ByteArrayOutputStream(); try { out.write(EmvTags.COMMAND_TEMPLATE.getTagBytes()); // COMMAN...
[ "protected", "byte", "[", "]", "getGetProcessingOptions", "(", "final", "byte", "[", "]", "pPdol", ")", "throws", "CommunicationException", "{", "// List Tag and length from PDOL", "List", "<", "TagAndLength", ">", "list", "=", "TlvUtil", ".", "parseTagAndLength", "...
Method used to create GPO command and execute it @param pPdol PDOL raw data @return return data @throws CommunicationException communication error
[ "Method", "used", "to", "create", "GPO", "command", "and", "execute", "it" ]
bfbd3960708689154a7a75c8a9a934197d738a5b
https://github.com/devnied/EMV-NFC-Paycard-Enrollment/blob/bfbd3960708689154a7a75c8a9a934197d738a5b/library/src/main/java/com/github/devnied/emvnfccard/parser/impl/EmvParser.java#L275-L292
25,607
devnied/EMV-NFC-Paycard-Enrollment
library/src/main/java/com/github/devnied/emvnfccard/parser/impl/EmvParser.java
EmvParser.extractTrackData
protected boolean extractTrackData(final EmvCard pEmvCard, final byte[] pData) { template.get().getCard().setTrack1(TrackUtils.extractTrack1Data(TlvUtil.getValue(pData, EmvTags.TRACK1_DATA))); template.get().getCard().setTrack2(TrackUtils.extractTrack2EquivalentData(TlvUtil.getValue(pData, EmvTags.TRACK_2_EQV_DATA,...
java
protected boolean extractTrackData(final EmvCard pEmvCard, final byte[] pData) { template.get().getCard().setTrack1(TrackUtils.extractTrack1Data(TlvUtil.getValue(pData, EmvTags.TRACK1_DATA))); template.get().getCard().setTrack2(TrackUtils.extractTrack2EquivalentData(TlvUtil.getValue(pData, EmvTags.TRACK_2_EQV_DATA,...
[ "protected", "boolean", "extractTrackData", "(", "final", "EmvCard", "pEmvCard", ",", "final", "byte", "[", "]", "pData", ")", "{", "template", ".", "get", "(", ")", ".", "getCard", "(", ")", ".", "setTrack1", "(", "TrackUtils", ".", "extractTrack1Data", "...
Method used to extract track data from response @param pEmvCard Card data @param pData data send by card @return true if track 1 or track 2 can be read
[ "Method", "used", "to", "extract", "track", "data", "from", "response" ]
bfbd3960708689154a7a75c8a9a934197d738a5b
https://github.com/devnied/EMV-NFC-Paycard-Enrollment/blob/bfbd3960708689154a7a75c8a9a934197d738a5b/library/src/main/java/com/github/devnied/emvnfccard/parser/impl/EmvParser.java#L303-L307
25,608
devnied/EMV-NFC-Paycard-Enrollment
library/src/main/java/com/github/devnied/emvnfccard/parser/apdu/annotation/AnnotationUtils.java
AnnotationUtils.extractAnnotation
private void extractAnnotation() { for (Class<? extends IFile> clazz : LISTE_CLASS) { Map<ITag, AnnotationData> maps = new HashMap<ITag, AnnotationData>(); Set<AnnotationData> set = new TreeSet<AnnotationData>(); Field[] fields = clazz.getDeclaredFields(); for (Field field : fields) { AnnotationData...
java
private void extractAnnotation() { for (Class<? extends IFile> clazz : LISTE_CLASS) { Map<ITag, AnnotationData> maps = new HashMap<ITag, AnnotationData>(); Set<AnnotationData> set = new TreeSet<AnnotationData>(); Field[] fields = clazz.getDeclaredFields(); for (Field field : fields) { AnnotationData...
[ "private", "void", "extractAnnotation", "(", ")", "{", "for", "(", "Class", "<", "?", "extends", "IFile", ">", "clazz", ":", "LISTE_CLASS", ")", "{", "Map", "<", "ITag", ",", "AnnotationData", ">", "maps", "=", "new", "HashMap", "<", "ITag", ",", "Anno...
Method to extract all annotation information and store them in the map
[ "Method", "to", "extract", "all", "annotation", "information", "and", "store", "them", "in", "the", "map" ]
bfbd3960708689154a7a75c8a9a934197d738a5b
https://github.com/devnied/EMV-NFC-Paycard-Enrollment/blob/bfbd3960708689154a7a75c8a9a934197d738a5b/library/src/main/java/com/github/devnied/emvnfccard/parser/apdu/annotation/AnnotationUtils.java#L75-L100
25,609
devnied/EMV-NFC-Paycard-Enrollment
library/src/main/java/com/github/devnied/emvnfccard/model/EmvCard.java
EmvCard.getHolderLastname
public String getHolderLastname() { String ret = holderLastname; if (ret == null && track1 != null) { ret = track1.getHolderLastname(); } return ret; }
java
public String getHolderLastname() { String ret = holderLastname; if (ret == null && track1 != null) { ret = track1.getHolderLastname(); } return ret; }
[ "public", "String", "getHolderLastname", "(", ")", "{", "String", "ret", "=", "holderLastname", ";", "if", "(", "ret", "==", "null", "&&", "track1", "!=", "null", ")", "{", "ret", "=", "track1", ".", "getHolderLastname", "(", ")", ";", "}", "return", "...
Method used to get the field holderLastname @return the holderLastname
[ "Method", "used", "to", "get", "the", "field", "holderLastname" ]
bfbd3960708689154a7a75c8a9a934197d738a5b
https://github.com/devnied/EMV-NFC-Paycard-Enrollment/blob/bfbd3960708689154a7a75c8a9a934197d738a5b/library/src/main/java/com/github/devnied/emvnfccard/model/EmvCard.java#L104-L110
25,610
devnied/EMV-NFC-Paycard-Enrollment
library/src/main/java/com/github/devnied/emvnfccard/model/EmvCard.java
EmvCard.getHolderFirstname
public String getHolderFirstname() { String ret = holderFirstname; if (ret == null && track1 != null) { ret = track1.getHolderFirstname(); } return ret; }
java
public String getHolderFirstname() { String ret = holderFirstname; if (ret == null && track1 != null) { ret = track1.getHolderFirstname(); } return ret; }
[ "public", "String", "getHolderFirstname", "(", ")", "{", "String", "ret", "=", "holderFirstname", ";", "if", "(", "ret", "==", "null", "&&", "track1", "!=", "null", ")", "{", "ret", "=", "track1", ".", "getHolderFirstname", "(", ")", ";", "}", "return", ...
Method used to get the field holderFirstname @return the holderFirstname
[ "Method", "used", "to", "get", "the", "field", "holderFirstname" ]
bfbd3960708689154a7a75c8a9a934197d738a5b
https://github.com/devnied/EMV-NFC-Paycard-Enrollment/blob/bfbd3960708689154a7a75c8a9a934197d738a5b/library/src/main/java/com/github/devnied/emvnfccard/model/EmvCard.java#L127-L133
25,611
devnied/EMV-NFC-Paycard-Enrollment
library/src/main/java/com/github/devnied/emvnfccard/model/EmvCard.java
EmvCard.getCardNumber
public String getCardNumber() { String ret = null; if (track2 != null) { ret = track2.getCardNumber(); } if (ret == null && track1 != null) { ret = track1.getCardNumber(); } return ret; }
java
public String getCardNumber() { String ret = null; if (track2 != null) { ret = track2.getCardNumber(); } if (ret == null && track1 != null) { ret = track1.getCardNumber(); } return ret; }
[ "public", "String", "getCardNumber", "(", ")", "{", "String", "ret", "=", "null", ";", "if", "(", "track2", "!=", "null", ")", "{", "ret", "=", "track2", ".", "getCardNumber", "(", ")", ";", "}", "if", "(", "ret", "==", "null", "&&", "track1", "!="...
Method used to get the field cardNumber @return the cardNumber
[ "Method", "used", "to", "get", "the", "field", "cardNumber" ]
bfbd3960708689154a7a75c8a9a934197d738a5b
https://github.com/devnied/EMV-NFC-Paycard-Enrollment/blob/bfbd3960708689154a7a75c8a9a934197d738a5b/library/src/main/java/com/github/devnied/emvnfccard/model/EmvCard.java#L150-L159
25,612
devnied/EMV-NFC-Paycard-Enrollment
library/src/main/java/com/github/devnied/emvnfccard/model/EmvCard.java
EmvCard.getExpireDate
public Date getExpireDate() { Date ret = null; if (track2 != null) { ret = track2.getExpireDate(); } if (ret == null && track1 != null) { ret = track1.getExpireDate(); } return ret; }
java
public Date getExpireDate() { Date ret = null; if (track2 != null) { ret = track2.getExpireDate(); } if (ret == null && track1 != null) { ret = track1.getExpireDate(); } return ret; }
[ "public", "Date", "getExpireDate", "(", ")", "{", "Date", "ret", "=", "null", ";", "if", "(", "track2", "!=", "null", ")", "{", "ret", "=", "track2", ".", "getExpireDate", "(", ")", ";", "}", "if", "(", "ret", "==", "null", "&&", "track1", "!=", ...
Method used to get the field expireDate @return the expireDate
[ "Method", "used", "to", "get", "the", "field", "expireDate" ]
bfbd3960708689154a7a75c8a9a934197d738a5b
https://github.com/devnied/EMV-NFC-Paycard-Enrollment/blob/bfbd3960708689154a7a75c8a9a934197d738a5b/library/src/main/java/com/github/devnied/emvnfccard/model/EmvCard.java#L166-L175
25,613
devnied/EMV-NFC-Paycard-Enrollment
library/src/main/java/com/github/devnied/emvnfccard/utils/TlvUtil.java
TlvUtil.getTagValueAsString
private static String getTagValueAsString(final ITag tag, final byte[] value) { StringBuilder buf = new StringBuilder(); switch (tag.getTagValueType()) { case TEXT: buf.append("="); buf.append(new String(value)); break; case NUMERIC: buf.append("NUMERIC"); break; case BINARY: buf.append("BI...
java
private static String getTagValueAsString(final ITag tag, final byte[] value) { StringBuilder buf = new StringBuilder(); switch (tag.getTagValueType()) { case TEXT: buf.append("="); buf.append(new String(value)); break; case NUMERIC: buf.append("NUMERIC"); break; case BINARY: buf.append("BI...
[ "private", "static", "String", "getTagValueAsString", "(", "final", "ITag", "tag", ",", "final", "byte", "[", "]", "value", ")", "{", "StringBuilder", "buf", "=", "new", "StringBuilder", "(", ")", ";", "switch", "(", "tag", ".", "getTagValueType", "(", ")"...
Method used get Tag value as String @param tag tag type @param value tag value @return
[ "Method", "used", "get", "Tag", "value", "as", "String" ]
bfbd3960708689154a7a75c8a9a934197d738a5b
https://github.com/devnied/EMV-NFC-Paycard-Enrollment/blob/bfbd3960708689154a7a75c8a9a934197d738a5b/library/src/main/java/com/github/devnied/emvnfccard/utils/TlvUtil.java#L127-L153
25,614
devnied/EMV-NFC-Paycard-Enrollment
library/src/main/java/com/github/devnied/emvnfccard/utils/TlvUtil.java
TlvUtil.parseTagAndLength
public static List<TagAndLength> parseTagAndLength(final byte[] data) { List<TagAndLength> tagAndLengthList = new ArrayList<TagAndLength>(); if (data != null) { TLVInputStream stream = new TLVInputStream(new ByteArrayInputStream(data)); try { while (stream.available() > 0) { if (stream.available() <...
java
public static List<TagAndLength> parseTagAndLength(final byte[] data) { List<TagAndLength> tagAndLengthList = new ArrayList<TagAndLength>(); if (data != null) { TLVInputStream stream = new TLVInputStream(new ByteArrayInputStream(data)); try { while (stream.available() > 0) { if (stream.available() <...
[ "public", "static", "List", "<", "TagAndLength", ">", "parseTagAndLength", "(", "final", "byte", "[", "]", "data", ")", "{", "List", "<", "TagAndLength", ">", "tagAndLengthList", "=", "new", "ArrayList", "<", "TagAndLength", ">", "(", ")", ";", "if", "(", ...
Method used to parser Tag and length @param data data to parse @return tag and length
[ "Method", "used", "to", "parser", "Tag", "and", "length" ]
bfbd3960708689154a7a75c8a9a934197d738a5b
https://github.com/devnied/EMV-NFC-Paycard-Enrollment/blob/bfbd3960708689154a7a75c8a9a934197d738a5b/library/src/main/java/com/github/devnied/emvnfccard/utils/TlvUtil.java#L162-L185
25,615
devnied/EMV-NFC-Paycard-Enrollment
library/src/main/java/com/github/devnied/emvnfccard/utils/TlvUtil.java
TlvUtil.getlistTLV
public static List<TLV> getlistTLV(final byte[] pData, final ITag... pTag) { List<TLV> list = new ArrayList<TLV>(); TLVInputStream stream = new TLVInputStream(new ByteArrayInputStream(pData)); try { while (stream.available() > 0) { TLV tlv = TlvUtil.getNextTLV(stream); if (tlv == null) { break...
java
public static List<TLV> getlistTLV(final byte[] pData, final ITag... pTag) { List<TLV> list = new ArrayList<TLV>(); TLVInputStream stream = new TLVInputStream(new ByteArrayInputStream(pData)); try { while (stream.available() > 0) { TLV tlv = TlvUtil.getNextTLV(stream); if (tlv == null) { break...
[ "public", "static", "List", "<", "TLV", ">", "getlistTLV", "(", "final", "byte", "[", "]", "pData", ",", "final", "ITag", "...", "pTag", ")", "{", "List", "<", "TLV", ">", "list", "=", "new", "ArrayList", "<", "TLV", ">", "(", ")", ";", "TLVInputSt...
Method used to get the list of TLV corresponding to tags specified in parameters @param pData data to parse @param pTag tags to find @return the list of TLV
[ "Method", "used", "to", "get", "the", "list", "of", "TLV", "corresponding", "to", "tags", "specified", "in", "parameters" ]
bfbd3960708689154a7a75c8a9a934197d738a5b
https://github.com/devnied/EMV-NFC-Paycard-Enrollment/blob/bfbd3960708689154a7a75c8a9a934197d738a5b/library/src/main/java/com/github/devnied/emvnfccard/utils/TlvUtil.java#L239-L265
25,616
devnied/EMV-NFC-Paycard-Enrollment
library/src/main/java/com/github/devnied/emvnfccard/utils/TlvUtil.java
TlvUtil.getValue
public static byte[] getValue(final byte[] pData, final ITag... pTag) { byte[] ret = null; if (pData != null) { TLVInputStream stream = new TLVInputStream(new ByteArrayInputStream(pData)); try { while (stream.available() > 0) { TLV tlv = TlvUtil.getNextTLV(stream); if (tlv == null) { b...
java
public static byte[] getValue(final byte[] pData, final ITag... pTag) { byte[] ret = null; if (pData != null) { TLVInputStream stream = new TLVInputStream(new ByteArrayInputStream(pData)); try { while (stream.available() > 0) { TLV tlv = TlvUtil.getNextTLV(stream); if (tlv == null) { b...
[ "public", "static", "byte", "[", "]", "getValue", "(", "final", "byte", "[", "]", "pData", ",", "final", "ITag", "...", "pTag", ")", "{", "byte", "[", "]", "ret", "=", "null", ";", "if", "(", "pData", "!=", "null", ")", "{", "TLVInputStream", "stre...
Method used to get Tag value @param pData data @param pTag tag to find @return tag value or null
[ "Method", "used", "to", "get", "Tag", "value" ]
bfbd3960708689154a7a75c8a9a934197d738a5b
https://github.com/devnied/EMV-NFC-Paycard-Enrollment/blob/bfbd3960708689154a7a75c8a9a934197d738a5b/library/src/main/java/com/github/devnied/emvnfccard/utils/TlvUtil.java#L276-L308
25,617
devnied/EMV-NFC-Paycard-Enrollment
library/src/main/java/com/github/devnied/emvnfccard/utils/TlvUtil.java
TlvUtil.getLength
public static int getLength(final List<TagAndLength> pList) { int ret = 0; if (pList != null) { for (TagAndLength tl : pList) { ret += tl.getLength(); } } return ret; }
java
public static int getLength(final List<TagAndLength> pList) { int ret = 0; if (pList != null) { for (TagAndLength tl : pList) { ret += tl.getLength(); } } return ret; }
[ "public", "static", "int", "getLength", "(", "final", "List", "<", "TagAndLength", ">", "pList", ")", "{", "int", "ret", "=", "0", ";", "if", "(", "pList", "!=", "null", ")", "{", "for", "(", "TagAndLength", "tl", ":", "pList", ")", "{", "ret", "+=...
Method used to get length of all Tags @param pList tag length list @return the sum of tag length
[ "Method", "used", "to", "get", "length", "of", "all", "Tags" ]
bfbd3960708689154a7a75c8a9a934197d738a5b
https://github.com/devnied/EMV-NFC-Paycard-Enrollment/blob/bfbd3960708689154a7a75c8a9a934197d738a5b/library/src/main/java/com/github/devnied/emvnfccard/utils/TlvUtil.java#L448-L456
25,618
devnied/EMV-NFC-Paycard-Enrollment
library/src/main/java/com/github/devnied/emvnfccard/parser/EmvTemplate.java
EmvTemplate.addDefaultParsers
private void addDefaultParsers() { parsers = new ArrayList<IParser>(); parsers.add(new GeldKarteParser(this)); parsers.add(new EmvParser(this)); }
java
private void addDefaultParsers() { parsers = new ArrayList<IParser>(); parsers.add(new GeldKarteParser(this)); parsers.add(new EmvParser(this)); }
[ "private", "void", "addDefaultParsers", "(", ")", "{", "parsers", "=", "new", "ArrayList", "<", "IParser", ">", "(", ")", ";", "parsers", ".", "add", "(", "new", "GeldKarteParser", "(", "this", ")", ")", ";", "parsers", ".", "add", "(", "new", "EmvPars...
Add default parser implementation
[ "Add", "default", "parser", "implementation" ]
bfbd3960708689154a7a75c8a9a934197d738a5b
https://github.com/devnied/EMV-NFC-Paycard-Enrollment/blob/bfbd3960708689154a7a75c8a9a934197d738a5b/library/src/main/java/com/github/devnied/emvnfccard/parser/EmvTemplate.java#L323-L327
25,619
devnied/EMV-NFC-Paycard-Enrollment
library/src/main/java/com/github/devnied/emvnfccard/parser/EmvTemplate.java
EmvTemplate.addParsers
public EmvTemplate addParsers(final IParser... pParsers) { if (pParsers != null) { for (IParser parser : pParsers) { parsers.add(0, parser); } } return this; }
java
public EmvTemplate addParsers(final IParser... pParsers) { if (pParsers != null) { for (IParser parser : pParsers) { parsers.add(0, parser); } } return this; }
[ "public", "EmvTemplate", "addParsers", "(", "final", "IParser", "...", "pParsers", ")", "{", "if", "(", "pParsers", "!=", "null", ")", "{", "for", "(", "IParser", "parser", ":", "pParsers", ")", "{", "parsers", ".", "add", "(", "0", ",", "parser", ")",...
Method used to add a list of parser to the current EMV template @param pParsers parser implementation to add @return current EmvTemplate
[ "Method", "used", "to", "add", "a", "list", "of", "parser", "to", "the", "current", "EMV", "template" ]
bfbd3960708689154a7a75c8a9a934197d738a5b
https://github.com/devnied/EMV-NFC-Paycard-Enrollment/blob/bfbd3960708689154a7a75c8a9a934197d738a5b/library/src/main/java/com/github/devnied/emvnfccard/parser/EmvTemplate.java#L336-L343
25,620
devnied/EMV-NFC-Paycard-Enrollment
library/src/main/java/com/github/devnied/emvnfccard/parser/EmvTemplate.java
EmvTemplate.readEmvCard
public EmvCard readEmvCard() throws CommunicationException { // Read CPLC Infos if (config.readCplc){ readCPLCInfos(); } // Update ATS or ATR if (config.readAt){ card.setAt(BytesUtils.bytesToStringNoSpace(provider.getAt())); card.setAtrDescription(config.contactLess ? AtrUtils.getDescriptionFromAts(...
java
public EmvCard readEmvCard() throws CommunicationException { // Read CPLC Infos if (config.readCplc){ readCPLCInfos(); } // Update ATS or ATR if (config.readAt){ card.setAt(BytesUtils.bytesToStringNoSpace(provider.getAt())); card.setAtrDescription(config.contactLess ? AtrUtils.getDescriptionFromAts(...
[ "public", "EmvCard", "readEmvCard", "(", ")", "throws", "CommunicationException", "{", "// Read CPLC Infos", "if", "(", "config", ".", "readCplc", ")", "{", "readCPLCInfos", "(", ")", ";", "}", "// Update ATS or ATR", "if", "(", "config", ".", "readAt", ")", "...
Method used to read public data from EMV card @return data read from card or null if any provider match the card type @throws CommunicationException communication error
[ "Method", "used", "to", "read", "public", "data", "from", "EMV", "card" ]
bfbd3960708689154a7a75c8a9a934197d738a5b
https://github.com/devnied/EMV-NFC-Paycard-Enrollment/blob/bfbd3960708689154a7a75c8a9a934197d738a5b/library/src/main/java/com/github/devnied/emvnfccard/parser/EmvTemplate.java#L351-L369
25,621
devnied/EMV-NFC-Paycard-Enrollment
library/src/main/java/com/github/devnied/emvnfccard/parser/EmvTemplate.java
EmvTemplate.readWithPSE
protected boolean readWithPSE() throws CommunicationException { boolean ret = false; if (LOGGER.isDebugEnabled()) { LOGGER.debug("Try to read card with Payment System Environment"); } // Select the payment environment PPSE or PSE directory byte[] data = selectPaymentEnvironment(); if (ResponseUtils.isSuc...
java
protected boolean readWithPSE() throws CommunicationException { boolean ret = false; if (LOGGER.isDebugEnabled()) { LOGGER.debug("Try to read card with Payment System Environment"); } // Select the payment environment PPSE or PSE directory byte[] data = selectPaymentEnvironment(); if (ResponseUtils.isSuc...
[ "protected", "boolean", "readWithPSE", "(", ")", "throws", "CommunicationException", "{", "boolean", "ret", "=", "false", ";", "if", "(", "LOGGER", ".", "isDebugEnabled", "(", ")", ")", "{", "LOGGER", ".", "debug", "(", "\"Try to read card with Payment System Envi...
Read EMV card with Payment System Environment or Proximity Payment System Environment @return true is succeed false otherwise @throws CommunicationException communication error
[ "Read", "EMV", "card", "with", "Payment", "System", "Environment", "or", "Proximity", "Payment", "System", "Environment" ]
bfbd3960708689154a7a75c8a9a934197d738a5b
https://github.com/devnied/EMV-NFC-Paycard-Enrollment/blob/bfbd3960708689154a7a75c8a9a934197d738a5b/library/src/main/java/com/github/devnied/emvnfccard/parser/EmvTemplate.java#L389-L425
25,622
devnied/EMV-NFC-Paycard-Enrollment
library/src/main/java/com/github/devnied/emvnfccard/parser/EmvTemplate.java
EmvTemplate.parseFCIProprietaryTemplate
protected List<Application> parseFCIProprietaryTemplate(final byte[] pData) throws CommunicationException { List<Application> ret = new ArrayList<Application>(); // Get SFI byte[] data = TlvUtil.getValue(pData, EmvTags.SFI); // Check SFI if (data != null) { int sfi = BytesUtils.byteArrayToInt(data); if...
java
protected List<Application> parseFCIProprietaryTemplate(final byte[] pData) throws CommunicationException { List<Application> ret = new ArrayList<Application>(); // Get SFI byte[] data = TlvUtil.getValue(pData, EmvTags.SFI); // Check SFI if (data != null) { int sfi = BytesUtils.byteArrayToInt(data); if...
[ "protected", "List", "<", "Application", ">", "parseFCIProprietaryTemplate", "(", "final", "byte", "[", "]", "pData", ")", "throws", "CommunicationException", "{", "List", "<", "Application", ">", "ret", "=", "new", "ArrayList", "<", "Application", ">", "(", "...
Method used to parse FCI Proprietary Template @param pData data to parse @return the list of EMV application in the card @throws CommunicationException communication error
[ "Method", "used", "to", "parse", "FCI", "Proprietary", "Template" ]
bfbd3960708689154a7a75c8a9a934197d738a5b
https://github.com/devnied/EMV-NFC-Paycard-Enrollment/blob/bfbd3960708689154a7a75c8a9a934197d738a5b/library/src/main/java/com/github/devnied/emvnfccard/parser/EmvTemplate.java#L435-L466
25,623
devnied/EMV-NFC-Paycard-Enrollment
library/src/main/java/com/github/devnied/emvnfccard/parser/EmvTemplate.java
EmvTemplate.readWithAID
protected void readWithAID() throws CommunicationException { if (LOGGER.isDebugEnabled()) { LOGGER.debug("Try to read card with AID"); } // Test each card from know EMV AID Application app = new Application(); for (EmvCardScheme type : EmvCardScheme.values()) { for (byte[] aid : type.getAidByte()) { ...
java
protected void readWithAID() throws CommunicationException { if (LOGGER.isDebugEnabled()) { LOGGER.debug("Try to read card with AID"); } // Test each card from know EMV AID Application app = new Application(); for (EmvCardScheme type : EmvCardScheme.values()) { for (byte[] aid : type.getAidByte()) { ...
[ "protected", "void", "readWithAID", "(", ")", "throws", "CommunicationException", "{", "if", "(", "LOGGER", ".", "isDebugEnabled", "(", ")", ")", "{", "LOGGER", ".", "debug", "(", "\"Try to read card with AID\"", ")", ";", "}", "// Test each card from know EMV AID",...
Read EMV card with AID
[ "Read", "EMV", "card", "with", "AID" ]
bfbd3960708689154a7a75c8a9a934197d738a5b
https://github.com/devnied/EMV-NFC-Paycard-Enrollment/blob/bfbd3960708689154a7a75c8a9a934197d738a5b/library/src/main/java/com/github/devnied/emvnfccard/parser/EmvTemplate.java#L506-L528
25,624
devnied/EMV-NFC-Paycard-Enrollment
library/src/main/java/com/github/devnied/emvnfccard/parser/EmvTemplate.java
EmvTemplate.selectPaymentEnvironment
protected byte[] selectPaymentEnvironment() throws CommunicationException { if (LOGGER.isDebugEnabled()) { LOGGER.debug("Select " + (config.contactLess ? "PPSE" : "PSE") + " Application"); } // Select the PPSE or PSE directory return provider.transceive(new CommandApdu(CommandEnum.SELECT, config.contactLess ...
java
protected byte[] selectPaymentEnvironment() throws CommunicationException { if (LOGGER.isDebugEnabled()) { LOGGER.debug("Select " + (config.contactLess ? "PPSE" : "PSE") + " Application"); } // Select the PPSE or PSE directory return provider.transceive(new CommandApdu(CommandEnum.SELECT, config.contactLess ...
[ "protected", "byte", "[", "]", "selectPaymentEnvironment", "(", ")", "throws", "CommunicationException", "{", "if", "(", "LOGGER", ".", "isDebugEnabled", "(", ")", ")", "{", "LOGGER", ".", "debug", "(", "\"Select \"", "+", "(", "config", ".", "contactLess", ...
Method used to select payment environment PSE or PPSE @return response byte array @throws CommunicationException communication error
[ "Method", "used", "to", "select", "payment", "environment", "PSE", "or", "PPSE" ]
bfbd3960708689154a7a75c8a9a934197d738a5b
https://github.com/devnied/EMV-NFC-Paycard-Enrollment/blob/bfbd3960708689154a7a75c8a9a934197d738a5b/library/src/main/java/com/github/devnied/emvnfccard/parser/EmvTemplate.java#L536-L542
25,625
devnied/EMV-NFC-Paycard-Enrollment
library/src/main/java/com/github/devnied/emvnfccard/parser/impl/AbstractParser.java
AbstractParser.selectAID
protected byte[] selectAID(final byte[] pAid) throws CommunicationException { if (LOGGER.isDebugEnabled()) { LOGGER.debug("Select AID: " + BytesUtils.bytesToString(pAid)); } return template.get().getProvider().transceive(new CommandApdu(CommandEnum.SELECT, pAid, 0).toBytes()); }
java
protected byte[] selectAID(final byte[] pAid) throws CommunicationException { if (LOGGER.isDebugEnabled()) { LOGGER.debug("Select AID: " + BytesUtils.bytesToString(pAid)); } return template.get().getProvider().transceive(new CommandApdu(CommandEnum.SELECT, pAid, 0).toBytes()); }
[ "protected", "byte", "[", "]", "selectAID", "(", "final", "byte", "[", "]", "pAid", ")", "throws", "CommunicationException", "{", "if", "(", "LOGGER", ".", "isDebugEnabled", "(", ")", ")", "{", "LOGGER", ".", "debug", "(", "\"Select AID: \"", "+", "BytesUt...
Select application with AID or RID @param pAid byte array containing AID or RID @return response byte array @throws CommunicationException communication error
[ "Select", "application", "with", "AID", "or", "RID" ]
bfbd3960708689154a7a75c8a9a934197d738a5b
https://github.com/devnied/EMV-NFC-Paycard-Enrollment/blob/bfbd3960708689154a7a75c8a9a934197d738a5b/library/src/main/java/com/github/devnied/emvnfccard/parser/impl/AbstractParser.java#L80-L85
25,626
devnied/EMV-NFC-Paycard-Enrollment
library/src/main/java/com/github/devnied/emvnfccard/parser/impl/AbstractParser.java
AbstractParser.extractApplicationLabel
protected String extractApplicationLabel(final byte[] pData) { if (LOGGER.isDebugEnabled()) { LOGGER.debug("Extract Application label"); } String label = null; // Get Preferred name first byte[] labelByte = TlvUtil.getValue(pData, EmvTags.APPLICATION_PREFERRED_NAME); // Get Application label if (labelB...
java
protected String extractApplicationLabel(final byte[] pData) { if (LOGGER.isDebugEnabled()) { LOGGER.debug("Extract Application label"); } String label = null; // Get Preferred name first byte[] labelByte = TlvUtil.getValue(pData, EmvTags.APPLICATION_PREFERRED_NAME); // Get Application label if (labelB...
[ "protected", "String", "extractApplicationLabel", "(", "final", "byte", "[", "]", "pData", ")", "{", "if", "(", "LOGGER", ".", "isDebugEnabled", "(", ")", ")", "{", "LOGGER", ".", "debug", "(", "\"Extract Application label\"", ")", ";", "}", "String", "label...
Method used to extract application label @param pData raw response data @return decoded application label or null
[ "Method", "used", "to", "extract", "application", "label" ]
bfbd3960708689154a7a75c8a9a934197d738a5b
https://github.com/devnied/EMV-NFC-Paycard-Enrollment/blob/bfbd3960708689154a7a75c8a9a934197d738a5b/library/src/main/java/com/github/devnied/emvnfccard/parser/impl/AbstractParser.java#L95-L111
25,627
devnied/EMV-NFC-Paycard-Enrollment
library/src/main/java/com/github/devnied/emvnfccard/parser/impl/AbstractParser.java
AbstractParser.extractCardHolderName
protected void extractCardHolderName(final byte[] pData) { // Extract Card Holder name (if exist) byte[] cardHolderByte = TlvUtil.getValue(pData, EmvTags.CARDHOLDER_NAME); if (cardHolderByte != null) { String[] name = StringUtils.split(new String(cardHolderByte).trim(), TrackUtils.CARD_HOLDER_NAME_SEPARATOR); ...
java
protected void extractCardHolderName(final byte[] pData) { // Extract Card Holder name (if exist) byte[] cardHolderByte = TlvUtil.getValue(pData, EmvTags.CARDHOLDER_NAME); if (cardHolderByte != null) { String[] name = StringUtils.split(new String(cardHolderByte).trim(), TrackUtils.CARD_HOLDER_NAME_SEPARATOR); ...
[ "protected", "void", "extractCardHolderName", "(", "final", "byte", "[", "]", "pData", ")", "{", "// Extract Card Holder name (if exist)", "byte", "[", "]", "cardHolderByte", "=", "TlvUtil", ".", "getValue", "(", "pData", ",", "EmvTags", ".", "CARDHOLDER_NAME", ")...
Extract card holder lastname and firstname @param pData card data
[ "Extract", "card", "holder", "lastname", "and", "firstname" ]
bfbd3960708689154a7a75c8a9a934197d738a5b
https://github.com/devnied/EMV-NFC-Paycard-Enrollment/blob/bfbd3960708689154a7a75c8a9a934197d738a5b/library/src/main/java/com/github/devnied/emvnfccard/parser/impl/AbstractParser.java#L138-L150
25,628
devnied/EMV-NFC-Paycard-Enrollment
library/src/main/java/com/github/devnied/emvnfccard/parser/impl/AbstractParser.java
AbstractParser.getTransactionCounter
protected int getTransactionCounter() throws CommunicationException { int ret = UNKNOW; if (LOGGER.isDebugEnabled()) { LOGGER.debug("Get Transaction Counter ATC"); } byte[] data = template.get().getProvider().transceive(new CommandApdu(CommandEnum.GET_DATA, 0x9F, 0x36, 0).toBytes()); if (ResponseUtils.isSu...
java
protected int getTransactionCounter() throws CommunicationException { int ret = UNKNOW; if (LOGGER.isDebugEnabled()) { LOGGER.debug("Get Transaction Counter ATC"); } byte[] data = template.get().getProvider().transceive(new CommandApdu(CommandEnum.GET_DATA, 0x9F, 0x36, 0).toBytes()); if (ResponseUtils.isSu...
[ "protected", "int", "getTransactionCounter", "(", ")", "throws", "CommunicationException", "{", "int", "ret", "=", "UNKNOW", ";", "if", "(", "LOGGER", ".", "isDebugEnabled", "(", ")", ")", "{", "LOGGER", ".", "debug", "(", "\"Get Transaction Counter ATC\"", ")",...
Method used to get Transaction counter @return the number of card transaction @throws CommunicationException communication error
[ "Method", "used", "to", "get", "Transaction", "counter" ]
bfbd3960708689154a7a75c8a9a934197d738a5b
https://github.com/devnied/EMV-NFC-Paycard-Enrollment/blob/bfbd3960708689154a7a75c8a9a934197d738a5b/library/src/main/java/com/github/devnied/emvnfccard/parser/impl/AbstractParser.java#L169-L183
25,629
devnied/EMV-NFC-Paycard-Enrollment
library/src/main/java/com/github/devnied/emvnfccard/parser/impl/AbstractParser.java
AbstractParser.getLogFormat
protected List<TagAndLength> getLogFormat() throws CommunicationException { List<TagAndLength> ret = new ArrayList<TagAndLength>(); if (LOGGER.isDebugEnabled()) { LOGGER.debug("GET log format"); } // Get log format byte[] data = template.get().getProvider().transceive(new CommandApdu(CommandEnum.GET_DATA, ...
java
protected List<TagAndLength> getLogFormat() throws CommunicationException { List<TagAndLength> ret = new ArrayList<TagAndLength>(); if (LOGGER.isDebugEnabled()) { LOGGER.debug("GET log format"); } // Get log format byte[] data = template.get().getProvider().transceive(new CommandApdu(CommandEnum.GET_DATA, ...
[ "protected", "List", "<", "TagAndLength", ">", "getLogFormat", "(", ")", "throws", "CommunicationException", "{", "List", "<", "TagAndLength", ">", "ret", "=", "new", "ArrayList", "<", "TagAndLength", ">", "(", ")", ";", "if", "(", "LOGGER", ".", "isDebugEna...
Method used to get log format @return list of tag and length for the log format @throws CommunicationException communication error
[ "Method", "used", "to", "get", "log", "format" ]
bfbd3960708689154a7a75c8a9a934197d738a5b
https://github.com/devnied/EMV-NFC-Paycard-Enrollment/blob/bfbd3960708689154a7a75c8a9a934197d738a5b/library/src/main/java/com/github/devnied/emvnfccard/parser/impl/AbstractParser.java#L214-L227
25,630
devnied/EMV-NFC-Paycard-Enrollment
library/src/main/java/com/github/devnied/emvnfccard/parser/impl/AbstractParser.java
AbstractParser.extractLogEntry
protected List<EmvTransactionRecord> extractLogEntry(final byte[] pLogEntry) throws CommunicationException { List<EmvTransactionRecord> listRecord = new ArrayList<EmvTransactionRecord>(); // If log entry is defined if (template.get().getConfig().readTransactions && pLogEntry != null) { List<TagAndLength> tals ...
java
protected List<EmvTransactionRecord> extractLogEntry(final byte[] pLogEntry) throws CommunicationException { List<EmvTransactionRecord> listRecord = new ArrayList<EmvTransactionRecord>(); // If log entry is defined if (template.get().getConfig().readTransactions && pLogEntry != null) { List<TagAndLength> tals ...
[ "protected", "List", "<", "EmvTransactionRecord", ">", "extractLogEntry", "(", "final", "byte", "[", "]", "pLogEntry", ")", "throws", "CommunicationException", "{", "List", "<", "EmvTransactionRecord", ">", "listRecord", "=", "new", "ArrayList", "<", "EmvTransaction...
Method used to extract log entry from card @param pLogEntry log entry position @return list of transaction records @throws CommunicationException communication error
[ "Method", "used", "to", "extract", "log", "entry", "from", "card" ]
bfbd3960708689154a7a75c8a9a934197d738a5b
https://github.com/devnied/EMV-NFC-Paycard-Enrollment/blob/bfbd3960708689154a7a75c8a9a934197d738a5b/library/src/main/java/com/github/devnied/emvnfccard/parser/impl/AbstractParser.java#L237-L283
25,631
devnied/EMV-NFC-Paycard-Enrollment
library/src/main/java/com/github/devnied/emvnfccard/parser/apdu/impl/DataFactory.java
DataFactory.getDate
private static Date getDate(final AnnotationData pAnnotation, final BitUtils pBit) { Date date = null; if (pAnnotation.getDateStandard() == BCD_DATE) { date = pBit.getNextDate(pAnnotation.getSize(), pAnnotation.getFormat(), true); } else if (pAnnotation.getDateStandard() == CPCL_DATE) { date = calculateCplc...
java
private static Date getDate(final AnnotationData pAnnotation, final BitUtils pBit) { Date date = null; if (pAnnotation.getDateStandard() == BCD_DATE) { date = pBit.getNextDate(pAnnotation.getSize(), pAnnotation.getFormat(), true); } else if (pAnnotation.getDateStandard() == CPCL_DATE) { date = calculateCplc...
[ "private", "static", "Date", "getDate", "(", "final", "AnnotationData", "pAnnotation", ",", "final", "BitUtils", "pBit", ")", "{", "Date", "date", "=", "null", ";", "if", "(", "pAnnotation", ".", "getDateStandard", "(", ")", "==", "BCD_DATE", ")", "{", "da...
Method to get a date from the bytes array @param pAnnotation annotation data @param pBit table bytes @return The date read of null
[ "Method", "to", "get", "a", "date", "from", "the", "bytes", "array" ]
bfbd3960708689154a7a75c8a9a934197d738a5b
https://github.com/devnied/EMV-NFC-Paycard-Enrollment/blob/bfbd3960708689154a7a75c8a9a934197d738a5b/library/src/main/java/com/github/devnied/emvnfccard/parser/apdu/impl/DataFactory.java#L66-L76
25,632
devnied/EMV-NFC-Paycard-Enrollment
library/src/main/java/com/github/devnied/emvnfccard/parser/apdu/impl/DataFactory.java
DataFactory.getObject
public static Object getObject(final AnnotationData pAnnotation, final BitUtils pBit) { Object obj = null; Class<?> clazz = pAnnotation.getField().getType(); if (clazz.equals(Integer.class)) { obj = getInteger(pAnnotation, pBit); } else if (clazz.equals(Float.class)) { obj = getFloat(pAnnotation, pBit); ...
java
public static Object getObject(final AnnotationData pAnnotation, final BitUtils pBit) { Object obj = null; Class<?> clazz = pAnnotation.getField().getType(); if (clazz.equals(Integer.class)) { obj = getInteger(pAnnotation, pBit); } else if (clazz.equals(Float.class)) { obj = getFloat(pAnnotation, pBit); ...
[ "public", "static", "Object", "getObject", "(", "final", "AnnotationData", "pAnnotation", ",", "final", "BitUtils", "pBit", ")", "{", "Object", "obj", "=", "null", ";", "Class", "<", "?", ">", "clazz", "=", "pAnnotation", ".", "getField", "(", ")", ".", ...
Method to read and object from the bytes tab @param pAnnotation all information data @param pBit bytes tab @return an object
[ "Method", "to", "read", "and", "object", "from", "the", "bytes", "tab" ]
bfbd3960708689154a7a75c8a9a934197d738a5b
https://github.com/devnied/EMV-NFC-Paycard-Enrollment/blob/bfbd3960708689154a7a75c8a9a934197d738a5b/library/src/main/java/com/github/devnied/emvnfccard/parser/apdu/impl/DataFactory.java#L145-L161
25,633
devnied/EMV-NFC-Paycard-Enrollment
library/src/main/java/com/github/devnied/emvnfccard/parser/apdu/impl/DataFactory.java
DataFactory.getFloat
private static Float getFloat(final AnnotationData pAnnotation, final BitUtils pBit) { Float ret = null; if (BCD_FORMAT.equals(pAnnotation.getFormat())) { ret = Float.parseFloat(pBit.getNextHexaString(pAnnotation.getSize())); } else { ret = (float) getInteger(pAnnotation, pBit); } return ret; }
java
private static Float getFloat(final AnnotationData pAnnotation, final BitUtils pBit) { Float ret = null; if (BCD_FORMAT.equals(pAnnotation.getFormat())) { ret = Float.parseFloat(pBit.getNextHexaString(pAnnotation.getSize())); } else { ret = (float) getInteger(pAnnotation, pBit); } return ret; }
[ "private", "static", "Float", "getFloat", "(", "final", "AnnotationData", "pAnnotation", ",", "final", "BitUtils", "pBit", ")", "{", "Float", "ret", "=", "null", ";", "if", "(", "BCD_FORMAT", ".", "equals", "(", "pAnnotation", ".", "getFormat", "(", ")", "...
Method use to get float @param pAnnotation annotation @param pBit bit utils @return
[ "Method", "use", "to", "get", "float" ]
bfbd3960708689154a7a75c8a9a934197d738a5b
https://github.com/devnied/EMV-NFC-Paycard-Enrollment/blob/bfbd3960708689154a7a75c8a9a934197d738a5b/library/src/main/java/com/github/devnied/emvnfccard/parser/apdu/impl/DataFactory.java#L172-L182
25,634
devnied/EMV-NFC-Paycard-Enrollment
library/src/main/java/com/github/devnied/emvnfccard/parser/apdu/impl/DataFactory.java
DataFactory.getEnum
@SuppressWarnings("unchecked") private static IKeyEnum getEnum(final AnnotationData pAnnotation, final BitUtils pBit) { int val = 0; try { val = Integer.parseInt(pBit.getNextHexaString(pAnnotation.getSize()), pAnnotation.isReadHexa() ? 16 : 10); } catch (NumberFormatException nfe) { // do nothing } ret...
java
@SuppressWarnings("unchecked") private static IKeyEnum getEnum(final AnnotationData pAnnotation, final BitUtils pBit) { int val = 0; try { val = Integer.parseInt(pBit.getNextHexaString(pAnnotation.getSize()), pAnnotation.isReadHexa() ? 16 : 10); } catch (NumberFormatException nfe) { // do nothing } ret...
[ "@", "SuppressWarnings", "(", "\"unchecked\"", ")", "private", "static", "IKeyEnum", "getEnum", "(", "final", "AnnotationData", "pAnnotation", ",", "final", "BitUtils", "pBit", ")", "{", "int", "val", "=", "0", ";", "try", "{", "val", "=", "Integer", ".", ...
This method is used to get an enum with his key @param pAnnotation annotation @param pBit bit array
[ "This", "method", "is", "used", "to", "get", "an", "enum", "with", "his", "key" ]
bfbd3960708689154a7a75c8a9a934197d738a5b
https://github.com/devnied/EMV-NFC-Paycard-Enrollment/blob/bfbd3960708689154a7a75c8a9a934197d738a5b/library/src/main/java/com/github/devnied/emvnfccard/parser/apdu/impl/DataFactory.java#L192-L201
25,635
devnied/EMV-NFC-Paycard-Enrollment
library/src/main/java/com/github/devnied/emvnfccard/utils/EnumUtils.java
EnumUtils.getValue
@SuppressWarnings("unchecked") public static <T extends IKeyEnum> T getValue(final int pKey, final Class<T> pClass) { for (IKeyEnum val : pClass.getEnumConstants()) { if (val.getKey() == pKey) { return (T) val; } } LOGGER.error("Unknow value:" + pKey + " for Enum:" + pClass.getName()); return null; ...
java
@SuppressWarnings("unchecked") public static <T extends IKeyEnum> T getValue(final int pKey, final Class<T> pClass) { for (IKeyEnum val : pClass.getEnumConstants()) { if (val.getKey() == pKey) { return (T) val; } } LOGGER.error("Unknow value:" + pKey + " for Enum:" + pClass.getName()); return null; ...
[ "@", "SuppressWarnings", "(", "\"unchecked\"", ")", "public", "static", "<", "T", "extends", "IKeyEnum", ">", "T", "getValue", "(", "final", "int", "pKey", ",", "final", "Class", "<", "T", ">", "pClass", ")", "{", "for", "(", "IKeyEnum", "val", ":", "p...
Get the value of and enum from his key @param pKey key to find @param pClass Enum class @return Enum instance of the specified key or null otherwise
[ "Get", "the", "value", "of", "and", "enum", "from", "his", "key" ]
bfbd3960708689154a7a75c8a9a934197d738a5b
https://github.com/devnied/EMV-NFC-Paycard-Enrollment/blob/bfbd3960708689154a7a75c8a9a934197d738a5b/library/src/main/java/com/github/devnied/emvnfccard/utils/EnumUtils.java#L44-L53
25,636
SnappyDataInc/snappydata
core/src/main/java/io/snappydata/util/com/clearspring/analytics/stream/membership/Filter.java
Filter.getHashBuckets
public static int[] getHashBuckets(String key, int hashCount, int max, boolean applyWidth) { byte[] b; b = key.getBytes(StandardCharsets.UTF_8); return getHashBuckets(b, hashCount, max, applyWidth); }
java
public static int[] getHashBuckets(String key, int hashCount, int max, boolean applyWidth) { byte[] b; b = key.getBytes(StandardCharsets.UTF_8); return getHashBuckets(b, hashCount, max, applyWidth); }
[ "public", "static", "int", "[", "]", "getHashBuckets", "(", "String", "key", ",", "int", "hashCount", ",", "int", "max", ",", "boolean", "applyWidth", ")", "{", "byte", "[", "]", "b", ";", "b", "=", "key", ".", "getBytes", "(", "StandardCharsets", ".",...
than performing further iterations of murmur.
[ "than", "performing", "further", "iterations", "of", "murmur", "." ]
96fe3e37e9f8d407ab68ef9e394083960acad21d
https://github.com/SnappyDataInc/snappydata/blob/96fe3e37e9f8d407ab68ef9e394083960acad21d/core/src/main/java/io/snappydata/util/com/clearspring/analytics/stream/membership/Filter.java#L91-L95
25,637
SnappyDataInc/snappydata
launcher/src/main/java/io/snappydata/tools/QuickLauncher.java
QuickLauncher.status
private void status(final String[] args) throws FileNotFoundException { setWorkingDir(args); final Path statusFile = this.workingDir.resolve(this.statusName); readStatus(true, statusFile); if (args.length > 2 && args[2].equalsIgnoreCase("verbose")) { System.out.println(this.status); } else { ...
java
private void status(final String[] args) throws FileNotFoundException { setWorkingDir(args); final Path statusFile = this.workingDir.resolve(this.statusName); readStatus(true, statusFile); if (args.length > 2 && args[2].equalsIgnoreCase("verbose")) { System.out.println(this.status); } else { ...
[ "private", "void", "status", "(", "final", "String", "[", "]", "args", ")", "throws", "FileNotFoundException", "{", "setWorkingDir", "(", "args", ")", ";", "final", "Path", "statusFile", "=", "this", ".", "workingDir", ".", "resolve", "(", "this", ".", "st...
Prints the status of the node running in the configured working directory.
[ "Prints", "the", "status", "of", "the", "node", "running", "in", "the", "configured", "working", "directory", "." ]
96fe3e37e9f8d407ab68ef9e394083960acad21d
https://github.com/SnappyDataInc/snappydata/blob/96fe3e37e9f8d407ab68ef9e394083960acad21d/launcher/src/main/java/io/snappydata/tools/QuickLauncher.java#L301-L310
25,638
SnappyDataInc/snappydata
core/src/main/java/io/snappydata/util/com/clearspring/analytics/stream/membership/BloomCalculations.java
BloomCalculations.computeBestK
public static int computeBestK(int bucketsPerElement) { assert bucketsPerElement >= 0; if (bucketsPerElement >= optKPerBuckets.length) { return optKPerBuckets[optKPerBuckets.length - 1]; } return optKPerBuckets[bucketsPerElement]; }
java
public static int computeBestK(int bucketsPerElement) { assert bucketsPerElement >= 0; if (bucketsPerElement >= optKPerBuckets.length) { return optKPerBuckets[optKPerBuckets.length - 1]; } return optKPerBuckets[bucketsPerElement]; }
[ "public", "static", "int", "computeBestK", "(", "int", "bucketsPerElement", ")", "{", "assert", "bucketsPerElement", ">=", "0", ";", "if", "(", "bucketsPerElement", ">=", "optKPerBuckets", ".", "length", ")", "{", "return", "optKPerBuckets", "[", "optKPerBuckets",...
Given the number of buckets that can be used per element, return the optimal number of hash functions in order to minimize the false positive rate. @param bucketsPerElement @return The number of hash functions that minimize the false positive rate.
[ "Given", "the", "number", "of", "buckets", "that", "can", "be", "used", "per", "element", "return", "the", "optimal", "number", "of", "hash", "functions", "in", "order", "to", "minimize", "the", "false", "positive", "rate", "." ]
96fe3e37e9f8d407ab68ef9e394083960acad21d
https://github.com/SnappyDataInc/snappydata/blob/96fe3e37e9f8d407ab68ef9e394083960acad21d/core/src/main/java/io/snappydata/util/com/clearspring/analytics/stream/membership/BloomCalculations.java#L79-L85
25,639
apache/incubator-gobblin
gobblin-core/src/main/java/org/apache/gobblin/converter/json/JsonStringToJsonIntermediateConverter.java
JsonStringToJsonIntermediateConverter.convertRecord
@Override public Iterable<JsonObject> convertRecord(JsonArray outputSchema, String strInputRecord, WorkUnitState workUnit) throws DataConversionException { JsonParser jsonParser = new JsonParser(); JsonObject inputRecord = (JsonObject) jsonParser.parse(strInputRecord); if (!this.unpackComplexSchema...
java
@Override public Iterable<JsonObject> convertRecord(JsonArray outputSchema, String strInputRecord, WorkUnitState workUnit) throws DataConversionException { JsonParser jsonParser = new JsonParser(); JsonObject inputRecord = (JsonObject) jsonParser.parse(strInputRecord); if (!this.unpackComplexSchema...
[ "@", "Override", "public", "Iterable", "<", "JsonObject", ">", "convertRecord", "(", "JsonArray", "outputSchema", ",", "String", "strInputRecord", ",", "WorkUnitState", "workUnit", ")", "throws", "DataConversionException", "{", "JsonParser", "jsonParser", "=", "new", ...
Takes in a record with format String and Uses the inputSchema to convert the record to a JsonObject @return a JsonObject representing the record @throws IOException
[ "Takes", "in", "a", "record", "with", "format", "String", "and", "Uses", "the", "inputSchema", "to", "convert", "the", "record", "to", "a", "JsonObject" ]
f029b4c0fea0fe4aa62f36dda2512344ff708bae
https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-core/src/main/java/org/apache/gobblin/converter/json/JsonStringToJsonIntermediateConverter.java#L79-L91
25,640
apache/incubator-gobblin
gobblin-core/src/main/java/org/apache/gobblin/converter/json/JsonStringToJsonIntermediateConverter.java
JsonStringToJsonIntermediateConverter.parseEnumType
private JsonElement parseEnumType(JsonSchema schema, JsonElement value) throws DataConversionException { if (schema.getSymbols().contains(value)) { return value; } throw new DataConversionException( "Invalid symbol: " + value.getAsString() + " allowed values: " + schema.getSymbols().toSt...
java
private JsonElement parseEnumType(JsonSchema schema, JsonElement value) throws DataConversionException { if (schema.getSymbols().contains(value)) { return value; } throw new DataConversionException( "Invalid symbol: " + value.getAsString() + " allowed values: " + schema.getSymbols().toSt...
[ "private", "JsonElement", "parseEnumType", "(", "JsonSchema", "schema", ",", "JsonElement", "value", ")", "throws", "DataConversionException", "{", "if", "(", "schema", ".", "getSymbols", "(", ")", ".", "contains", "(", "value", ")", ")", "{", "return", "value...
Parses Enum type values @param schema @param value @return @throws DataConversionException
[ "Parses", "Enum", "type", "values" ]
f029b4c0fea0fe4aa62f36dda2512344ff708bae
https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-core/src/main/java/org/apache/gobblin/converter/json/JsonStringToJsonIntermediateConverter.java#L167-L174
25,641
apache/incubator-gobblin
gobblin-core/src/main/java/org/apache/gobblin/converter/json/JsonStringToJsonIntermediateConverter.java
JsonStringToJsonIntermediateConverter.parseJsonArrayType
private JsonElement parseJsonArrayType(JsonSchema schema, JsonElement value) throws DataConversionException { Type arrayType = schema.getTypeOfArrayItems(); JsonArray tempArray = new JsonArray(); if (Type.isPrimitive(arrayType)) { return value; } JsonSchema nestedSchema = schema.getItems...
java
private JsonElement parseJsonArrayType(JsonSchema schema, JsonElement value) throws DataConversionException { Type arrayType = schema.getTypeOfArrayItems(); JsonArray tempArray = new JsonArray(); if (Type.isPrimitive(arrayType)) { return value; } JsonSchema nestedSchema = schema.getItems...
[ "private", "JsonElement", "parseJsonArrayType", "(", "JsonSchema", "schema", ",", "JsonElement", "value", ")", "throws", "DataConversionException", "{", "Type", "arrayType", "=", "schema", ".", "getTypeOfArrayItems", "(", ")", ";", "JsonArray", "tempArray", "=", "ne...
Parses JsonArray type values @param schema @param value @return @throws DataConversionException
[ "Parses", "JsonArray", "type", "values" ]
f029b4c0fea0fe4aa62f36dda2512344ff708bae
https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-core/src/main/java/org/apache/gobblin/converter/json/JsonStringToJsonIntermediateConverter.java#L183-L195
25,642
apache/incubator-gobblin
gobblin-core/src/main/java/org/apache/gobblin/converter/json/JsonStringToJsonIntermediateConverter.java
JsonStringToJsonIntermediateConverter.parseJsonObjectType
private JsonElement parseJsonObjectType(JsonSchema schema, JsonElement value) throws DataConversionException { JsonSchema valuesWithinDataType = schema.getValuesWithinDataType(); if (schema.isType(MAP)) { if (Type.isPrimitive(valuesWithinDataType.getType())) { return value; } Js...
java
private JsonElement parseJsonObjectType(JsonSchema schema, JsonElement value) throws DataConversionException { JsonSchema valuesWithinDataType = schema.getValuesWithinDataType(); if (schema.isType(MAP)) { if (Type.isPrimitive(valuesWithinDataType.getType())) { return value; } Js...
[ "private", "JsonElement", "parseJsonObjectType", "(", "JsonSchema", "schema", ",", "JsonElement", "value", ")", "throws", "DataConversionException", "{", "JsonSchema", "valuesWithinDataType", "=", "schema", ".", "getValuesWithinDataType", "(", ")", ";", "if", "(", "sc...
Parses JsonObject type values @param value @return @throws DataConversionException
[ "Parses", "JsonObject", "type", "values" ]
f029b4c0fea0fe4aa62f36dda2512344ff708bae
https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-core/src/main/java/org/apache/gobblin/converter/json/JsonStringToJsonIntermediateConverter.java#L203-L223
25,643
apache/incubator-gobblin
gobblin-core/src/main/java/org/apache/gobblin/converter/json/JsonStringToJsonIntermediateConverter.java
JsonStringToJsonIntermediateConverter.parsePrimitiveType
private JsonElement parsePrimitiveType(JsonSchema schema, JsonElement value) throws DataConversionException { if ((schema.isType(NULL) || schema.isNullable()) && value.isJsonNull()) { return JsonNull.INSTANCE; } if ((schema.isType(NULL) && !value.isJsonNull()) || (!schema.isType(NULL) && value...
java
private JsonElement parsePrimitiveType(JsonSchema schema, JsonElement value) throws DataConversionException { if ((schema.isType(NULL) || schema.isNullable()) && value.isJsonNull()) { return JsonNull.INSTANCE; } if ((schema.isType(NULL) && !value.isJsonNull()) || (!schema.isType(NULL) && value...
[ "private", "JsonElement", "parsePrimitiveType", "(", "JsonSchema", "schema", ",", "JsonElement", "value", ")", "throws", "DataConversionException", "{", "if", "(", "(", "schema", ".", "isType", "(", "NULL", ")", "||", "schema", ".", "isNullable", "(", ")", ")"...
Parses primitive types @param schema @param value @return @throws DataConversionException
[ "Parses", "primitive", "types" ]
f029b4c0fea0fe4aa62f36dda2512344ff708bae
https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-core/src/main/java/org/apache/gobblin/converter/json/JsonStringToJsonIntermediateConverter.java#L232-L255
25,644
apache/incubator-gobblin
gobblin-utility/src/main/java/org/apache/gobblin/util/PathUtils.java
PathUtils.isAncestor
public static boolean isAncestor(Path possibleAncestor, Path fullPath) { return !relativizePath(fullPath, possibleAncestor).equals(getPathWithoutSchemeAndAuthority(fullPath)); }
java
public static boolean isAncestor(Path possibleAncestor, Path fullPath) { return !relativizePath(fullPath, possibleAncestor).equals(getPathWithoutSchemeAndAuthority(fullPath)); }
[ "public", "static", "boolean", "isAncestor", "(", "Path", "possibleAncestor", ",", "Path", "fullPath", ")", "{", "return", "!", "relativizePath", "(", "fullPath", ",", "possibleAncestor", ")", ".", "equals", "(", "getPathWithoutSchemeAndAuthority", "(", "fullPath", ...
Checks whether possibleAncestor is an ancestor of fullPath. @param possibleAncestor Possible ancestor of fullPath. @param fullPath path to check. @return true if possibleAncestor is an ancestor of fullPath.
[ "Checks", "whether", "possibleAncestor", "is", "an", "ancestor", "of", "fullPath", "." ]
f029b4c0fea0fe4aa62f36dda2512344ff708bae
https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-utility/src/main/java/org/apache/gobblin/util/PathUtils.java#L57-L59
25,645
apache/incubator-gobblin
gobblin-utility/src/main/java/org/apache/gobblin/util/PathUtils.java
PathUtils.getPathWithoutSchemeAndAuthority
public static Path getPathWithoutSchemeAndAuthority(Path path) { return new Path(null, null, path.toUri().getPath()); }
java
public static Path getPathWithoutSchemeAndAuthority(Path path) { return new Path(null, null, path.toUri().getPath()); }
[ "public", "static", "Path", "getPathWithoutSchemeAndAuthority", "(", "Path", "path", ")", "{", "return", "new", "Path", "(", "null", ",", "null", ",", "path", ".", "toUri", "(", ")", ".", "getPath", "(", ")", ")", ";", "}" ]
Removes the Scheme and Authority from a Path. @see Path @see URI
[ "Removes", "the", "Scheme", "and", "Authority", "from", "a", "Path", "." ]
f029b4c0fea0fe4aa62f36dda2512344ff708bae
https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-utility/src/main/java/org/apache/gobblin/util/PathUtils.java#L67-L69
25,646
apache/incubator-gobblin
gobblin-utility/src/main/java/org/apache/gobblin/util/PathUtils.java
PathUtils.getRootPath
public static Path getRootPath(Path path) { if (path.isRoot()) { return path; } return getRootPath(path.getParent()); }
java
public static Path getRootPath(Path path) { if (path.isRoot()) { return path; } return getRootPath(path.getParent()); }
[ "public", "static", "Path", "getRootPath", "(", "Path", "path", ")", "{", "if", "(", "path", ".", "isRoot", "(", ")", ")", "{", "return", "path", ";", "}", "return", "getRootPath", "(", "path", ".", "getParent", "(", ")", ")", ";", "}" ]
Returns the root path for the specified path. @see Path
[ "Returns", "the", "root", "path", "for", "the", "specified", "path", "." ]
f029b4c0fea0fe4aa62f36dda2512344ff708bae
https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-utility/src/main/java/org/apache/gobblin/util/PathUtils.java#L76-L81
25,647
apache/incubator-gobblin
gobblin-utility/src/main/java/org/apache/gobblin/util/PathUtils.java
PathUtils.withoutLeadingSeparator
public static Path withoutLeadingSeparator(Path path) { return new Path(StringUtils.removeStart(path.toString(), Path.SEPARATOR)); }
java
public static Path withoutLeadingSeparator(Path path) { return new Path(StringUtils.removeStart(path.toString(), Path.SEPARATOR)); }
[ "public", "static", "Path", "withoutLeadingSeparator", "(", "Path", "path", ")", "{", "return", "new", "Path", "(", "StringUtils", ".", "removeStart", "(", "path", ".", "toString", "(", ")", ",", "Path", ".", "SEPARATOR", ")", ")", ";", "}" ]
Removes the leading slash if present.
[ "Removes", "the", "leading", "slash", "if", "present", "." ]
f029b4c0fea0fe4aa62f36dda2512344ff708bae
https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-utility/src/main/java/org/apache/gobblin/util/PathUtils.java#L87-L89
25,648
apache/incubator-gobblin
gobblin-utility/src/main/java/org/apache/gobblin/util/PathUtils.java
PathUtils.deepestNonGlobPath
public static Path deepestNonGlobPath(Path input) { Path commonRoot = input; while (commonRoot != null && isGlob(commonRoot)) { commonRoot = commonRoot.getParent(); } return commonRoot; }
java
public static Path deepestNonGlobPath(Path input) { Path commonRoot = input; while (commonRoot != null && isGlob(commonRoot)) { commonRoot = commonRoot.getParent(); } return commonRoot; }
[ "public", "static", "Path", "deepestNonGlobPath", "(", "Path", "input", ")", "{", "Path", "commonRoot", "=", "input", ";", "while", "(", "commonRoot", "!=", "null", "&&", "isGlob", "(", "commonRoot", ")", ")", "{", "commonRoot", "=", "commonRoot", ".", "ge...
Finds the deepest ancestor of input that is not a glob.
[ "Finds", "the", "deepest", "ancestor", "of", "input", "that", "is", "not", "a", "glob", "." ]
f029b4c0fea0fe4aa62f36dda2512344ff708bae
https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-utility/src/main/java/org/apache/gobblin/util/PathUtils.java#L94-L101
25,649
apache/incubator-gobblin
gobblin-utility/src/main/java/org/apache/gobblin/util/PathUtils.java
PathUtils.deleteEmptyParentDirectories
public static void deleteEmptyParentDirectories(FileSystem fs, Path limitPath, Path startPath) throws IOException { if (PathUtils.isAncestor(limitPath, startPath) && !PathUtils.getPathWithoutSchemeAndAuthority(limitPath) .equals(PathUtils.getPathWithoutSchemeAndAuthority(startPath)) && fs.listStatus(s...
java
public static void deleteEmptyParentDirectories(FileSystem fs, Path limitPath, Path startPath) throws IOException { if (PathUtils.isAncestor(limitPath, startPath) && !PathUtils.getPathWithoutSchemeAndAuthority(limitPath) .equals(PathUtils.getPathWithoutSchemeAndAuthority(startPath)) && fs.listStatus(s...
[ "public", "static", "void", "deleteEmptyParentDirectories", "(", "FileSystem", "fs", ",", "Path", "limitPath", ",", "Path", "startPath", ")", "throws", "IOException", "{", "if", "(", "PathUtils", ".", "isAncestor", "(", "limitPath", ",", "startPath", ")", "&&", ...
Deletes empty directories starting with startPath and all ancestors up to but not including limitPath. @param fs {@link FileSystem} where paths are located. @param limitPath only {@link Path}s that are strict descendants of this path will be deleted. @param startPath first {@link Path} to delete. Afterwards empty ances...
[ "Deletes", "empty", "directories", "starting", "with", "startPath", "and", "all", "ancestors", "up", "to", "but", "not", "including", "limitPath", "." ]
f029b4c0fea0fe4aa62f36dda2512344ff708bae
https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-utility/src/main/java/org/apache/gobblin/util/PathUtils.java#L189-L200
25,650
apache/incubator-gobblin
gobblin-data-management/src/main/java/org/apache/gobblin/data/management/copy/recovery/RecoveryHelper.java
RecoveryHelper.getPersistDir
public static Optional<Path> getPersistDir(State state) throws IOException { if (state.contains(PERSIST_DIR_KEY)) { return Optional .of(new Path(state.getProp(PERSIST_DIR_KEY), UserGroupInformation.getCurrentUser().getShortUserName())); } return Optional.absent(); }
java
public static Optional<Path> getPersistDir(State state) throws IOException { if (state.contains(PERSIST_DIR_KEY)) { return Optional .of(new Path(state.getProp(PERSIST_DIR_KEY), UserGroupInformation.getCurrentUser().getShortUserName())); } return Optional.absent(); }
[ "public", "static", "Optional", "<", "Path", ">", "getPersistDir", "(", "State", "state", ")", "throws", "IOException", "{", "if", "(", "state", ".", "contains", "(", "PERSIST_DIR_KEY", ")", ")", "{", "return", "Optional", ".", "of", "(", "new", "Path", ...
Get the persist directory for this job. @param state {@link State} containing job information. @return A {@link Path} used as persist directory for this job. Note this path is user-specific for security reasons. @throws java.io.IOException
[ "Get", "the", "persist", "directory", "for", "this", "job", "." ]
f029b4c0fea0fe4aa62f36dda2512344ff708bae
https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-data-management/src/main/java/org/apache/gobblin/data/management/copy/recovery/RecoveryHelper.java#L69-L75
25,651
apache/incubator-gobblin
gobblin-data-management/src/main/java/org/apache/gobblin/data/management/copy/recovery/RecoveryHelper.java
RecoveryHelper.persistFile
public boolean persistFile(State state, CopyableFile file, Path path) throws IOException { if (!this.persistDir.isPresent()) { return false; } String guid = computeGuid(state, file); Path guidPath = new Path(this.persistDir.get(), guid); if (!this.fs.exists(guidPath)) { this.fs.mkdirs...
java
public boolean persistFile(State state, CopyableFile file, Path path) throws IOException { if (!this.persistDir.isPresent()) { return false; } String guid = computeGuid(state, file); Path guidPath = new Path(this.persistDir.get(), guid); if (!this.fs.exists(guidPath)) { this.fs.mkdirs...
[ "public", "boolean", "persistFile", "(", "State", "state", ",", "CopyableFile", "file", ",", "Path", "path", ")", "throws", "IOException", "{", "if", "(", "!", "this", ".", "persistDir", ".", "isPresent", "(", ")", ")", "{", "return", "false", ";", "}", ...
Moves a copied path into a persistent location managed by gobblin-distcp. This method is used when an already copied file cannot be successfully published. In future runs, instead of re-copying the file, distcp will use the persisted file. @param state {@link State} containing job information. @param file {@link org.a...
[ "Moves", "a", "copied", "path", "into", "a", "persistent", "location", "managed", "by", "gobblin", "-", "distcp", ".", "This", "method", "is", "used", "when", "an", "already", "copied", "file", "cannot", "be", "successfully", "published", ".", "In", "future"...
f029b4c0fea0fe4aa62f36dda2512344ff708bae
https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-data-management/src/main/java/org/apache/gobblin/data/management/copy/recovery/RecoveryHelper.java#L88-L108
25,652
apache/incubator-gobblin
gobblin-data-management/src/main/java/org/apache/gobblin/data/management/copy/recovery/RecoveryHelper.java
RecoveryHelper.shortenPathName
static String shortenPathName(Path path, int bytes) { String pathString = path.toUri().getPath(); String replaced = pathString.replace("/", "_"); if (replaced.length() <= bytes) { return replaced; } int bytesPerHalf = (bytes - 3) / 2; return replaced.substring(0, bytesPerHalf) + "..." + ...
java
static String shortenPathName(Path path, int bytes) { String pathString = path.toUri().getPath(); String replaced = pathString.replace("/", "_"); if (replaced.length() <= bytes) { return replaced; } int bytesPerHalf = (bytes - 3) / 2; return replaced.substring(0, bytesPerHalf) + "..." + ...
[ "static", "String", "shortenPathName", "(", "Path", "path", ",", "int", "bytes", ")", "{", "String", "pathString", "=", "path", ".", "toUri", "(", ")", ".", "getPath", "(", ")", ";", "String", "replaced", "=", "pathString", ".", "replace", "(", "\"/\"", ...
Shorten an absolute path into a sanitized String of length at most bytes. This is useful for including a summary of an absolute path in a file name. <p> For example: shortenPathName("/user/gobblin/foo/bar/myFile.txt", 25) will be shortened to "_user_gobbl..._myFile.txt". </p> @param path absolute {@link Path} to shor...
[ "Shorten", "an", "absolute", "path", "into", "a", "sanitized", "String", "of", "length", "at", "most", "bytes", ".", "This", "is", "useful", "for", "including", "a", "summary", "of", "an", "absolute", "path", "in", "a", "file", "name", "." ]
f029b4c0fea0fe4aa62f36dda2512344ff708bae
https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-data-management/src/main/java/org/apache/gobblin/data/management/copy/recovery/RecoveryHelper.java#L175-L185
25,653
apache/incubator-gobblin
gobblin-utility/src/main/java/org/apache/gobblin/util/ProxiedFileSystemWrapper.java
ProxiedFileSystemWrapper.getProxiedFileSystem
public FileSystem getProxiedFileSystem(State properties, AuthType authType, String authPath, String uri, final Configuration conf) throws IOException, InterruptedException, URISyntaxException { Preconditions.checkArgument(StringUtils.isNotBlank(properties.getProp(ConfigurationKeys.FS_PROXY_AS_USER_NAME)), ...
java
public FileSystem getProxiedFileSystem(State properties, AuthType authType, String authPath, String uri, final Configuration conf) throws IOException, InterruptedException, URISyntaxException { Preconditions.checkArgument(StringUtils.isNotBlank(properties.getProp(ConfigurationKeys.FS_PROXY_AS_USER_NAME)), ...
[ "public", "FileSystem", "getProxiedFileSystem", "(", "State", "properties", ",", "AuthType", "authType", ",", "String", "authPath", ",", "String", "uri", ",", "final", "Configuration", "conf", ")", "throws", "IOException", ",", "InterruptedException", ",", "URISynta...
Getter for proxiedFs, using the passed parameters to create an instance of a proxiedFs. @param properties @param authType is either TOKEN or KEYTAB. @param authPath is the KEYTAB location if the authType is KEYTAB; otherwise, it is the token file. @param uri File system URI. @throws IOException @throws InterruptedExcep...
[ "Getter", "for", "proxiedFs", "using", "the", "passed", "parameters", "to", "create", "an", "instance", "of", "a", "proxiedFs", "." ]
f029b4c0fea0fe4aa62f36dda2512344ff708bae
https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-utility/src/main/java/org/apache/gobblin/util/ProxiedFileSystemWrapper.java#L101-L141
25,654
apache/incubator-gobblin
gobblin-utility/src/main/java/org/apache/gobblin/util/ProxiedFileSystemWrapper.java
ProxiedFileSystemWrapper.getTokenFromSeqFile
private static Optional<Token<?>> getTokenFromSeqFile(String authPath, String proxyUserName) throws IOException { try (Closer closer = Closer.create()) { FileSystem localFs = FileSystem.getLocal(new Configuration()); SequenceFile.Reader tokenReader = closer.register(new SequenceFile.Reader(loc...
java
private static Optional<Token<?>> getTokenFromSeqFile(String authPath, String proxyUserName) throws IOException { try (Closer closer = Closer.create()) { FileSystem localFs = FileSystem.getLocal(new Configuration()); SequenceFile.Reader tokenReader = closer.register(new SequenceFile.Reader(loc...
[ "private", "static", "Optional", "<", "Token", "<", "?", ">", ">", "getTokenFromSeqFile", "(", "String", "authPath", ",", "String", "proxyUserName", ")", "throws", "IOException", "{", "try", "(", "Closer", "closer", "=", "Closer", ".", "create", "(", ")", ...
Get token from the token sequence file. @param authPath @param proxyUserName @return Token for proxyUserName if it exists. @throws IOException
[ "Get", "token", "from", "the", "token", "sequence", "file", "." ]
f029b4c0fea0fe4aa62f36dda2512344ff708bae
https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-utility/src/main/java/org/apache/gobblin/util/ProxiedFileSystemWrapper.java#L150-L165
25,655
apache/incubator-gobblin
gobblin-core/src/main/java/org/apache/gobblin/source/PartitionAwareFileRetrieverUtils.java
PartitionAwareFileRetrieverUtils.getLeadTimeDurationFromConfig
public static Duration getLeadTimeDurationFromConfig(State state) { String leadTimeProp = state.getProp(DATE_PARTITIONED_SOURCE_PARTITION_LEAD_TIME); if (leadTimeProp == null || leadTimeProp.length() == 0) { return DEFAULT_PARTITIONED_SOURCE_PARTITION_LEAD_TIME; } int leadTime = Integer.parseInt(...
java
public static Duration getLeadTimeDurationFromConfig(State state) { String leadTimeProp = state.getProp(DATE_PARTITIONED_SOURCE_PARTITION_LEAD_TIME); if (leadTimeProp == null || leadTimeProp.length() == 0) { return DEFAULT_PARTITIONED_SOURCE_PARTITION_LEAD_TIME; } int leadTime = Integer.parseInt(...
[ "public", "static", "Duration", "getLeadTimeDurationFromConfig", "(", "State", "state", ")", "{", "String", "leadTimeProp", "=", "state", ".", "getProp", "(", "DATE_PARTITIONED_SOURCE_PARTITION_LEAD_TIME", ")", ";", "if", "(", "leadTimeProp", "==", "null", "||", "le...
Retrieve the lead time duration from the LEAD_TIME and LEAD_TIME granularity config settings.
[ "Retrieve", "the", "lead", "time", "duration", "from", "the", "LEAD_TIME", "and", "LEAD_TIME", "granularity", "config", "settings", "." ]
f029b4c0fea0fe4aa62f36dda2512344ff708bae
https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-core/src/main/java/org/apache/gobblin/source/PartitionAwareFileRetrieverUtils.java#L38-L54
25,656
apache/incubator-gobblin
gobblin-modules/gobblin-compliance/src/main/java/org/apache/gobblin/compliance/purger/PurgeableHivePartitionDataset.java
PurgeableHivePartitionDataset.purge
public void purge() throws IOException { this.datasetOwner = getOwner(); State state = new State(this.state); this.datasetOwnerFs = ProxyUtils.getOwnerFs(state, this.datasetOwner); try (HiveProxyQueryExecutor queryExecutor = ProxyUtils.getQueryExecutor(state, this.datasetOwner)) { if (this.s...
java
public void purge() throws IOException { this.datasetOwner = getOwner(); State state = new State(this.state); this.datasetOwnerFs = ProxyUtils.getOwnerFs(state, this.datasetOwner); try (HiveProxyQueryExecutor queryExecutor = ProxyUtils.getQueryExecutor(state, this.datasetOwner)) { if (this.s...
[ "public", "void", "purge", "(", ")", "throws", "IOException", "{", "this", ".", "datasetOwner", "=", "getOwner", "(", ")", ";", "State", "state", "=", "new", "State", "(", "this", ".", "state", ")", ";", "this", ".", "datasetOwnerFs", "=", "ProxyUtils", ...
This method is responsible for actual purging. - It first creates a staging table partition with the same schema as of original table partition. - Staging table partition is then populated by original table left outer joined with compliance id table. - Alter query will then change the partition location to the staging...
[ "This", "method", "is", "responsible", "for", "actual", "purging", ".", "-", "It", "first", "creates", "a", "staging", "table", "partition", "with", "the", "same", "schema", "as", "of", "original", "table", "partition", ".", "-", "Staging", "table", "partiti...
f029b4c0fea0fe4aa62f36dda2512344ff708bae
https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-modules/gobblin-compliance/src/main/java/org/apache/gobblin/compliance/purger/PurgeableHivePartitionDataset.java#L83-L126
25,657
apache/incubator-gobblin
gobblin-yarn/src/main/java/org/apache/gobblin/yarn/GobblinYarnAppLauncher.java
GobblinYarnAppLauncher.launch
public void launch() throws IOException, YarnException { this.eventBus.register(this); String clusterName = this.config.getString(GobblinClusterConfigurationKeys.HELIX_CLUSTER_NAME_KEY); HelixUtils.createGobblinHelixCluster( this.config.getString(GobblinClusterConfigurationKeys.ZK_CONNECTION_STRING...
java
public void launch() throws IOException, YarnException { this.eventBus.register(this); String clusterName = this.config.getString(GobblinClusterConfigurationKeys.HELIX_CLUSTER_NAME_KEY); HelixUtils.createGobblinHelixCluster( this.config.getString(GobblinClusterConfigurationKeys.ZK_CONNECTION_STRING...
[ "public", "void", "launch", "(", ")", "throws", "IOException", ",", "YarnException", "{", "this", ".", "eventBus", ".", "register", "(", "this", ")", ";", "String", "clusterName", "=", "this", ".", "config", ".", "getString", "(", "GobblinClusterConfigurationK...
Launch a new Gobblin instance on Yarn. @throws IOException if there's something wrong launching the application @throws YarnException if there's something wrong launching the application
[ "Launch", "a", "new", "Gobblin", "instance", "on", "Yarn", "." ]
f029b4c0fea0fe4aa62f36dda2512344ff708bae
https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-yarn/src/main/java/org/apache/gobblin/yarn/GobblinYarnAppLauncher.java#L249-L303
25,658
apache/incubator-gobblin
gobblin-modules/gobblin-compliance/src/main/java/org/apache/gobblin/compliance/restore/RestorableHivePartitionDatasetFinder.java
RestorableHivePartitionDatasetFinder.findDatasets
public List<HivePartitionDataset> findDatasets() throws IOException { Preconditions.checkArgument(this.state.contains(ComplianceConfigurationKeys.RESTORE_DATASET), "Missing required property " + ComplianceConfigurationKeys.RESTORE_DATASET); HivePartitionDataset hivePartitionDataset = HiveP...
java
public List<HivePartitionDataset> findDatasets() throws IOException { Preconditions.checkArgument(this.state.contains(ComplianceConfigurationKeys.RESTORE_DATASET), "Missing required property " + ComplianceConfigurationKeys.RESTORE_DATASET); HivePartitionDataset hivePartitionDataset = HiveP...
[ "public", "List", "<", "HivePartitionDataset", ">", "findDatasets", "(", ")", "throws", "IOException", "{", "Preconditions", ".", "checkArgument", "(", "this", ".", "state", ".", "contains", "(", "ComplianceConfigurationKeys", ".", "RESTORE_DATASET", ")", ",", "\"...
Will return a Singleton list of HivePartitionDataset to be restored.
[ "Will", "return", "a", "Singleton", "list", "of", "HivePartitionDataset", "to", "be", "restored", "." ]
f029b4c0fea0fe4aa62f36dda2512344ff708bae
https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-modules/gobblin-compliance/src/main/java/org/apache/gobblin/compliance/restore/RestorableHivePartitionDatasetFinder.java#L59-L68
25,659
apache/incubator-gobblin
gobblin-modules/gobblin-kafka-08/src/main/java/org/apache/gobblin/metrics/kafka/KafkaPusher.java
KafkaPusher.pushMessages
public void pushMessages(List<byte[]> messages) { List<KeyedMessage<String, byte[]>> keyedMessages = Lists.transform(messages, new Function<byte[], KeyedMessage<String, byte[]>>() { @Nullable @Override public KeyedMessage<String, byte[]> apply(byte[] bytes) { return...
java
public void pushMessages(List<byte[]> messages) { List<KeyedMessage<String, byte[]>> keyedMessages = Lists.transform(messages, new Function<byte[], KeyedMessage<String, byte[]>>() { @Nullable @Override public KeyedMessage<String, byte[]> apply(byte[] bytes) { return...
[ "public", "void", "pushMessages", "(", "List", "<", "byte", "[", "]", ">", "messages", ")", "{", "List", "<", "KeyedMessage", "<", "String", ",", "byte", "[", "]", ">", ">", "keyedMessages", "=", "Lists", ".", "transform", "(", "messages", ",", "new", ...
Push all mbyte array messages to the Kafka topic. @param messages List of byte array messages to push to Kakfa.
[ "Push", "all", "mbyte", "array", "messages", "to", "the", "Kafka", "topic", "." ]
f029b4c0fea0fe4aa62f36dda2512344ff708bae
https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-modules/gobblin-kafka-08/src/main/java/org/apache/gobblin/metrics/kafka/KafkaPusher.java#L60-L70
25,660
apache/incubator-gobblin
gobblin-modules/gobblin-kafka-08/src/main/java/org/apache/gobblin/metrics/kafka/KafkaPusher.java
KafkaPusher.createProducer
protected ProducerCloseable<String, byte[]> createProducer(ProducerConfig config) { return this.closer.register(new ProducerCloseable<String, byte[]>(config)); }
java
protected ProducerCloseable<String, byte[]> createProducer(ProducerConfig config) { return this.closer.register(new ProducerCloseable<String, byte[]>(config)); }
[ "protected", "ProducerCloseable", "<", "String", ",", "byte", "[", "]", ">", "createProducer", "(", "ProducerConfig", "config", ")", "{", "return", "this", ".", "closer", ".", "register", "(", "new", "ProducerCloseable", "<", "String", ",", "byte", "[", "]",...
Actually creates the Kafka producer.
[ "Actually", "creates", "the", "Kafka", "producer", "." ]
f029b4c0fea0fe4aa62f36dda2512344ff708bae
https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-modules/gobblin-kafka-08/src/main/java/org/apache/gobblin/metrics/kafka/KafkaPusher.java#L81-L83
25,661
apache/incubator-gobblin
gobblin-core/src/main/java/org/apache/gobblin/writer/ThrottleWriter.java
ThrottleWriter.acquirePermits
private void acquirePermits(long permits) throws InterruptedException { long startMs = System.currentTimeMillis(); //Measure in milliseconds. (Nanoseconds are more precise but expensive and not worth for this case) limiter.acquirePermits(permits); long permitAcquisitionTime = System.currentTimeMillis() - st...
java
private void acquirePermits(long permits) throws InterruptedException { long startMs = System.currentTimeMillis(); //Measure in milliseconds. (Nanoseconds are more precise but expensive and not worth for this case) limiter.acquirePermits(permits); long permitAcquisitionTime = System.currentTimeMillis() - st...
[ "private", "void", "acquirePermits", "(", "long", "permits", ")", "throws", "InterruptedException", "{", "long", "startMs", "=", "System", ".", "currentTimeMillis", "(", ")", ";", "//Measure in milliseconds. (Nanoseconds are more precise but expensive and not worth for this cas...
Acquire permit along with emitting metrics if enabled. @param permits @throws InterruptedException
[ "Acquire", "permit", "along", "with", "emitting", "metrics", "if", "enabled", "." ]
f029b4c0fea0fe4aa62f36dda2512344ff708bae
https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-core/src/main/java/org/apache/gobblin/writer/ThrottleWriter.java#L154-L162
25,662
apache/incubator-gobblin
gobblin-modules/gobblin-kafka-common/src/main/java/org/apache/gobblin/metrics/kafka/KafkaSchemaRegistry.java
KafkaSchemaRegistry.getSchemaByKey
public S getSchemaByKey(K key) throws SchemaRegistryException { try { return cachedSchemasByKeys.get(key); } catch (ExecutionException e) { throw new SchemaRegistryException(String.format("Schema with key %s cannot be retrieved", key), e); } }
java
public S getSchemaByKey(K key) throws SchemaRegistryException { try { return cachedSchemasByKeys.get(key); } catch (ExecutionException e) { throw new SchemaRegistryException(String.format("Schema with key %s cannot be retrieved", key), e); } }
[ "public", "S", "getSchemaByKey", "(", "K", "key", ")", "throws", "SchemaRegistryException", "{", "try", "{", "return", "cachedSchemasByKeys", ".", "get", "(", "key", ")", ";", "}", "catch", "(", "ExecutionException", "e", ")", "{", "throw", "new", "SchemaReg...
Get schema from schema registry by key. @throws SchemaRegistryException if failed to get schema by key.
[ "Get", "schema", "from", "schema", "registry", "by", "key", "." ]
f029b4c0fea0fe4aa62f36dda2512344ff708bae
https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-modules/gobblin-kafka-common/src/main/java/org/apache/gobblin/metrics/kafka/KafkaSchemaRegistry.java#L97-L103
25,663
apache/incubator-gobblin
gobblin-utility/src/main/java/org/apache/gobblin/util/HeapDumpForTaskUtils.java
HeapDumpForTaskUtils.generateDumpScript
public static void generateDumpScript(Path dumpScript, FileSystem fs, String heapFileName, String chmod) throws IOException { if (fs.exists(dumpScript)) { LOG.info("Heap dump script already exists: " + dumpScript); return; } try (BufferedWriter scriptWriter = new BufferedWriter(ne...
java
public static void generateDumpScript(Path dumpScript, FileSystem fs, String heapFileName, String chmod) throws IOException { if (fs.exists(dumpScript)) { LOG.info("Heap dump script already exists: " + dumpScript); return; } try (BufferedWriter scriptWriter = new BufferedWriter(ne...
[ "public", "static", "void", "generateDumpScript", "(", "Path", "dumpScript", ",", "FileSystem", "fs", ",", "String", "heapFileName", ",", "String", "chmod", ")", "throws", "IOException", "{", "if", "(", "fs", ".", "exists", "(", "dumpScript", ")", ")", "{", ...
Generate the dumpScript, which is used when OOM error is thrown during task execution. The current content dumpScript puts the .prof files to the DUMP_FOLDER within the same directory of the dumpScript. User needs to add the following options to the task java.opts: -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=./h...
[ "Generate", "the", "dumpScript", "which", "is", "used", "when", "OOM", "error", "is", "thrown", "during", "task", "execution", ".", "The", "current", "content", "dumpScript", "puts", "the", ".", "prof", "files", "to", "the", "DUMP_FOLDER", "within", "the", "...
f029b4c0fea0fe4aa62f36dda2512344ff708bae
https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-utility/src/main/java/org/apache/gobblin/util/HeapDumpForTaskUtils.java#L55-L86
25,664
apache/incubator-gobblin
gobblin-metrics-libs/gobblin-metrics-base/src/main/java/org/apache/gobblin/metrics/event/EventSubmitter.java
EventSubmitter.submit
public static void submit(Optional<EventSubmitter> submitter, String name) { if (submitter.isPresent()) { submitter.get().submit(name); } }
java
public static void submit(Optional<EventSubmitter> submitter, String name) { if (submitter.isPresent()) { submitter.get().submit(name); } }
[ "public", "static", "void", "submit", "(", "Optional", "<", "EventSubmitter", ">", "submitter", ",", "String", "name", ")", "{", "if", "(", "submitter", ".", "isPresent", "(", ")", ")", "{", "submitter", ".", "get", "(", ")", ".", "submit", "(", "name"...
Calls submit on submitter if present.
[ "Calls", "submit", "on", "submitter", "if", "present", "." ]
f029b4c0fea0fe4aa62f36dda2512344ff708bae
https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-metrics-libs/gobblin-metrics-base/src/main/java/org/apache/gobblin/metrics/event/EventSubmitter.java#L99-L103
25,665
apache/incubator-gobblin
gobblin-utility/src/main/java/org/apache/gobblin/util/JvmUtils.java
JvmUtils.getJvmInputArguments
public static String getJvmInputArguments() { RuntimeMXBean runtimeMxBean = ManagementFactory.getRuntimeMXBean(); List<String> arguments = runtimeMxBean.getInputArguments(); return String.format("JVM Input Arguments: %s", JOINER.join(arguments)); }
java
public static String getJvmInputArguments() { RuntimeMXBean runtimeMxBean = ManagementFactory.getRuntimeMXBean(); List<String> arguments = runtimeMxBean.getInputArguments(); return String.format("JVM Input Arguments: %s", JOINER.join(arguments)); }
[ "public", "static", "String", "getJvmInputArguments", "(", ")", "{", "RuntimeMXBean", "runtimeMxBean", "=", "ManagementFactory", ".", "getRuntimeMXBean", "(", ")", ";", "List", "<", "String", ">", "arguments", "=", "runtimeMxBean", ".", "getInputArguments", "(", "...
Gets the input arguments passed to the JVM. @return The input arguments.
[ "Gets", "the", "input", "arguments", "passed", "to", "the", "JVM", "." ]
f029b4c0fea0fe4aa62f36dda2512344ff708bae
https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-utility/src/main/java/org/apache/gobblin/util/JvmUtils.java#L39-L43
25,666
apache/incubator-gobblin
gobblin-utility/src/main/java/org/apache/gobblin/util/JvmUtils.java
JvmUtils.formatJvmArguments
public static String formatJvmArguments(Optional<String> jvmArguments) { if (jvmArguments.isPresent()) { return PORT_UTILS.replacePortTokens(jvmArguments.get()); } return StringUtils.EMPTY; }
java
public static String formatJvmArguments(Optional<String> jvmArguments) { if (jvmArguments.isPresent()) { return PORT_UTILS.replacePortTokens(jvmArguments.get()); } return StringUtils.EMPTY; }
[ "public", "static", "String", "formatJvmArguments", "(", "Optional", "<", "String", ">", "jvmArguments", ")", "{", "if", "(", "jvmArguments", ".", "isPresent", "(", ")", ")", "{", "return", "PORT_UTILS", ".", "replacePortTokens", "(", "jvmArguments", ".", "get...
Formats the specified jvm arguments such that any tokens are replaced with concrete values; @param jvmArguments @return The formatted jvm arguments.
[ "Formats", "the", "specified", "jvm", "arguments", "such", "that", "any", "tokens", "are", "replaced", "with", "concrete", "values", ";" ]
f029b4c0fea0fe4aa62f36dda2512344ff708bae
https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-utility/src/main/java/org/apache/gobblin/util/JvmUtils.java#L50-L55
25,667
apache/incubator-gobblin
gobblin-modules/gobblin-sql/src/main/java/org/apache/gobblin/converter/initializer/AvroToJdbcEntryConverterInitializer.java
AvroToJdbcEntryConverterInitializer.initialize
@Override public void initialize() { String table = Preconditions.checkNotNull(this.state.getProp(ForkOperatorUtils .getPropertyNameForBranch(JdbcPublisher.JDBC_PUBLISHER_FINAL_TABLE_NAME, this.branches, this.branchId))); String db = Preconditions.checkNotNull(this.state.getProp(ForkOperatorUtils ...
java
@Override public void initialize() { String table = Preconditions.checkNotNull(this.state.getProp(ForkOperatorUtils .getPropertyNameForBranch(JdbcPublisher.JDBC_PUBLISHER_FINAL_TABLE_NAME, this.branches, this.branchId))); String db = Preconditions.checkNotNull(this.state.getProp(ForkOperatorUtils ...
[ "@", "Override", "public", "void", "initialize", "(", ")", "{", "String", "table", "=", "Preconditions", ".", "checkNotNull", "(", "this", ".", "state", ".", "getProp", "(", "ForkOperatorUtils", ".", "getPropertyNameForBranch", "(", "JdbcPublisher", ".", "JDBC_P...
AvroToJdbcEntryConverter list of date columns existing in the table. As we don't want each converter making a connection against database to get the same information. Here, ConverterInitializer will retrieve it and store it into WorkUnit so that AvroToJdbcEntryConverter will use it later. {@inheritDoc} @see org.apache...
[ "AvroToJdbcEntryConverter", "list", "of", "date", "columns", "existing", "in", "the", "table", ".", "As", "we", "don", "t", "want", "each", "converter", "making", "a", "connection", "against", "database", "to", "get", "the", "same", "information", ".", "Here",...
f029b4c0fea0fe4aa62f36dda2512344ff708bae
https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-modules/gobblin-sql/src/main/java/org/apache/gobblin/converter/initializer/AvroToJdbcEntryConverterInitializer.java#L80-L99
25,668
apache/incubator-gobblin
gobblin-service/src/main/java/org/apache/gobblin/service/modules/core/GitMonitoringService.java
GitMonitoringService.startUp
@Override protected void startUp() { log.info("Starting the " + getClass().getSimpleName()); log.info("Polling git with interval {} ", this.pollingInterval); // Schedule the job config fetch task this.scheduledExecutor.scheduleAtFixedRate(new Runnable() { @Override public void run() { ...
java
@Override protected void startUp() { log.info("Starting the " + getClass().getSimpleName()); log.info("Polling git with interval {} ", this.pollingInterval); // Schedule the job config fetch task this.scheduledExecutor.scheduleAtFixedRate(new Runnable() { @Override public void run() { ...
[ "@", "Override", "protected", "void", "startUp", "(", ")", "{", "log", ".", "info", "(", "\"Starting the \"", "+", "getClass", "(", ")", ".", "getSimpleName", "(", ")", ")", ";", "log", ".", "info", "(", "\"Polling git with interval {} \"", ",", "this", "....
Start the service.
[ "Start", "the", "service", "." ]
f029b4c0fea0fe4aa62f36dda2512344ff708bae
https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-service/src/main/java/org/apache/gobblin/service/modules/core/GitMonitoringService.java#L195-L214
25,669
apache/incubator-gobblin
gobblin-service/src/main/java/org/apache/gobblin/service/modules/core/GitMonitoringService.java
GitMonitoringService.processGitConfigChangesHelper
void processGitConfigChangesHelper(List<DiffEntry> changes) throws IOException { for (DiffEntry change : changes) { switch (change.getChangeType()) { case ADD: case MODIFY: addChange(change); break; case DELETE: removeChange(change); break; ...
java
void processGitConfigChangesHelper(List<DiffEntry> changes) throws IOException { for (DiffEntry change : changes) { switch (change.getChangeType()) { case ADD: case MODIFY: addChange(change); break; case DELETE: removeChange(change); break; ...
[ "void", "processGitConfigChangesHelper", "(", "List", "<", "DiffEntry", ">", "changes", ")", "throws", "IOException", "{", "for", "(", "DiffEntry", "change", ":", "changes", ")", "{", "switch", "(", "change", ".", "getChangeType", "(", ")", ")", "{", "case",...
A helper method where actual processing of the list of changes since the last refresh of the repository takes place and the changes applied. @throws IOException
[ "A", "helper", "method", "where", "actual", "processing", "of", "the", "list", "of", "changes", "since", "the", "last", "refresh", "of", "the", "repository", "takes", "place", "and", "the", "changes", "applied", "." ]
f029b4c0fea0fe4aa62f36dda2512344ff708bae
https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-service/src/main/java/org/apache/gobblin/service/modules/core/GitMonitoringService.java#L234-L255
25,670
apache/incubator-gobblin
gobblin-api/src/main/java/org/apache/gobblin/configuration/State.java
State.addAll
public void addAll(State otherState) { Properties diffCommonProps = new Properties(); diffCommonProps.putAll(Maps.difference(this.commonProperties, otherState.commonProperties).entriesOnlyOnRight()); addAll(diffCommonProps); addAll(otherState.specProperties); }
java
public void addAll(State otherState) { Properties diffCommonProps = new Properties(); diffCommonProps.putAll(Maps.difference(this.commonProperties, otherState.commonProperties).entriesOnlyOnRight()); addAll(diffCommonProps); addAll(otherState.specProperties); }
[ "public", "void", "addAll", "(", "State", "otherState", ")", "{", "Properties", "diffCommonProps", "=", "new", "Properties", "(", ")", ";", "diffCommonProps", ".", "putAll", "(", "Maps", ".", "difference", "(", "this", ".", "commonProperties", ",", "otherState...
Populates this instance with properties of the other instance. @param otherState the other {@link State} instance
[ "Populates", "this", "instance", "with", "properties", "of", "the", "other", "instance", "." ]
f029b4c0fea0fe4aa62f36dda2512344ff708bae
https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-api/src/main/java/org/apache/gobblin/configuration/State.java#L112-L117
25,671
apache/incubator-gobblin
gobblin-api/src/main/java/org/apache/gobblin/configuration/State.java
State.getProp
public String getProp(String key) { if (this.specProperties.containsKey(key)) { return this.specProperties.getProperty(key); } return this.commonProperties.getProperty(key); }
java
public String getProp(String key) { if (this.specProperties.containsKey(key)) { return this.specProperties.getProperty(key); } return this.commonProperties.getProperty(key); }
[ "public", "String", "getProp", "(", "String", "key", ")", "{", "if", "(", "this", ".", "specProperties", ".", "containsKey", "(", "key", ")", ")", "{", "return", "this", ".", "specProperties", ".", "getProperty", "(", "key", ")", ";", "}", "return", "t...
Get the value of a property. @param key property key @return value associated with the key as a string or <code>null</code> if the property is not set
[ "Get", "the", "value", "of", "a", "property", "." ]
f029b4c0fea0fe4aa62f36dda2512344ff708bae
https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-api/src/main/java/org/apache/gobblin/configuration/State.java#L262-L267
25,672
apache/incubator-gobblin
gobblin-api/src/main/java/org/apache/gobblin/configuration/State.java
State.getPropAsList
public List<String> getPropAsList(String key, String def) { return LIST_SPLITTER.splitToList(getProp(key, def)); }
java
public List<String> getPropAsList(String key, String def) { return LIST_SPLITTER.splitToList(getProp(key, def)); }
[ "public", "List", "<", "String", ">", "getPropAsList", "(", "String", "key", ",", "String", "def", ")", "{", "return", "LIST_SPLITTER", ".", "splitToList", "(", "getProp", "(", "key", ",", "def", ")", ")", ";", "}" ]
Get the value of a property as a list of strings, using the given default value if the property is not set. @param key property key @param def default value @return value (the default value if the property is not set) associated with the key as a list of strings
[ "Get", "the", "value", "of", "a", "property", "as", "a", "list", "of", "strings", "using", "the", "given", "default", "value", "if", "the", "property", "is", "not", "set", "." ]
f029b4c0fea0fe4aa62f36dda2512344ff708bae
https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-api/src/main/java/org/apache/gobblin/configuration/State.java#L300-L302
25,673
apache/incubator-gobblin
gobblin-api/src/main/java/org/apache/gobblin/configuration/State.java
State.getPropAsLong
public long getPropAsLong(String key, long def) { return Long.parseLong(getProp(key, String.valueOf(def))); }
java
public long getPropAsLong(String key, long def) { return Long.parseLong(getProp(key, String.valueOf(def))); }
[ "public", "long", "getPropAsLong", "(", "String", "key", ",", "long", "def", ")", "{", "return", "Long", ".", "parseLong", "(", "getProp", "(", "key", ",", "String", ".", "valueOf", "(", "def", ")", ")", ")", ";", "}" ]
Get the value of a property as a long integer, using the given default value if the property is not set. @param key property key @param def default value @return long integer value associated with the key or the default value if the property is not set
[ "Get", "the", "value", "of", "a", "property", "as", "a", "long", "integer", "using", "the", "given", "default", "value", "if", "the", "property", "is", "not", "set", "." ]
f029b4c0fea0fe4aa62f36dda2512344ff708bae
https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-api/src/main/java/org/apache/gobblin/configuration/State.java#L363-L365
25,674
apache/incubator-gobblin
gobblin-api/src/main/java/org/apache/gobblin/configuration/State.java
State.getPropAsInt
public int getPropAsInt(String key, int def) { return Integer.parseInt(getProp(key, String.valueOf(def))); }
java
public int getPropAsInt(String key, int def) { return Integer.parseInt(getProp(key, String.valueOf(def))); }
[ "public", "int", "getPropAsInt", "(", "String", "key", ",", "int", "def", ")", "{", "return", "Integer", ".", "parseInt", "(", "getProp", "(", "key", ",", "String", ".", "valueOf", "(", "def", ")", ")", ")", ";", "}" ]
Get the value of a property as an integer, using the given default value if the property is not set. @param key property key @param def default value @return integer value associated with the key or the default value if the property is not set
[ "Get", "the", "value", "of", "a", "property", "as", "an", "integer", "using", "the", "given", "default", "value", "if", "the", "property", "is", "not", "set", "." ]
f029b4c0fea0fe4aa62f36dda2512344ff708bae
https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-api/src/main/java/org/apache/gobblin/configuration/State.java#L384-L386
25,675
apache/incubator-gobblin
gobblin-api/src/main/java/org/apache/gobblin/configuration/State.java
State.getPropAsDouble
public double getPropAsDouble(String key, double def) { return Double.parseDouble(getProp(key, String.valueOf(def))); }
java
public double getPropAsDouble(String key, double def) { return Double.parseDouble(getProp(key, String.valueOf(def))); }
[ "public", "double", "getPropAsDouble", "(", "String", "key", ",", "double", "def", ")", "{", "return", "Double", ".", "parseDouble", "(", "getProp", "(", "key", ",", "String", ".", "valueOf", "(", "def", ")", ")", ")", ";", "}" ]
Get the value of a property as a double, using the given default value if the property is not set. @param key property key @param def default value @return double value associated with the key or the default value if the property is not set
[ "Get", "the", "value", "of", "a", "property", "as", "a", "double", "using", "the", "given", "default", "value", "if", "the", "property", "is", "not", "set", "." ]
f029b4c0fea0fe4aa62f36dda2512344ff708bae
https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-api/src/main/java/org/apache/gobblin/configuration/State.java#L449-L451
25,676
apache/incubator-gobblin
gobblin-api/src/main/java/org/apache/gobblin/configuration/State.java
State.getPropAsBoolean
public boolean getPropAsBoolean(String key, boolean def) { return Boolean.parseBoolean(getProp(key, String.valueOf(def))); }
java
public boolean getPropAsBoolean(String key, boolean def) { return Boolean.parseBoolean(getProp(key, String.valueOf(def))); }
[ "public", "boolean", "getPropAsBoolean", "(", "String", "key", ",", "boolean", "def", ")", "{", "return", "Boolean", ".", "parseBoolean", "(", "getProp", "(", "key", ",", "String", ".", "valueOf", "(", "def", ")", ")", ")", ";", "}" ]
Get the value of a property as a boolean, using the given default value if the property is not set. @param key property key @param def default value @return boolean value associated with the key or the default value if the property is not set
[ "Get", "the", "value", "of", "a", "property", "as", "a", "boolean", "using", "the", "given", "default", "value", "if", "the", "property", "is", "not", "set", "." ]
f029b4c0fea0fe4aa62f36dda2512344ff708bae
https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-api/src/main/java/org/apache/gobblin/configuration/State.java#L470-L472
25,677
apache/incubator-gobblin
gobblin-api/src/main/java/org/apache/gobblin/configuration/State.java
State.removeProp
public void removeProp(String key) { this.specProperties.remove(key); if (this.commonProperties.containsKey(key)) { // This case should not happen. Properties commonPropsCopy = new Properties(); commonPropsCopy.putAll(this.commonProperties); commonPropsCopy.remove(key); this.common...
java
public void removeProp(String key) { this.specProperties.remove(key); if (this.commonProperties.containsKey(key)) { // This case should not happen. Properties commonPropsCopy = new Properties(); commonPropsCopy.putAll(this.commonProperties); commonPropsCopy.remove(key); this.common...
[ "public", "void", "removeProp", "(", "String", "key", ")", "{", "this", ".", "specProperties", ".", "remove", "(", "key", ")", ";", "if", "(", "this", ".", "commonProperties", ".", "containsKey", "(", "key", ")", ")", "{", "// This case should not happen.", ...
Remove a property if it exists. @param key property key
[ "Remove", "a", "property", "if", "it", "exists", "." ]
f029b4c0fea0fe4aa62f36dda2512344ff708bae
https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-api/src/main/java/org/apache/gobblin/configuration/State.java#L492-L501
25,678
apache/incubator-gobblin
gobblin-api/src/main/java/org/apache/gobblin/configuration/State.java
State.removePropsWithPrefix
public void removePropsWithPrefix(String prefix) { this.specProperties.entrySet().removeIf(entry -> ((String) entry.getKey()).startsWith(prefix)); Properties newCommonProperties = null; for (Object key: this.commonProperties.keySet()) { if (((String)key).startsWith(prefix)) { if (newCommonPro...
java
public void removePropsWithPrefix(String prefix) { this.specProperties.entrySet().removeIf(entry -> ((String) entry.getKey()).startsWith(prefix)); Properties newCommonProperties = null; for (Object key: this.commonProperties.keySet()) { if (((String)key).startsWith(prefix)) { if (newCommonPro...
[ "public", "void", "removePropsWithPrefix", "(", "String", "prefix", ")", "{", "this", ".", "specProperties", ".", "entrySet", "(", ")", ".", "removeIf", "(", "entry", "->", "(", "(", "String", ")", "entry", ".", "getKey", "(", ")", ")", ".", "startsWith"...
Remove all properties with a certain keyPrefix @param prefix key prefix
[ "Remove", "all", "properties", "with", "a", "certain", "keyPrefix" ]
f029b4c0fea0fe4aa62f36dda2512344ff708bae
https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-api/src/main/java/org/apache/gobblin/configuration/State.java#L508-L525
25,679
apache/incubator-gobblin
gobblin-core/src/main/java/org/apache/gobblin/publisher/TimestampDataPublisher.java
TimestampDataPublisher.getDbTableName
private String getDbTableName(String schemaName) { Preconditions.checkArgument(schemaName.matches(".+_.+_.+")); return schemaName.replaceFirst("_", ".").substring(0, schemaName.lastIndexOf('_')); }
java
private String getDbTableName(String schemaName) { Preconditions.checkArgument(schemaName.matches(".+_.+_.+")); return schemaName.replaceFirst("_", ".").substring(0, schemaName.lastIndexOf('_')); }
[ "private", "String", "getDbTableName", "(", "String", "schemaName", ")", "{", "Preconditions", ".", "checkArgument", "(", "schemaName", ".", "matches", "(", "\".+_.+_.+\"", ")", ")", ";", "return", "schemaName", ".", "replaceFirst", "(", "\"_\"", ",", "\".\"", ...
Translate schema name to "dbname.tablename" to use in path @param schemaName In format "dbname_tablename_xxxxx" @return db and table name in format "dbname.tablename"
[ "Translate", "schema", "name", "to", "dbname", ".", "tablename", "to", "use", "in", "path" ]
f029b4c0fea0fe4aa62f36dda2512344ff708bae
https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-core/src/main/java/org/apache/gobblin/publisher/TimestampDataPublisher.java#L90-L93
25,680
apache/incubator-gobblin
gobblin-data-management/src/main/java/org/apache/gobblin/data/management/copy/splitter/DistcpFileSplitter.java
DistcpFileSplitter.mergeAllSplitWorkUnits
public static Collection<WorkUnitState> mergeAllSplitWorkUnits(FileSystem fs, Collection<WorkUnitState> workUnits) throws IOException { ListMultimap<CopyableFile, WorkUnitState> splitWorkUnitsMap = ArrayListMultimap.create(); for (WorkUnitState workUnit : workUnits) { if (isSplitWorkUnit(workUnit)) ...
java
public static Collection<WorkUnitState> mergeAllSplitWorkUnits(FileSystem fs, Collection<WorkUnitState> workUnits) throws IOException { ListMultimap<CopyableFile, WorkUnitState> splitWorkUnitsMap = ArrayListMultimap.create(); for (WorkUnitState workUnit : workUnits) { if (isSplitWorkUnit(workUnit)) ...
[ "public", "static", "Collection", "<", "WorkUnitState", ">", "mergeAllSplitWorkUnits", "(", "FileSystem", "fs", ",", "Collection", "<", "WorkUnitState", ">", "workUnits", ")", "throws", "IOException", "{", "ListMultimap", "<", "CopyableFile", ",", "WorkUnitState", "...
Finds all split work units in the input collection and merges the file parts into the expected output files. @param fs {@link FileSystem} where file parts exist. @param workUnits Collection of {@link WorkUnitState}s possibly containing split work units. @return The collection of {@link WorkUnitState}s where split work ...
[ "Finds", "all", "split", "work", "units", "in", "the", "input", "collection", "and", "merges", "the", "file", "parts", "into", "the", "expected", "output", "files", "." ]
f029b4c0fea0fe4aa62f36dda2512344ff708bae
https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-data-management/src/main/java/org/apache/gobblin/data/management/copy/splitter/DistcpFileSplitter.java#L144-L174
25,681
apache/incubator-gobblin
gobblin-yarn/src/main/java/org/apache/gobblin/yarn/YarnService.java
YarnService.shouldStickToTheSameNode
private boolean shouldStickToTheSameNode(int containerExitStatus) { switch (containerExitStatus) { case ContainerExitStatus.DISKS_FAILED: return false; case ContainerExitStatus.ABORTED: // Mostly likely this exit status is due to node failures because the // application itself wi...
java
private boolean shouldStickToTheSameNode(int containerExitStatus) { switch (containerExitStatus) { case ContainerExitStatus.DISKS_FAILED: return false; case ContainerExitStatus.ABORTED: // Mostly likely this exit status is due to node failures because the // application itself wi...
[ "private", "boolean", "shouldStickToTheSameNode", "(", "int", "containerExitStatus", ")", "{", "switch", "(", "containerExitStatus", ")", "{", "case", "ContainerExitStatus", ".", "DISKS_FAILED", ":", "return", "false", ";", "case", "ContainerExitStatus", ".", "ABORTED...
Check the exit status of a completed container and see if the replacement container should try to be started on the same node. Some exit status indicates a disk or node failure and in such cases the replacement container should try to be started on a different node.
[ "Check", "the", "exit", "status", "of", "a", "completed", "container", "and", "see", "if", "the", "replacement", "container", "should", "try", "to", "be", "started", "on", "the", "same", "node", ".", "Some", "exit", "status", "indicates", "a", "disk", "or"...
f029b4c0fea0fe4aa62f36dda2512344ff708bae
https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-yarn/src/main/java/org/apache/gobblin/yarn/YarnService.java#L434-L446
25,682
apache/incubator-gobblin
gobblin-yarn/src/main/java/org/apache/gobblin/yarn/YarnService.java
YarnService.handleContainerCompletion
private void handleContainerCompletion(ContainerStatus containerStatus) { Map.Entry<Container, String> completedContainerEntry = this.containerMap.remove(containerStatus.getContainerId()); String completedInstanceName = completedContainerEntry.getValue(); LOGGER.info(String.format("Container %s running Hel...
java
private void handleContainerCompletion(ContainerStatus containerStatus) { Map.Entry<Container, String> completedContainerEntry = this.containerMap.remove(containerStatus.getContainerId()); String completedInstanceName = completedContainerEntry.getValue(); LOGGER.info(String.format("Container %s running Hel...
[ "private", "void", "handleContainerCompletion", "(", "ContainerStatus", "containerStatus", ")", "{", "Map", ".", "Entry", "<", "Container", ",", "String", ">", "completedContainerEntry", "=", "this", ".", "containerMap", ".", "remove", "(", "containerStatus", ".", ...
Handle the completion of a container. A new container will be requested to replace the one that just exited. Depending on the exit status and if container host affinity is enabled, the new container may or may not try to be started on the same node. A container completes in either of the following conditions: 1) some ...
[ "Handle", "the", "completion", "of", "a", "container", ".", "A", "new", "container", "will", "be", "requested", "to", "replace", "the", "one", "that", "just", "exited", ".", "Depending", "on", "the", "exit", "status", "and", "if", "container", "host", "aff...
f029b4c0fea0fe4aa62f36dda2512344ff708bae
https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-yarn/src/main/java/org/apache/gobblin/yarn/YarnService.java#L459-L511
25,683
apache/incubator-gobblin
gobblin-runtime/src/main/java/org/apache/gobblin/runtime/api/JobSpec.java
JobSpec.builder
public static Builder builder(URI catalogURI, Properties jobProps) { String name = JobState.getJobNameFromProps(jobProps); String group = JobState.getJobGroupFromProps(jobProps); if (null == group) { group = "default"; } try { URI jobURI = new URI(catalogURI.getScheme(), catalogURI.getAu...
java
public static Builder builder(URI catalogURI, Properties jobProps) { String name = JobState.getJobNameFromProps(jobProps); String group = JobState.getJobGroupFromProps(jobProps); if (null == group) { group = "default"; } try { URI jobURI = new URI(catalogURI.getScheme(), catalogURI.getAu...
[ "public", "static", "Builder", "builder", "(", "URI", "catalogURI", ",", "Properties", "jobProps", ")", "{", "String", "name", "=", "JobState", ".", "getJobNameFromProps", "(", "jobProps", ")", ";", "String", "group", "=", "JobState", ".", "getJobGroupFromProps"...
Creates a builder for the JobSpec based on values in a job properties config.
[ "Creates", "a", "builder", "for", "the", "JobSpec", "based", "on", "values", "in", "a", "job", "properties", "config", "." ]
f029b4c0fea0fe4aa62f36dda2512344ff708bae
https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-runtime/src/main/java/org/apache/gobblin/runtime/api/JobSpec.java#L90-L109
25,684
apache/incubator-gobblin
gobblin-metrics-libs/gobblin-metrics-base/src/main/java/org/apache/gobblin/metrics/MetricContext.java
MetricContext.sendNotification
public void sendNotification(final Notification notification) { ContextAwareTimer.Context timer = this.notificationTimer.time(); if(!this.notificationTargets.isEmpty()) { for (final Map.Entry<UUID, Function<Notification, Void>> entry : this.notificationTargets.entrySet()) { try { ...
java
public void sendNotification(final Notification notification) { ContextAwareTimer.Context timer = this.notificationTimer.time(); if(!this.notificationTargets.isEmpty()) { for (final Map.Entry<UUID, Function<Notification, Void>> entry : this.notificationTargets.entrySet()) { try { ...
[ "public", "void", "sendNotification", "(", "final", "Notification", "notification", ")", "{", "ContextAwareTimer", ".", "Context", "timer", "=", "this", ".", "notificationTimer", ".", "time", "(", ")", ";", "if", "(", "!", "this", ".", "notificationTargets", "...
Send a notification to all targets of this context and to the parent of this context. @param notification {@link org.apache.gobblin.metrics.notification.Notification} to send.
[ "Send", "a", "notification", "to", "all", "targets", "of", "this", "context", "and", "to", "the", "parent", "of", "this", "context", "." ]
f029b4c0fea0fe4aa62f36dda2512344ff708bae
https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-metrics-libs/gobblin-metrics-base/src/main/java/org/apache/gobblin/metrics/MetricContext.java#L605-L622
25,685
apache/incubator-gobblin
gobblin-compaction/src/main/java/org/apache/gobblin/compaction/mapreduce/orc/OrcKeyCompactorOutputFormat.java
OrcKeyCompactorOutputFormat.getRecordWriter
@Override public RecordWriter getRecordWriter(TaskAttemptContext taskAttemptContext) throws IOException { Configuration conf = taskAttemptContext.getConfiguration(); String extension = "." + conf.get(COMPACTION_OUTPUT_EXTENSION, "orc" ); Path filename = getDefaultWorkFile(taskAttemptContext, extension); ...
java
@Override public RecordWriter getRecordWriter(TaskAttemptContext taskAttemptContext) throws IOException { Configuration conf = taskAttemptContext.getConfiguration(); String extension = "." + conf.get(COMPACTION_OUTPUT_EXTENSION, "orc" ); Path filename = getDefaultWorkFile(taskAttemptContext, extension); ...
[ "@", "Override", "public", "RecordWriter", "getRecordWriter", "(", "TaskAttemptContext", "taskAttemptContext", ")", "throws", "IOException", "{", "Configuration", "conf", "=", "taskAttemptContext", ".", "getConfiguration", "(", ")", ";", "String", "extension", "=", "\...
Required for extension since super method hard-coded file extension as ".orc". To keep flexibility of extension name, we made it configuration driven. @param taskAttemptContext The source of configuration that determines the file extension @return The {@link RecordWriter} that write out Orc object. @throws IOException
[ "Required", "for", "extension", "since", "super", "method", "hard", "-", "coded", "file", "extension", "as", ".", "orc", ".", "To", "keep", "flexibility", "of", "extension", "name", "we", "made", "it", "configuration", "driven", "." ]
f029b4c0fea0fe4aa62f36dda2512344ff708bae
https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-compaction/src/main/java/org/apache/gobblin/compaction/mapreduce/orc/OrcKeyCompactorOutputFormat.java#L60-L69
25,686
apache/incubator-gobblin
gobblin-runtime/src/main/java/org/apache/gobblin/runtime/locks/FileBasedJobLockFactory.java
FileBasedJobLockFactory.create
public static FileBasedJobLockFactory create(Config factoryConfig, Configuration hadoopConf, Optional<Logger> log) throws IOException { FileSystem fs = factoryConfig.hasPath(FS_URI_CONFIG) ? FileSystem.get(URI.creat...
java
public static FileBasedJobLockFactory create(Config factoryConfig, Configuration hadoopConf, Optional<Logger> log) throws IOException { FileSystem fs = factoryConfig.hasPath(FS_URI_CONFIG) ? FileSystem.get(URI.creat...
[ "public", "static", "FileBasedJobLockFactory", "create", "(", "Config", "factoryConfig", ",", "Configuration", "hadoopConf", ",", "Optional", "<", "Logger", ">", "log", ")", "throws", "IOException", "{", "FileSystem", "fs", "=", "factoryConfig", ".", "hasPath", "(...
Create a new instance using the specified factory and hadoop configurations.
[ "Create", "a", "new", "instance", "using", "the", "specified", "factory", "and", "hadoop", "configurations", "." ]
f029b4c0fea0fe4aa62f36dda2512344ff708bae
https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-runtime/src/main/java/org/apache/gobblin/runtime/locks/FileBasedJobLockFactory.java#L85-L96
25,687
apache/incubator-gobblin
gobblin-runtime/src/main/java/org/apache/gobblin/runtime/locks/FileBasedJobLockFactory.java
FileBasedJobLockFactory.isLocked
boolean isLocked(Path lockFile) throws JobLockException { try { return this.fs.exists(lockFile); } catch (IOException e) { throw new JobLockException(e); } }
java
boolean isLocked(Path lockFile) throws JobLockException { try { return this.fs.exists(lockFile); } catch (IOException e) { throw new JobLockException(e); } }
[ "boolean", "isLocked", "(", "Path", "lockFile", ")", "throws", "JobLockException", "{", "try", "{", "return", "this", ".", "fs", ".", "exists", "(", "lockFile", ")", ";", "}", "catch", "(", "IOException", "e", ")", "{", "throw", "new", "JobLockException", ...
Check if the lock is locked. @return if the lock is locked @throws JobLockException thrown if checking the status of the {@link JobLock} fails
[ "Check", "if", "the", "lock", "is", "locked", "." ]
f029b4c0fea0fe4aa62f36dda2512344ff708bae
https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-runtime/src/main/java/org/apache/gobblin/runtime/locks/FileBasedJobLockFactory.java#L189-L195
25,688
apache/incubator-gobblin
gobblin-api/src/main/java/org/apache/gobblin/util/RecordCountProvider.java
RecordCountProvider.getRecordCount
public long getRecordCount(Collection<Path> paths) { long count = 0; for (Path path : paths) { count += getRecordCount(path); } return count; }
java
public long getRecordCount(Collection<Path> paths) { long count = 0; for (Path path : paths) { count += getRecordCount(path); } return count; }
[ "public", "long", "getRecordCount", "(", "Collection", "<", "Path", ">", "paths", ")", "{", "long", "count", "=", "0", ";", "for", "(", "Path", "path", ":", "paths", ")", "{", "count", "+=", "getRecordCount", "(", "path", ")", ";", "}", "return", "co...
Get record count for a list of paths.
[ "Get", "record", "count", "for", "a", "list", "of", "paths", "." ]
f029b4c0fea0fe4aa62f36dda2512344ff708bae
https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-api/src/main/java/org/apache/gobblin/util/RecordCountProvider.java#L55-L61
25,689
apache/incubator-gobblin
gobblin-aws/src/main/java/org/apache/gobblin/aws/GobblinAWSClusterLauncher.java
GobblinAWSClusterLauncher.launch
public void launch() throws IOException, InterruptedException { this.eventBus.register(this); // Create Helix cluster and connect to it HelixUtils.createGobblinHelixCluster(this.zkConnectionString, this.helixClusterName, false); LOGGER.info("Created Helix cluster " + this.helixClusterName); connec...
java
public void launch() throws IOException, InterruptedException { this.eventBus.register(this); // Create Helix cluster and connect to it HelixUtils.createGobblinHelixCluster(this.zkConnectionString, this.helixClusterName, false); LOGGER.info("Created Helix cluster " + this.helixClusterName); connec...
[ "public", "void", "launch", "(", ")", "throws", "IOException", ",", "InterruptedException", "{", "this", ".", "eventBus", ".", "register", "(", "this", ")", ";", "// Create Helix cluster and connect to it", "HelixUtils", ".", "createGobblinHelixCluster", "(", "this", ...
Launch a new Gobblin cluster on AWS. @throws IOException If there's something wrong launching the cluster
[ "Launch", "a", "new", "Gobblin", "cluster", "on", "AWS", "." ]
f029b4c0fea0fe4aa62f36dda2512344ff708bae
https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-aws/src/main/java/org/apache/gobblin/aws/GobblinAWSClusterLauncher.java#L256-L270
25,690
apache/incubator-gobblin
gobblin-modules/gobblin-http/src/main/java/org/apache/gobblin/converter/AvroHttpJoinConverter.java
AvroHttpJoinConverter.generateHttpOperation
@Override protected HttpOperation generateHttpOperation (GenericRecord inputRecord, State state) { Map<String, String> keyAndValue = new HashMap<>(); Optional<Iterable<String>> keys = getKeys(state); HttpOperation operation; if (keys.isPresent()) { for (String key : keys.get()) { String...
java
@Override protected HttpOperation generateHttpOperation (GenericRecord inputRecord, State state) { Map<String, String> keyAndValue = new HashMap<>(); Optional<Iterable<String>> keys = getKeys(state); HttpOperation operation; if (keys.isPresent()) { for (String key : keys.get()) { String...
[ "@", "Override", "protected", "HttpOperation", "generateHttpOperation", "(", "GenericRecord", "inputRecord", ",", "State", "state", ")", "{", "Map", "<", "String", ",", "String", ">", "keyAndValue", "=", "new", "HashMap", "<>", "(", ")", ";", "Optional", "<", ...
Extract user defined keys by looking at "gobblin.converter.http.keys" If keys are defined, extract key-value pair from inputRecord and set it to HttpOperation If keys are not defined, generate HttpOperation by HttpUtils.toHttpOperation
[ "Extract", "user", "defined", "keys", "by", "looking", "at", "gobblin", ".", "converter", ".", "http", ".", "keys", "If", "keys", "are", "defined", "extract", "key", "-", "value", "pair", "from", "inputRecord", "and", "set", "it", "to", "HttpOperation", "I...
f029b4c0fea0fe4aa62f36dda2512344ff708bae
https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-modules/gobblin-http/src/main/java/org/apache/gobblin/converter/AvroHttpJoinConverter.java#L77-L95
25,691
apache/incubator-gobblin
gobblin-cluster/src/main/java/org/apache/gobblin/cluster/GobblinClusterUtils.java
GobblinClusterUtils.getJobStateFilePath
public static Path getJobStateFilePath(boolean usingStateStore, Path appWorkPath, String jobId) { final Path jobStateFilePath; // the state store uses a path of the form workdir/_jobstate/job_id/job_id.job.state while old method stores the file // in the app work dir. if (usingStateStore) { jobSt...
java
public static Path getJobStateFilePath(boolean usingStateStore, Path appWorkPath, String jobId) { final Path jobStateFilePath; // the state store uses a path of the form workdir/_jobstate/job_id/job_id.job.state while old method stores the file // in the app work dir. if (usingStateStore) { jobSt...
[ "public", "static", "Path", "getJobStateFilePath", "(", "boolean", "usingStateStore", ",", "Path", "appWorkPath", ",", "String", "jobId", ")", "{", "final", "Path", "jobStateFilePath", ";", "// the state store uses a path of the form workdir/_jobstate/job_id/job_id.job.state wh...
Generate the path to the job.state file @param usingStateStore is a state store being used to store the job.state content @param appWorkPath work directory @param jobId job id @return a {@link Path} referring to the job.state
[ "Generate", "the", "path", "to", "the", "job", ".", "state", "file" ]
f029b4c0fea0fe4aa62f36dda2512344ff708bae
https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-cluster/src/main/java/org/apache/gobblin/cluster/GobblinClusterUtils.java#L90-L107
25,692
apache/incubator-gobblin
gobblin-core/src/main/java/org/apache/gobblin/publisher/BaseDataPublisher.java
BaseDataPublisher.loadExistingMetadata
private String loadExistingMetadata(Path metadataFilename, int branchId) { try { FileSystem fsForBranch = writerFileSystemByBranches.get(branchId); if (!fsForBranch.exists(metadataFilename)) { return null; } FSDataInputStream existingMetadata = writerFileSystemByBranches.get(branchId...
java
private String loadExistingMetadata(Path metadataFilename, int branchId) { try { FileSystem fsForBranch = writerFileSystemByBranches.get(branchId); if (!fsForBranch.exists(metadataFilename)) { return null; } FSDataInputStream existingMetadata = writerFileSystemByBranches.get(branchId...
[ "private", "String", "loadExistingMetadata", "(", "Path", "metadataFilename", ",", "int", "branchId", ")", "{", "try", "{", "FileSystem", "fsForBranch", "=", "writerFileSystemByBranches", ".", "get", "(", "branchId", ")", ";", "if", "(", "!", "fsForBranch", ".",...
Read in existing metadata as a UTF8 string.
[ "Read", "in", "existing", "metadata", "as", "a", "UTF8", "string", "." ]
f029b4c0fea0fe4aa62f36dda2512344ff708bae
https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-core/src/main/java/org/apache/gobblin/publisher/BaseDataPublisher.java#L265-L278
25,693
apache/incubator-gobblin
gobblin-core/src/main/java/org/apache/gobblin/publisher/BaseDataPublisher.java
BaseDataPublisher.createDestinationDescriptor
protected DatasetDescriptor createDestinationDescriptor(WorkUnitState state, int branchId) { Path publisherOutputDir = getPublisherOutputDir(state, branchId); FileSystem fs = this.publisherFileSystemByBranches.get(branchId); DatasetDescriptor destination = new DatasetDescriptor(fs.getScheme(), publisherOutp...
java
protected DatasetDescriptor createDestinationDescriptor(WorkUnitState state, int branchId) { Path publisherOutputDir = getPublisherOutputDir(state, branchId); FileSystem fs = this.publisherFileSystemByBranches.get(branchId); DatasetDescriptor destination = new DatasetDescriptor(fs.getScheme(), publisherOutp...
[ "protected", "DatasetDescriptor", "createDestinationDescriptor", "(", "WorkUnitState", "state", ",", "int", "branchId", ")", "{", "Path", "publisherOutputDir", "=", "getPublisherOutputDir", "(", "state", ",", "branchId", ")", ";", "FileSystem", "fs", "=", "this", "....
Create destination dataset descriptor
[ "Create", "destination", "dataset", "descriptor" ]
f029b4c0fea0fe4aa62f36dda2512344ff708bae
https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-core/src/main/java/org/apache/gobblin/publisher/BaseDataPublisher.java#L324-L331
25,694
apache/incubator-gobblin
gobblin-core/src/main/java/org/apache/gobblin/publisher/BaseDataPublisher.java
BaseDataPublisher.publishMetadata
@Override public void publishMetadata(Collection<? extends WorkUnitState> states) throws IOException { Set<String> partitions = new HashSet<>(); // There should be one merged metadata file per branch; first merge all of the pieces together mergeMetadataAndCollectPartitionNames(states, partitions); ...
java
@Override public void publishMetadata(Collection<? extends WorkUnitState> states) throws IOException { Set<String> partitions = new HashSet<>(); // There should be one merged metadata file per branch; first merge all of the pieces together mergeMetadataAndCollectPartitionNames(states, partitions); ...
[ "@", "Override", "public", "void", "publishMetadata", "(", "Collection", "<", "?", "extends", "WorkUnitState", ">", "states", ")", "throws", "IOException", "{", "Set", "<", "String", ">", "partitions", "=", "new", "HashSet", "<>", "(", ")", ";", "// There sh...
Merge all of the metadata output from each work-unit and publish the merged record. @param states States from all tasks @throws IOException If there is an error publishing the file
[ "Merge", "all", "of", "the", "metadata", "output", "from", "each", "work", "-", "unit", "and", "publish", "the", "merged", "record", "." ]
f029b4c0fea0fe4aa62f36dda2512344ff708bae
https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-core/src/main/java/org/apache/gobblin/publisher/BaseDataPublisher.java#L539-L576
25,695
apache/incubator-gobblin
gobblin-core/src/main/java/org/apache/gobblin/publisher/BaseDataPublisher.java
BaseDataPublisher.publishMetadata
private void publishMetadata(String metadataValue, int branchId, Path metadataOutputPath) throws IOException { try { if (metadataOutputPath == null) { LOG.info("Metadata output path not set for branch " + String.valueOf(branchId) + ", not publishing."); return; } if (metadat...
java
private void publishMetadata(String metadataValue, int branchId, Path metadataOutputPath) throws IOException { try { if (metadataOutputPath == null) { LOG.info("Metadata output path not set for branch " + String.valueOf(branchId) + ", not publishing."); return; } if (metadat...
[ "private", "void", "publishMetadata", "(", "String", "metadataValue", ",", "int", "branchId", ",", "Path", "metadataOutputPath", ")", "throws", "IOException", "{", "try", "{", "if", "(", "metadataOutputPath", "==", "null", ")", "{", "LOG", ".", "info", "(", ...
Publish metadata to a set of paths
[ "Publish", "metadata", "to", "a", "set", "of", "paths" ]
f029b4c0fea0fe4aa62f36dda2512344ff708bae
https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-core/src/main/java/org/apache/gobblin/publisher/BaseDataPublisher.java#L661-L691
25,696
apache/incubator-gobblin
gobblin-config-management/gobblin-config-client/src/main/java/org/apache/gobblin/config/client/ConfigClient.java
ConfigClient.getImports
public Collection<URI> getImports(URI configKeyUri, boolean recursive) throws ConfigStoreFactoryDoesNotExistsException, ConfigStoreCreationException, VersionDoesNotExistException { return getImports(configKeyUri, recursive, Optional.<Config>absent()); }
java
public Collection<URI> getImports(URI configKeyUri, boolean recursive) throws ConfigStoreFactoryDoesNotExistsException, ConfigStoreCreationException, VersionDoesNotExistException { return getImports(configKeyUri, recursive, Optional.<Config>absent()); }
[ "public", "Collection", "<", "URI", ">", "getImports", "(", "URI", "configKeyUri", ",", "boolean", "recursive", ")", "throws", "ConfigStoreFactoryDoesNotExistsException", ",", "ConfigStoreCreationException", ",", "VersionDoesNotExistException", "{", "return", "getImports", ...
Get the import links of the input URI. @param configKeyUri - The URI for the configuration key. @param recursive - Specify whether to get direct import links or recursively import links @return the import links of the input URI. @throws ConfigStoreFactoryDoesNotExistsException: if missing scheme name or the schem...
[ "Get", "the", "import", "links", "of", "the", "input", "URI", "." ]
f029b4c0fea0fe4aa62f36dda2512344ff708bae
https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-config-management/gobblin-config-client/src/main/java/org/apache/gobblin/config/client/ConfigClient.java#L222-L225
25,697
apache/incubator-gobblin
gobblin-config-management/gobblin-config-client/src/main/java/org/apache/gobblin/config/client/ConfigClient.java
ConfigClient.getConfigStoreFactory
@SuppressWarnings("unchecked") private ConfigStoreFactory<ConfigStore> getConfigStoreFactory(URI configKeyUri) throws ConfigStoreFactoryDoesNotExistsException { @SuppressWarnings("rawtypes") ConfigStoreFactory csf = this.configStoreFactoryRegister.getConfigStoreFactory(configKeyUri.getScheme()); if ...
java
@SuppressWarnings("unchecked") private ConfigStoreFactory<ConfigStore> getConfigStoreFactory(URI configKeyUri) throws ConfigStoreFactoryDoesNotExistsException { @SuppressWarnings("rawtypes") ConfigStoreFactory csf = this.configStoreFactoryRegister.getConfigStoreFactory(configKeyUri.getScheme()); if ...
[ "@", "SuppressWarnings", "(", "\"unchecked\"", ")", "private", "ConfigStoreFactory", "<", "ConfigStore", ">", "getConfigStoreFactory", "(", "URI", "configKeyUri", ")", "throws", "ConfigStoreFactoryDoesNotExistsException", "{", "@", "SuppressWarnings", "(", "\"rawtypes\"", ...
use serviceLoader to load configStoreFactories
[ "use", "serviceLoader", "to", "load", "configStoreFactories" ]
f029b4c0fea0fe4aa62f36dda2512344ff708bae
https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-config-management/gobblin-config-client/src/main/java/org/apache/gobblin/config/client/ConfigClient.java#L379-L389
25,698
apache/incubator-gobblin
gobblin-runtime/src/main/java/org/apache/gobblin/runtime/util/MultiWorkUnitUnpackingIterator.java
MultiWorkUnitUnpackingIterator.seekNext
private void seekNext() { if (!needSeek) { return; } // First, iterate all if (this.currentIterator != null && this.currentIterator.hasNext()) { needSeek = false; return; } // Then, find the next available work unit nextWu = null; this.currentIterator = null; whil...
java
private void seekNext() { if (!needSeek) { return; } // First, iterate all if (this.currentIterator != null && this.currentIterator.hasNext()) { needSeek = false; return; } // Then, find the next available work unit nextWu = null; this.currentIterator = null; whil...
[ "private", "void", "seekNext", "(", ")", "{", "if", "(", "!", "needSeek", ")", "{", "return", ";", "}", "// First, iterate all", "if", "(", "this", ".", "currentIterator", "!=", "null", "&&", "this", ".", "currentIterator", ".", "hasNext", "(", ")", ")",...
Seek to the next available work unit, skipping all empty work units
[ "Seek", "to", "the", "next", "available", "work", "unit", "skipping", "all", "empty", "work", "units" ]
f029b4c0fea0fe4aa62f36dda2512344ff708bae
https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-runtime/src/main/java/org/apache/gobblin/runtime/util/MultiWorkUnitUnpackingIterator.java#L62-L87
25,699
apache/incubator-gobblin
gobblin-data-management/src/main/java/org/apache/gobblin/data/management/retention/dataset/MultiVersionCleanableDatasetBase.java
MultiVersionCleanableDatasetBase.clean
@Override public void clean() throws IOException { if (this.isDatasetBlacklisted) { this.log.info("Dataset blacklisted. Cleanup skipped for " + datasetRoot()); return; } boolean atLeastOneFailureSeen = false; for (VersionFinderAndPolicy<T> versionFinderAndPolicy : getVersionFindersAndPo...
java
@Override public void clean() throws IOException { if (this.isDatasetBlacklisted) { this.log.info("Dataset blacklisted. Cleanup skipped for " + datasetRoot()); return; } boolean atLeastOneFailureSeen = false; for (VersionFinderAndPolicy<T> versionFinderAndPolicy : getVersionFindersAndPo...
[ "@", "Override", "public", "void", "clean", "(", ")", "throws", "IOException", "{", "if", "(", "this", ".", "isDatasetBlacklisted", ")", "{", "this", ".", "log", ".", "info", "(", "\"Dataset blacklisted. Cleanup skipped for \"", "+", "datasetRoot", "(", ")", "...
Method to perform the Retention operations for this dataset. <ul> <li>{@link MultiVersionCleanableDatasetBase#getVersionFindersAndPolicies()} gets a list {@link VersionFinderAndPolicy}s <li>Each {@link VersionFinderAndPolicy} contains a {@link VersionFinder} and a {@link VersionSelectionPolicy}. It can optionally have...
[ "Method", "to", "perform", "the", "Retention", "operations", "for", "this", "dataset", "." ]
f029b4c0fea0fe4aa62f36dda2512344ff708bae
https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-data-management/src/main/java/org/apache/gobblin/data/management/retention/dataset/MultiVersionCleanableDatasetBase.java#L257-L311