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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
112,900 | kiegroup/droolsjbpm-integration | kie-server-parent/kie-server-common/src/main/java/org/kie/server/common/rest/KieServerHttpRequest.java | KieServerHttpRequest.openOutput | private KieServerHttpRequest openOutput() throws IOException {
if( output != null ) {
return this;
}
getConnection().setDoOutput(true);
final String charset = getHeaderParam(getConnection().getRequestProperty(CONTENT_TYPE), PARAM_CHARSET);
output = new RequestOutputSt... | java | private KieServerHttpRequest openOutput() throws IOException {
if( output != null ) {
return this;
}
getConnection().setDoOutput(true);
final String charset = getHeaderParam(getConnection().getRequestProperty(CONTENT_TYPE), PARAM_CHARSET);
output = new RequestOutputSt... | [
"private",
"KieServerHttpRequest",
"openOutput",
"(",
")",
"throws",
"IOException",
"{",
"if",
"(",
"output",
"!=",
"null",
")",
"{",
"return",
"this",
";",
"}",
"getConnection",
"(",
")",
".",
"setDoOutput",
"(",
"true",
")",
";",
"final",
"String",
"char... | Open output stream
@return this request
@throws IOException | [
"Open",
"output",
"stream"
] | 6c26200ab03855dbb92b56ca0c6363cdec0eaf2c | https://github.com/kiegroup/droolsjbpm-integration/blob/6c26200ab03855dbb92b56ca0c6363cdec0eaf2c/kie-server-parent/kie-server-common/src/main/java/org/kie/server/common/rest/KieServerHttpRequest.java#L1104-L1112 |
112,901 | kiegroup/droolsjbpm-integration | kie-server-parent/kie-server-common/src/main/java/org/kie/server/common/rest/KieServerHttpRequest.java | KieServerHttpRequest.closeOutput | private KieServerHttpRequest closeOutput() throws IOException {
if( connection == null ) {
throw new KieServerHttpRequestException("Please execute a HTTP method first on the request.");
}
if( output == null ) {
return this;
}
if( ignoreCloseExceptions ) {
... | java | private KieServerHttpRequest closeOutput() throws IOException {
if( connection == null ) {
throw new KieServerHttpRequestException("Please execute a HTTP method first on the request.");
}
if( output == null ) {
return this;
}
if( ignoreCloseExceptions ) {
... | [
"private",
"KieServerHttpRequest",
"closeOutput",
"(",
")",
"throws",
"IOException",
"{",
"if",
"(",
"connection",
"==",
"null",
")",
"{",
"throw",
"new",
"KieServerHttpRequestException",
"(",
"\"Please execute a HTTP method first on the request.\"",
")",
";",
"}",
"if"... | Close output stream
@return this request
@throws KieServerHttpRequestException
@throws IOException | [
"Close",
"output",
"stream"
] | 6c26200ab03855dbb92b56ca0c6363cdec0eaf2c | https://github.com/kiegroup/droolsjbpm-integration/blob/6c26200ab03855dbb92b56ca0c6363cdec0eaf2c/kie-server-parent/kie-server-common/src/main/java/org/kie/server/common/rest/KieServerHttpRequest.java#L1121-L1139 |
112,902 | kiegroup/droolsjbpm-integration | kie-server-parent/kie-server-common/src/main/java/org/kie/server/common/rest/KieServerHttpRequest.java | KieServerHttpRequest.responseHeaders | private String[] responseHeaders( final String name ) {
final Map<String, List<String>> headers = responseHeaders();
if( headers == null || headers.isEmpty() )
return EMPTY_STRINGS;
final List<String> values = headers.get(name);
if( values != null && !values.isEmpty() )
... | java | private String[] responseHeaders( final String name ) {
final Map<String, List<String>> headers = responseHeaders();
if( headers == null || headers.isEmpty() )
return EMPTY_STRINGS;
final List<String> values = headers.get(name);
if( values != null && !values.isEmpty() )
... | [
"private",
"String",
"[",
"]",
"responseHeaders",
"(",
"final",
"String",
"name",
")",
"{",
"final",
"Map",
"<",
"String",
",",
"List",
"<",
"String",
">",
">",
"headers",
"=",
"responseHeaders",
"(",
")",
";",
"if",
"(",
"headers",
"==",
"null",
"||",... | Get all values of the given header from the response
@param name
@return non-null but possibly empty array of {@link String} header values | [
"Get",
"all",
"values",
"of",
"the",
"given",
"header",
"from",
"the",
"response"
] | 6c26200ab03855dbb92b56ca0c6363cdec0eaf2c | https://github.com/kiegroup/droolsjbpm-integration/blob/6c26200ab03855dbb92b56ca0c6363cdec0eaf2c/kie-server-parent/kie-server-common/src/main/java/org/kie/server/common/rest/KieServerHttpRequest.java#L1433-L1443 |
112,903 | kiegroup/droolsjbpm-integration | kie-server-parent/kie-server-common/src/main/java/org/kie/server/common/rest/KieServerHttpRequest.java | KieServerHttpRequest.responseHeaderParameter | private String responseHeaderParameter( final String headerName, final String paramName ) {
return getHeaderParam(responseHeader(headerName), paramName);
} | java | private String responseHeaderParameter( final String headerName, final String paramName ) {
return getHeaderParam(responseHeader(headerName), paramName);
} | [
"private",
"String",
"responseHeaderParameter",
"(",
"final",
"String",
"headerName",
",",
"final",
"String",
"paramName",
")",
"{",
"return",
"getHeaderParam",
"(",
"responseHeader",
"(",
"headerName",
")",
",",
"paramName",
")",
";",
"}"
] | Get parameter with given name from header value in response
@param headerName
@param paramName
@return parameter value or null if missing | [
"Get",
"parameter",
"with",
"given",
"name",
"from",
"header",
"value",
"in",
"response"
] | 6c26200ab03855dbb92b56ca0c6363cdec0eaf2c | https://github.com/kiegroup/droolsjbpm-integration/blob/6c26200ab03855dbb92b56ca0c6363cdec0eaf2c/kie-server-parent/kie-server-common/src/main/java/org/kie/server/common/rest/KieServerHttpRequest.java#L1452-L1454 |
112,904 | kiegroup/droolsjbpm-integration | kie-server-parent/kie-server-common/src/main/java/org/kie/server/common/rest/KieServerHttpRequest.java | KieServerHttpRequest.getHeaderParams | private static Map<String, String> getHeaderParams( final String header ) {
if( header == null || header.length() == 0 )
return Collections.emptyMap();
final int headerLength = header.length();
int start = header.indexOf(';') + 1;
if( start == 0 || start == headerLength )
... | java | private static Map<String, String> getHeaderParams( final String header ) {
if( header == null || header.length() == 0 )
return Collections.emptyMap();
final int headerLength = header.length();
int start = header.indexOf(';') + 1;
if( start == 0 || start == headerLength )
... | [
"private",
"static",
"Map",
"<",
"String",
",",
"String",
">",
"getHeaderParams",
"(",
"final",
"String",
"header",
")",
"{",
"if",
"(",
"header",
"==",
"null",
"||",
"header",
".",
"length",
"(",
")",
"==",
"0",
")",
"return",
"Collections",
".",
"emp... | Get parameter values from header value
@param header
@return parameter value or null if none | [
"Get",
"parameter",
"values",
"from",
"header",
"value"
] | 6c26200ab03855dbb92b56ca0c6363cdec0eaf2c | https://github.com/kiegroup/droolsjbpm-integration/blob/6c26200ab03855dbb92b56ca0c6363cdec0eaf2c/kie-server-parent/kie-server-common/src/main/java/org/kie/server/common/rest/KieServerHttpRequest.java#L1474-L1510 |
112,905 | kiegroup/droolsjbpm-integration | kie-server-parent/kie-server-common/src/main/java/org/kie/server/common/rest/KieServerHttpRequest.java | KieServerHttpRequest.getHeaderParam | private static String getHeaderParam( final String value, final String paramName ) {
if( value == null || value.length() == 0 )
return null;
final int length = value.length();
int start = value.indexOf(';') + 1;
if( start == 0 || start == length )
return null;
... | java | private static String getHeaderParam( final String value, final String paramName ) {
if( value == null || value.length() == 0 )
return null;
final int length = value.length();
int start = value.indexOf(';') + 1;
if( start == 0 || start == length )
return null;
... | [
"private",
"static",
"String",
"getHeaderParam",
"(",
"final",
"String",
"value",
",",
"final",
"String",
"paramName",
")",
"{",
"if",
"(",
"value",
"==",
"null",
"||",
"value",
".",
"length",
"(",
")",
"==",
"0",
")",
"return",
"null",
";",
"final",
"... | Get parameter value from header value
@param value
@param paramName
@return parameter value or null if none | [
"Get",
"parameter",
"value",
"from",
"header",
"value"
] | 6c26200ab03855dbb92b56ca0c6363cdec0eaf2c | https://github.com/kiegroup/droolsjbpm-integration/blob/6c26200ab03855dbb92b56ca0c6363cdec0eaf2c/kie-server-parent/kie-server-common/src/main/java/org/kie/server/common/rest/KieServerHttpRequest.java#L1519-L1551 |
112,906 | kiegroup/droolsjbpm-integration | kie-server-parent/kie-server-remote/kie-server-jms/src/main/java/org/kie/server/jms/KieServerMDB.java | KieServerMDB.startConnectionAndSession | private JMSConnection startConnectionAndSession() {
JMSConnection result = null;
Connection connection = null;
Session session = null;
try {
connection = factory.createConnection();
if ( connection != null ) {
session = connection.createSession( sessionTransa... | java | private JMSConnection startConnectionAndSession() {
JMSConnection result = null;
Connection connection = null;
Session session = null;
try {
connection = factory.createConnection();
if ( connection != null ) {
session = connection.createSession( sessionTransa... | [
"private",
"JMSConnection",
"startConnectionAndSession",
"(",
")",
"{",
"JMSConnection",
"result",
"=",
"null",
";",
"Connection",
"connection",
"=",
"null",
";",
"Session",
"session",
"=",
"null",
";",
"try",
"{",
"connection",
"=",
"factory",
".",
"createConne... | This method is used to initialize the JMS connection and
session. It is done in its own method so that if the
point at which it is done needs to be changed then
it can be done by just changing the invocation point. | [
"This",
"method",
"is",
"used",
"to",
"initialize",
"the",
"JMS",
"connection",
"and",
"session",
".",
"It",
"is",
"done",
"in",
"its",
"own",
"method",
"so",
"that",
"if",
"the",
"point",
"at",
"which",
"it",
"is",
"done",
"needs",
"to",
"be",
"change... | 6c26200ab03855dbb92b56ca0c6363cdec0eaf2c | https://github.com/kiegroup/droolsjbpm-integration/blob/6c26200ab03855dbb92b56ca0c6363cdec0eaf2c/kie-server-parent/kie-server-remote/kie-server-jms/src/main/java/org/kie/server/jms/KieServerMDB.java#L109-L140 |
112,907 | kiegroup/droolsjbpm-integration | jbpm-process-svg/src/main/java/org/jbpm/process/svg/SVGImageProcessor.java | SVGImageProcessor.transform | public static String transform(InputStream svg, List<String> completed, List<String> active) {
return transform(svg, completed, active, null, COMPLETED_COLOR, COMPLETED_BORDER_COLOR, ACTIVE_BORDER_COLOR);
} | java | public static String transform(InputStream svg, List<String> completed, List<String> active) {
return transform(svg, completed, active, null, COMPLETED_COLOR, COMPLETED_BORDER_COLOR, ACTIVE_BORDER_COLOR);
} | [
"public",
"static",
"String",
"transform",
"(",
"InputStream",
"svg",
",",
"List",
"<",
"String",
">",
"completed",
",",
"List",
"<",
"String",
">",
"active",
")",
"{",
"return",
"transform",
"(",
"svg",
",",
"completed",
",",
"active",
",",
"null",
",",... | Static methods to keep backward compatibility | [
"Static",
"methods",
"to",
"keep",
"backward",
"compatibility"
] | 6c26200ab03855dbb92b56ca0c6363cdec0eaf2c | https://github.com/kiegroup/droolsjbpm-integration/blob/6c26200ab03855dbb92b56ca0c6363cdec0eaf2c/jbpm-process-svg/src/main/java/org/jbpm/process/svg/SVGImageProcessor.java#L64-L66 |
112,908 | kiegroup/droolsjbpm-integration | kie-server-parent/kie-server-remote/kie-server-client/src/main/java/org/kie/server/client/impl/UserTaskServicesClientImpl.java | UserTaskServicesClientImpl.findTaskByWorkItemId | @Override
public TaskInstance findTaskByWorkItemId(Long workItemId) {
if( config.isRest() ) {
Map<String, Object> valuesMap = new HashMap<String, Object>();
valuesMap.put(WORK_ITEM_ID, workItemId);
return makeHttpGetRequestAndCreateCustomResponse(
bui... | java | @Override
public TaskInstance findTaskByWorkItemId(Long workItemId) {
if( config.isRest() ) {
Map<String, Object> valuesMap = new HashMap<String, Object>();
valuesMap.put(WORK_ITEM_ID, workItemId);
return makeHttpGetRequestAndCreateCustomResponse(
bui... | [
"@",
"Override",
"public",
"TaskInstance",
"findTaskByWorkItemId",
"(",
"Long",
"workItemId",
")",
"{",
"if",
"(",
"config",
".",
"isRest",
"(",
")",
")",
"{",
"Map",
"<",
"String",
",",
"Object",
">",
"valuesMap",
"=",
"new",
"HashMap",
"<",
"String",
"... | task basic queries | [
"task",
"basic",
"queries"
] | 6c26200ab03855dbb92b56ca0c6363cdec0eaf2c | https://github.com/kiegroup/droolsjbpm-integration/blob/6c26200ab03855dbb92b56ca0c6363cdec0eaf2c/kie-server-parent/kie-server-remote/kie-server-client/src/main/java/org/kie/server/client/impl/UserTaskServicesClientImpl.java#L808-L828 |
112,909 | kiegroup/droolsjbpm-integration | kie-server-parent/kie-server-remote/kie-server-client/src/main/java/org/kie/server/client/impl/AbstractKieServicesClientImpl.java | AbstractKieServicesClientImpl.initializeURI | protected String initializeURI(URL url, String servicePrefix) {
if ( url == null ) {
throw new IllegalArgumentException( "The url may not be empty or null." );
}
try {
url.toURI();
} catch ( URISyntaxException urise ) {
throw new IllegalArgumentExcepti... | java | protected String initializeURI(URL url, String servicePrefix) {
if ( url == null ) {
throw new IllegalArgumentException( "The url may not be empty or null." );
}
try {
url.toURI();
} catch ( URISyntaxException urise ) {
throw new IllegalArgumentExcepti... | [
"protected",
"String",
"initializeURI",
"(",
"URL",
"url",
",",
"String",
"servicePrefix",
")",
"{",
"if",
"(",
"url",
"==",
"null",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"The url may not be empty or null.\"",
")",
";",
"}",
"try",
"{",
... | Initializes the URL that will be used for web service access
@param url URL of the server instance
@return An URL that can be used for the web services | [
"Initializes",
"the",
"URL",
"that",
"will",
"be",
"used",
"for",
"web",
"service",
"access"
] | 6c26200ab03855dbb92b56ca0c6363cdec0eaf2c | https://github.com/kiegroup/droolsjbpm-integration/blob/6c26200ab03855dbb92b56ca0c6363cdec0eaf2c/kie-server-parent/kie-server-remote/kie-server-client/src/main/java/org/kie/server/client/impl/AbstractKieServicesClientImpl.java#L101-L127 |
112,910 | kiegroup/droolsjbpm-integration | kie-camel/src/main/java/org/kie/camel/embedded/component/KiePolicy.java | KiePolicy.augmentJaxbDataFormatDefinition | public static JaxbDataFormat augmentJaxbDataFormatDefinition(JaxbDataFormat jaxbDataFormat) {
Set<String> set = new HashSet<String>();
for (String clsName : DroolsJaxbHelperProviderImpl.JAXB_ANNOTATED_CMD) {
set.add(clsName.substring(0, clsName.lastIndexOf('.')));
}
StringB... | java | public static JaxbDataFormat augmentJaxbDataFormatDefinition(JaxbDataFormat jaxbDataFormat) {
Set<String> set = new HashSet<String>();
for (String clsName : DroolsJaxbHelperProviderImpl.JAXB_ANNOTATED_CMD) {
set.add(clsName.substring(0, clsName.lastIndexOf('.')));
}
StringB... | [
"public",
"static",
"JaxbDataFormat",
"augmentJaxbDataFormatDefinition",
"(",
"JaxbDataFormat",
"jaxbDataFormat",
")",
"{",
"Set",
"<",
"String",
">",
"set",
"=",
"new",
"HashSet",
"<",
"String",
">",
"(",
")",
";",
"for",
"(",
"String",
"clsName",
":",
"Drool... | Clones the passed JaxbDataFormat and then augments it with with Drools related namespaces
@param jaxbDataFormat
@return | [
"Clones",
"the",
"passed",
"JaxbDataFormat",
"and",
"then",
"augments",
"it",
"with",
"with",
"Drools",
"related",
"namespaces"
] | 6c26200ab03855dbb92b56ca0c6363cdec0eaf2c | https://github.com/kiegroup/droolsjbpm-integration/blob/6c26200ab03855dbb92b56ca0c6363cdec0eaf2c/kie-camel/src/main/java/org/kie/camel/embedded/component/KiePolicy.java#L207-L227 |
112,911 | kiegroup/droolsjbpm-integration | kie-camel/src/main/java/org/kie/camel/embedded/component/FastCloner.java | FastCloner.registerFastCloners | protected void registerFastCloners() {
this.fastCloners.put(GregorianCalendar.class, new FastClonerCalendar());
this.fastCloners.put(ArrayList.class, new FastClonerArrayList());
this.fastCloners.put(Arrays.asList(new Object[] {""}).getClass(), new FastClonerArrayList());
this.fastCloners... | java | protected void registerFastCloners() {
this.fastCloners.put(GregorianCalendar.class, new FastClonerCalendar());
this.fastCloners.put(ArrayList.class, new FastClonerArrayList());
this.fastCloners.put(Arrays.asList(new Object[] {""}).getClass(), new FastClonerArrayList());
this.fastCloners... | [
"protected",
"void",
"registerFastCloners",
"(",
")",
"{",
"this",
".",
"fastCloners",
".",
"put",
"(",
"GregorianCalendar",
".",
"class",
",",
"new",
"FastClonerCalendar",
"(",
")",
")",
";",
"this",
".",
"fastCloners",
".",
"put",
"(",
"ArrayList",
".",
... | registers a std set of fast cloners. | [
"registers",
"a",
"std",
"set",
"of",
"fast",
"cloners",
"."
] | 6c26200ab03855dbb92b56ca0c6363cdec0eaf2c | https://github.com/kiegroup/droolsjbpm-integration/blob/6c26200ab03855dbb92b56ca0c6363cdec0eaf2c/kie-camel/src/main/java/org/kie/camel/embedded/component/FastCloner.java#L85-L93 |
112,912 | kiegroup/droolsjbpm-integration | kie-camel/src/main/java/org/kie/camel/embedded/component/FastCloner.java | FastCloner.registerKnownJdkImmutableClasses | protected void registerKnownJdkImmutableClasses() {
registerImmutable(String.class);
registerImmutable(Integer.class);
registerImmutable(Long.class);
registerImmutable(Boolean.class);
registerImmutable(Class.class);
registerImmutable(Float.class);
registerImmutabl... | java | protected void registerKnownJdkImmutableClasses() {
registerImmutable(String.class);
registerImmutable(Integer.class);
registerImmutable(Long.class);
registerImmutable(Boolean.class);
registerImmutable(Class.class);
registerImmutable(Float.class);
registerImmutabl... | [
"protected",
"void",
"registerKnownJdkImmutableClasses",
"(",
")",
"{",
"registerImmutable",
"(",
"String",
".",
"class",
")",
";",
"registerImmutable",
"(",
"Integer",
".",
"class",
")",
";",
"registerImmutable",
"(",
"Long",
".",
"class",
")",
";",
"registerIm... | registers some known JDK immutable classes. Override this to register your own list of jdk's immutable classes | [
"registers",
"some",
"known",
"JDK",
"immutable",
"classes",
".",
"Override",
"this",
"to",
"register",
"your",
"own",
"list",
"of",
"jdk",
"s",
"immutable",
"classes"
] | 6c26200ab03855dbb92b56ca0c6363cdec0eaf2c | https://github.com/kiegroup/droolsjbpm-integration/blob/6c26200ab03855dbb92b56ca0c6363cdec0eaf2c/kie-camel/src/main/java/org/kie/camel/embedded/component/FastCloner.java#L126-L145 |
112,913 | kiegroup/droolsjbpm-integration | kie-camel/src/main/java/org/kie/camel/embedded/component/FastCloner.java | FastCloner.registerStaticFields | public void registerStaticFields(final Class<?>... classes) {
for (final Class<?> c : classes) {
final List<Field> fields = allFields(c);
for (final Field field : fields) {
final int mods = field.getModifiers();
if (Modifier.isStatic(mods) && !field.getTyp... | java | public void registerStaticFields(final Class<?>... classes) {
for (final Class<?> c : classes) {
final List<Field> fields = allFields(c);
for (final Field field : fields) {
final int mods = field.getModifiers();
if (Modifier.isStatic(mods) && !field.getTyp... | [
"public",
"void",
"registerStaticFields",
"(",
"final",
"Class",
"<",
"?",
">",
"...",
"classes",
")",
"{",
"for",
"(",
"final",
"Class",
"<",
"?",
">",
"c",
":",
"classes",
")",
"{",
"final",
"List",
"<",
"Field",
">",
"fields",
"=",
"allFields",
"(... | registers all static fields of these classes. Those static fields won't be cloned when an instance of the class is cloned.
This is useful i.e. when a static field object is added into maps or sets. At that point, there is no way for the cloner to know that it was
static except if it is registered.
@param classes
array... | [
"registers",
"all",
"static",
"fields",
"of",
"these",
"classes",
".",
"Those",
"static",
"fields",
"won",
"t",
"be",
"cloned",
"when",
"an",
"instance",
"of",
"the",
"class",
"is",
"cloned",
".",
"This",
"is",
"useful",
"i",
".",
"e",
".",
"when",
"a"... | 6c26200ab03855dbb92b56ca0c6363cdec0eaf2c | https://github.com/kiegroup/droolsjbpm-integration/blob/6c26200ab03855dbb92b56ca0c6363cdec0eaf2c/kie-camel/src/main/java/org/kie/camel/embedded/component/FastCloner.java#L158-L169 |
112,914 | kiegroup/droolsjbpm-integration | kie-camel/src/main/java/org/kie/camel/embedded/component/FastCloner.java | FastCloner.deepClone | public <T> T deepClone(final T o) {
if (o == null) {
return null;
}
if (!this.cloningEnabled) {
return o;
}
if (this.dumpClonedClasses) {
System.out.println("start>" + o.getClass());
}
final Map<Object, Object> clones = new Iden... | java | public <T> T deepClone(final T o) {
if (o == null) {
return null;
}
if (!this.cloningEnabled) {
return o;
}
if (this.dumpClonedClasses) {
System.out.println("start>" + o.getClass());
}
final Map<Object, Object> clones = new Iden... | [
"public",
"<",
"T",
">",
"T",
"deepClone",
"(",
"final",
"T",
"o",
")",
"{",
"if",
"(",
"o",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
"if",
"(",
"!",
"this",
".",
"cloningEnabled",
")",
"{",
"return",
"o",
";",
"}",
"if",
"(",
"thi... | deep clones "o".
@param <T>
the type of "o"
@param o
the object to be deep-cloned
@return a deep-clone of "o". | [
"deep",
"clones",
"o",
"."
] | 6c26200ab03855dbb92b56ca0c6363cdec0eaf2c | https://github.com/kiegroup/droolsjbpm-integration/blob/6c26200ab03855dbb92b56ca0c6363cdec0eaf2c/kie-camel/src/main/java/org/kie/camel/embedded/component/FastCloner.java#L241-L257 |
112,915 | kiegroup/droolsjbpm-integration | kie-camel/src/main/java/org/kie/camel/embedded/component/FastCloner.java | FastCloner.copyPropertiesOfInheritedClass | public <T, E extends T> void copyPropertiesOfInheritedClass(final T src, final E dest) {
if (src == null) {
throw new IllegalArgumentException("src can't be null");
}
if (dest == null) {
throw new IllegalArgumentException("dest can't be null");
}
final Cla... | java | public <T, E extends T> void copyPropertiesOfInheritedClass(final T src, final E dest) {
if (src == null) {
throw new IllegalArgumentException("src can't be null");
}
if (dest == null) {
throw new IllegalArgumentException("dest can't be null");
}
final Cla... | [
"public",
"<",
"T",
",",
"E",
"extends",
"T",
">",
"void",
"copyPropertiesOfInheritedClass",
"(",
"final",
"T",
"src",
",",
"final",
"E",
"dest",
")",
"{",
"if",
"(",
"src",
"==",
"null",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"src ... | copies all properties from src to dest. Src and dest can be of different class, provided they contain same field names
@param src
the source object
@param dest
the destination object which must contain as minimul all the fields of src | [
"copies",
"all",
"properties",
"from",
"src",
"to",
"dest",
".",
"Src",
"and",
"dest",
"can",
"be",
"of",
"different",
"class",
"provided",
"they",
"contain",
"same",
"field",
"names"
] | 6c26200ab03855dbb92b56ca0c6363cdec0eaf2c | https://github.com/kiegroup/droolsjbpm-integration/blob/6c26200ab03855dbb92b56ca0c6363cdec0eaf2c/kie-camel/src/main/java/org/kie/camel/embedded/component/FastCloner.java#L369-L402 |
112,916 | kiegroup/droolsjbpm-integration | kie-spring-boot/kie-spring-boot-autoconfiguration/kie-server-spring-boot-autoconfiguration-jbpm/src/main/java/org/kie/server/springboot/jbpm/ContainerAliasResolver.java | ContainerAliasResolver.forCaseInstance | public String forCaseInstance(String alias, String caseId) {
return registry.getContainerId(alias, new ByCaseIdContainerLocator(caseId));
} | java | public String forCaseInstance(String alias, String caseId) {
return registry.getContainerId(alias, new ByCaseIdContainerLocator(caseId));
} | [
"public",
"String",
"forCaseInstance",
"(",
"String",
"alias",
",",
"String",
"caseId",
")",
"{",
"return",
"registry",
".",
"getContainerId",
"(",
"alias",
",",
"new",
"ByCaseIdContainerLocator",
"(",
"caseId",
")",
")",
";",
"}"
] | Looks up container id for given alias that is associated with case instance
@param alias container alias
@param caseId unique case instance id
@return
@throws IllegalArgumentException in case there are no containers for given alias | [
"Looks",
"up",
"container",
"id",
"for",
"given",
"alias",
"that",
"is",
"associated",
"with",
"case",
"instance"
] | 6c26200ab03855dbb92b56ca0c6363cdec0eaf2c | https://github.com/kiegroup/droolsjbpm-integration/blob/6c26200ab03855dbb92b56ca0c6363cdec0eaf2c/kie-spring-boot/kie-spring-boot-autoconfiguration/kie-server-spring-boot-autoconfiguration-jbpm/src/main/java/org/kie/server/springboot/jbpm/ContainerAliasResolver.java#L54-L56 |
112,917 | kiegroup/droolsjbpm-integration | kie-spring-boot/kie-spring-boot-autoconfiguration/kie-server-spring-boot-autoconfiguration-jbpm/src/main/java/org/kie/server/springboot/jbpm/ContainerAliasResolver.java | ContainerAliasResolver.forProcessInstance | public String forProcessInstance(String alias, long processInstanceId) {
return registry.getContainerId(alias, new ByProcessInstanceIdContainerLocator(processInstanceId));
} | java | public String forProcessInstance(String alias, long processInstanceId) {
return registry.getContainerId(alias, new ByProcessInstanceIdContainerLocator(processInstanceId));
} | [
"public",
"String",
"forProcessInstance",
"(",
"String",
"alias",
",",
"long",
"processInstanceId",
")",
"{",
"return",
"registry",
".",
"getContainerId",
"(",
"alias",
",",
"new",
"ByProcessInstanceIdContainerLocator",
"(",
"processInstanceId",
")",
")",
";",
"}"
] | Looks up container id for given alias that is associated with process instance
@param alias container alias
@param processInstanceId unique process instance id
@return
@throws IllegalArgumentException in case there are no containers for given alias | [
"Looks",
"up",
"container",
"id",
"for",
"given",
"alias",
"that",
"is",
"associated",
"with",
"process",
"instance"
] | 6c26200ab03855dbb92b56ca0c6363cdec0eaf2c | https://github.com/kiegroup/droolsjbpm-integration/blob/6c26200ab03855dbb92b56ca0c6363cdec0eaf2c/kie-spring-boot/kie-spring-boot-autoconfiguration/kie-server-spring-boot-autoconfiguration-jbpm/src/main/java/org/kie/server/springboot/jbpm/ContainerAliasResolver.java#L65-L67 |
112,918 | kiegroup/droolsjbpm-integration | kie-spring-boot/kie-spring-boot-autoconfiguration/kie-server-spring-boot-autoconfiguration-jbpm/src/main/java/org/kie/server/springboot/jbpm/ContainerAliasResolver.java | ContainerAliasResolver.forTaskInstance | public String forTaskInstance(String alias, long taskId) {
return registry.getContainerId(alias, new ByTaskIdContainerLocator(taskId));
} | java | public String forTaskInstance(String alias, long taskId) {
return registry.getContainerId(alias, new ByTaskIdContainerLocator(taskId));
} | [
"public",
"String",
"forTaskInstance",
"(",
"String",
"alias",
",",
"long",
"taskId",
")",
"{",
"return",
"registry",
".",
"getContainerId",
"(",
"alias",
",",
"new",
"ByTaskIdContainerLocator",
"(",
"taskId",
")",
")",
";",
"}"
] | Looks up container id for given alias that is associated with task instance
@param alias container alias
@param taskId unique task instance id
@return
@throws IllegalArgumentException in case there are no containers for given alias | [
"Looks",
"up",
"container",
"id",
"for",
"given",
"alias",
"that",
"is",
"associated",
"with",
"task",
"instance"
] | 6c26200ab03855dbb92b56ca0c6363cdec0eaf2c | https://github.com/kiegroup/droolsjbpm-integration/blob/6c26200ab03855dbb92b56ca0c6363cdec0eaf2c/kie-spring-boot/kie-spring-boot-autoconfiguration/kie-server-spring-boot-autoconfiguration-jbpm/src/main/java/org/kie/server/springboot/jbpm/ContainerAliasResolver.java#L76-L78 |
112,919 | libgdx/packr | src/main/java/com/badlogicgames/packr/PackrConfig.java | PackrConfig.validate | void validate() throws IOException {
validate(platform, "platform");
validate(jdk, "JDK");
validate(executable, "executable name");
validate(mainClass, "main class");
validate(outDir, "output folder");
if (outDir.exists()) {
if (new File(".").equals(outDir)) {
throw new IOException("Output directory... | java | void validate() throws IOException {
validate(platform, "platform");
validate(jdk, "JDK");
validate(executable, "executable name");
validate(mainClass, "main class");
validate(outDir, "output folder");
if (outDir.exists()) {
if (new File(".").equals(outDir)) {
throw new IOException("Output directory... | [
"void",
"validate",
"(",
")",
"throws",
"IOException",
"{",
"validate",
"(",
"platform",
",",
"\"platform\"",
")",
";",
"validate",
"(",
"jdk",
",",
"\"JDK\"",
")",
";",
"validate",
"(",
"executable",
",",
"\"executable name\"",
")",
";",
"validate",
"(",
... | Sanity checks for configuration settings. Because users like to break stuff. | [
"Sanity",
"checks",
"for",
"configuration",
"settings",
".",
"Because",
"users",
"like",
"to",
"break",
"stuff",
"."
] | 4dd00a1fb5075dc1b6cd84f46bfdd918eb3d50e9 | https://github.com/libgdx/packr/blob/4dd00a1fb5075dc1b6cd84f46bfdd918eb3d50e9/src/main/java/com/badlogicgames/packr/PackrConfig.java#L252-L271 |
112,920 | GoogleCloudPlatform/bigdata-interop | bigquery/src/main/java/com/google/cloud/hadoop/io/bigquery/output/IndirectBigQueryOutputCommitter.java | IndirectBigQueryOutputCommitter.commitJob | @Override
public void commitJob(JobContext context) throws IOException {
super.commitJob(context);
// Get the destination configuration information.
Configuration conf = context.getConfiguration();
TableReference destTable = BigQueryOutputConfiguration.getTableReference(conf);
String destProjectI... | java | @Override
public void commitJob(JobContext context) throws IOException {
super.commitJob(context);
// Get the destination configuration information.
Configuration conf = context.getConfiguration();
TableReference destTable = BigQueryOutputConfiguration.getTableReference(conf);
String destProjectI... | [
"@",
"Override",
"public",
"void",
"commitJob",
"(",
"JobContext",
"context",
")",
"throws",
"IOException",
"{",
"super",
".",
"commitJob",
"(",
"context",
")",
";",
"// Get the destination configuration information.",
"Configuration",
"conf",
"=",
"context",
".",
"... | Runs an import job on BigQuery for the data in the output path in addition to calling the
delegate's commitJob. | [
"Runs",
"an",
"import",
"job",
"on",
"BigQuery",
"for",
"the",
"data",
"in",
"the",
"output",
"path",
"in",
"addition",
"to",
"calling",
"the",
"delegate",
"s",
"commitJob",
"."
] | 918d91c80a63e36046edb28972a5c65d3326a858 | https://github.com/GoogleCloudPlatform/bigdata-interop/blob/918d91c80a63e36046edb28972a5c65d3326a858/bigquery/src/main/java/com/google/cloud/hadoop/io/bigquery/output/IndirectBigQueryOutputCommitter.java#L55-L85 |
112,921 | GoogleCloudPlatform/bigdata-interop | bigquery/src/main/java/com/google/cloud/hadoop/io/bigquery/output/IndirectBigQueryOutputCommitter.java | IndirectBigQueryOutputCommitter.abortJob | @Override
public void abortJob(JobContext context, State state) throws IOException {
super.abortJob(context, state);
cleanup(context);
} | java | @Override
public void abortJob(JobContext context, State state) throws IOException {
super.abortJob(context, state);
cleanup(context);
} | [
"@",
"Override",
"public",
"void",
"abortJob",
"(",
"JobContext",
"context",
",",
"State",
"state",
")",
"throws",
"IOException",
"{",
"super",
".",
"abortJob",
"(",
"context",
",",
"state",
")",
";",
"cleanup",
"(",
"context",
")",
";",
"}"
] | Performs a cleanup of the output path in addition to delegating the call to the wrapped
OutputCommitter. | [
"Performs",
"a",
"cleanup",
"of",
"the",
"output",
"path",
"in",
"addition",
"to",
"delegating",
"the",
"call",
"to",
"the",
"wrapped",
"OutputCommitter",
"."
] | 918d91c80a63e36046edb28972a5c65d3326a858 | https://github.com/GoogleCloudPlatform/bigdata-interop/blob/918d91c80a63e36046edb28972a5c65d3326a858/bigquery/src/main/java/com/google/cloud/hadoop/io/bigquery/output/IndirectBigQueryOutputCommitter.java#L91-L95 |
112,922 | GoogleCloudPlatform/bigdata-interop | bigquery/src/main/java/com/google/cloud/hadoop/io/bigquery/output/ForwardingBigQueryFileOutputCommitter.java | ForwardingBigQueryFileOutputCommitter.cleanup | protected void cleanup(JobContext context) throws IOException {
boolean delete =
BigQueryOutputConfiguration.getCleanupTemporaryDataFlag(context.getConfiguration());
if (delete && outputFileSystem.exists(outputPath)) {
logger.atInfo().log("Found GCS output data at '%s', attempting to clean up.", ... | java | protected void cleanup(JobContext context) throws IOException {
boolean delete =
BigQueryOutputConfiguration.getCleanupTemporaryDataFlag(context.getConfiguration());
if (delete && outputFileSystem.exists(outputPath)) {
logger.atInfo().log("Found GCS output data at '%s', attempting to clean up.", ... | [
"protected",
"void",
"cleanup",
"(",
"JobContext",
"context",
")",
"throws",
"IOException",
"{",
"boolean",
"delete",
"=",
"BigQueryOutputConfiguration",
".",
"getCleanupTemporaryDataFlag",
"(",
"context",
".",
"getConfiguration",
"(",
")",
")",
";",
"if",
"(",
"d... | Attempts to manually delete data in the output path. If this fails, another delete attempt is
made on JVM shutdown.
@param context the job content to cleanup.
@throws IOException if a FileSystem exception is encountered. | [
"Attempts",
"to",
"manually",
"delete",
"data",
"in",
"the",
"output",
"path",
".",
"If",
"this",
"fails",
"another",
"delete",
"attempt",
"is",
"made",
"on",
"JVM",
"shutdown",
"."
] | 918d91c80a63e36046edb28972a5c65d3326a858 | https://github.com/GoogleCloudPlatform/bigdata-interop/blob/918d91c80a63e36046edb28972a5c65d3326a858/bigquery/src/main/java/com/google/cloud/hadoop/io/bigquery/output/ForwardingBigQueryFileOutputCommitter.java#L160-L174 |
112,923 | GoogleCloudPlatform/bigdata-interop | gcs/src/main/java/com/google/cloud/hadoop/fs/gcs/GoogleHadoopFSInputStream.java | GoogleHadoopFSInputStream.read | @Override
public synchronized int read() throws IOException {
long startTime = System.nanoTime();
// TODO(user): Wrap this in a while-loop if we ever introduce a non-blocking mode for the
// underlying channel.
int numRead = channel.read(ByteBuffer.wrap(singleReadBuf));
if (numRead == -1) {
... | java | @Override
public synchronized int read() throws IOException {
long startTime = System.nanoTime();
// TODO(user): Wrap this in a while-loop if we ever introduce a non-blocking mode for the
// underlying channel.
int numRead = channel.read(ByteBuffer.wrap(singleReadBuf));
if (numRead == -1) {
... | [
"@",
"Override",
"public",
"synchronized",
"int",
"read",
"(",
")",
"throws",
"IOException",
"{",
"long",
"startTime",
"=",
"System",
".",
"nanoTime",
"(",
")",
";",
"// TODO(user): Wrap this in a while-loop if we ever introduce a non-blocking mode for the",
"// underlying ... | Reads a single byte from the underlying store.
@return A single byte from the underlying store or -1 on EOF.
@throws IOException if an IO error occurs. | [
"Reads",
"a",
"single",
"byte",
"from",
"the",
"underlying",
"store",
"."
] | 918d91c80a63e36046edb28972a5c65d3326a858 | https://github.com/GoogleCloudPlatform/bigdata-interop/blob/918d91c80a63e36046edb28972a5c65d3326a858/gcs/src/main/java/com/google/cloud/hadoop/fs/gcs/GoogleHadoopFSInputStream.java#L86-L110 |
112,924 | GoogleCloudPlatform/bigdata-interop | gcs/src/main/java/com/google/cloud/hadoop/fs/gcs/GoogleHadoopFSInputStream.java | GoogleHadoopFSInputStream.read | @Override
public synchronized int read(byte[] buf, int offset, int length) throws IOException {
long startTime = System.nanoTime();
Preconditions.checkNotNull(buf, "buf must not be null");
if (offset < 0 || length < 0 || length > buf.length - offset) {
throw new IndexOutOfBoundsException();
}
... | java | @Override
public synchronized int read(byte[] buf, int offset, int length) throws IOException {
long startTime = System.nanoTime();
Preconditions.checkNotNull(buf, "buf must not be null");
if (offset < 0 || length < 0 || length > buf.length - offset) {
throw new IndexOutOfBoundsException();
}
... | [
"@",
"Override",
"public",
"synchronized",
"int",
"read",
"(",
"byte",
"[",
"]",
"buf",
",",
"int",
"offset",
",",
"int",
"length",
")",
"throws",
"IOException",
"{",
"long",
"startTime",
"=",
"System",
".",
"nanoTime",
"(",
")",
";",
"Preconditions",
".... | Reads up to length bytes from the underlying store and stores them starting at the specified
offset in the given buffer. Less than length bytes may be returned.
@param buf The buffer into which data is returned.
@param offset The offset at which data is written.
@param length Maximum number of bytes to read.
@return N... | [
"Reads",
"up",
"to",
"length",
"bytes",
"from",
"the",
"underlying",
"store",
"and",
"stores",
"them",
"starting",
"at",
"the",
"specified",
"offset",
"in",
"the",
"given",
"buffer",
".",
"Less",
"than",
"length",
"bytes",
"may",
"be",
"returned",
"."
] | 918d91c80a63e36046edb28972a5c65d3326a858 | https://github.com/GoogleCloudPlatform/bigdata-interop/blob/918d91c80a63e36046edb28972a5c65d3326a858/gcs/src/main/java/com/google/cloud/hadoop/fs/gcs/GoogleHadoopFSInputStream.java#L122-L142 |
112,925 | GoogleCloudPlatform/bigdata-interop | gcs/src/main/java/com/google/cloud/hadoop/fs/gcs/GoogleHadoopFSInputStream.java | GoogleHadoopFSInputStream.read | @Override
public synchronized int read(long position, byte[] buf, int offset, int length)
throws IOException {
long startTime = System.nanoTime();
int result = super.read(position, buf, offset, length);
if (result > 0) {
// -1 means we actually read 0 bytes, but requested at least one byte.
... | java | @Override
public synchronized int read(long position, byte[] buf, int offset, int length)
throws IOException {
long startTime = System.nanoTime();
int result = super.read(position, buf, offset, length);
if (result > 0) {
// -1 means we actually read 0 bytes, but requested at least one byte.
... | [
"@",
"Override",
"public",
"synchronized",
"int",
"read",
"(",
"long",
"position",
",",
"byte",
"[",
"]",
"buf",
",",
"int",
"offset",
",",
"int",
"length",
")",
"throws",
"IOException",
"{",
"long",
"startTime",
"=",
"System",
".",
"nanoTime",
"(",
")",... | Reads up to length bytes from the underlying store and stores them starting at the specified
offset in the given buffer. Less than length bytes may be returned. Reading starts at the given
position.
@param position Data is read from the stream starting at this position.
@param buf The buffer into which data is returne... | [
"Reads",
"up",
"to",
"length",
"bytes",
"from",
"the",
"underlying",
"store",
"and",
"stores",
"them",
"starting",
"at",
"the",
"specified",
"offset",
"in",
"the",
"given",
"buffer",
".",
"Less",
"than",
"length",
"bytes",
"may",
"be",
"returned",
".",
"Re... | 918d91c80a63e36046edb28972a5c65d3326a858 | https://github.com/GoogleCloudPlatform/bigdata-interop/blob/918d91c80a63e36046edb28972a5c65d3326a858/gcs/src/main/java/com/google/cloud/hadoop/fs/gcs/GoogleHadoopFSInputStream.java#L156-L172 |
112,926 | GoogleCloudPlatform/bigdata-interop | gcs/src/main/java/com/google/cloud/hadoop/fs/gcs/GoogleHadoopFSInputStream.java | GoogleHadoopFSInputStream.getPos | @Override
public synchronized long getPos() throws IOException {
long pos = channel.position();
logger.atFine().log("getPos: %d", pos);
return pos;
} | java | @Override
public synchronized long getPos() throws IOException {
long pos = channel.position();
logger.atFine().log("getPos: %d", pos);
return pos;
} | [
"@",
"Override",
"public",
"synchronized",
"long",
"getPos",
"(",
")",
"throws",
"IOException",
"{",
"long",
"pos",
"=",
"channel",
".",
"position",
"(",
")",
";",
"logger",
".",
"atFine",
"(",
")",
".",
"log",
"(",
"\"getPos: %d\"",
",",
"pos",
")",
"... | Gets the current position within the file being read.
@return The current position within the file being read.
@throws IOException if an IO error occurs. | [
"Gets",
"the",
"current",
"position",
"within",
"the",
"file",
"being",
"read",
"."
] | 918d91c80a63e36046edb28972a5c65d3326a858 | https://github.com/GoogleCloudPlatform/bigdata-interop/blob/918d91c80a63e36046edb28972a5c65d3326a858/gcs/src/main/java/com/google/cloud/hadoop/fs/gcs/GoogleHadoopFSInputStream.java#L180-L185 |
112,927 | GoogleCloudPlatform/bigdata-interop | gcs/src/main/java/com/google/cloud/hadoop/fs/gcs/GoogleHadoopFSInputStream.java | GoogleHadoopFSInputStream.seek | @Override
public synchronized void seek(long pos) throws IOException {
long startTime = System.nanoTime();
logger.atFine().log("seek: %d", pos);
try {
channel.position(pos);
} catch (IllegalArgumentException e) {
throw new IOException(e);
}
long duration = System.nanoTime() - start... | java | @Override
public synchronized void seek(long pos) throws IOException {
long startTime = System.nanoTime();
logger.atFine().log("seek: %d", pos);
try {
channel.position(pos);
} catch (IllegalArgumentException e) {
throw new IOException(e);
}
long duration = System.nanoTime() - start... | [
"@",
"Override",
"public",
"synchronized",
"void",
"seek",
"(",
"long",
"pos",
")",
"throws",
"IOException",
"{",
"long",
"startTime",
"=",
"System",
".",
"nanoTime",
"(",
")",
";",
"logger",
".",
"atFine",
"(",
")",
".",
"log",
"(",
"\"seek: %d\"",
",",... | Sets the current position within the file being read.
@param pos The position to seek to.
@throws IOException if an IO error occurs or if the target position is invalid. | [
"Sets",
"the",
"current",
"position",
"within",
"the",
"file",
"being",
"read",
"."
] | 918d91c80a63e36046edb28972a5c65d3326a858 | https://github.com/GoogleCloudPlatform/bigdata-interop/blob/918d91c80a63e36046edb28972a5c65d3326a858/gcs/src/main/java/com/google/cloud/hadoop/fs/gcs/GoogleHadoopFSInputStream.java#L193-L205 |
112,928 | GoogleCloudPlatform/bigdata-interop | gcs/src/main/java/com/google/cloud/hadoop/fs/gcs/GoogleHadoopFSInputStream.java | GoogleHadoopFSInputStream.close | @Override
public synchronized void close() throws IOException {
if (channel != null) {
long startTime = System.nanoTime();
logger.atFine().log("close: file: %s, totalBytesRead: %d", gcsPath, totalBytesRead);
channel.close();
long duration = System.nanoTime() - startTime;
ghfs.increme... | java | @Override
public synchronized void close() throws IOException {
if (channel != null) {
long startTime = System.nanoTime();
logger.atFine().log("close: file: %s, totalBytesRead: %d", gcsPath, totalBytesRead);
channel.close();
long duration = System.nanoTime() - startTime;
ghfs.increme... | [
"@",
"Override",
"public",
"synchronized",
"void",
"close",
"(",
")",
"throws",
"IOException",
"{",
"if",
"(",
"channel",
"!=",
"null",
")",
"{",
"long",
"startTime",
"=",
"System",
".",
"nanoTime",
"(",
")",
";",
"logger",
".",
"atFine",
"(",
")",
"."... | Closes the current stream.
@throws IOException if an IO error occurs. | [
"Closes",
"the",
"current",
"stream",
"."
] | 918d91c80a63e36046edb28972a5c65d3326a858 | https://github.com/GoogleCloudPlatform/bigdata-interop/blob/918d91c80a63e36046edb28972a5c65d3326a858/gcs/src/main/java/com/google/cloud/hadoop/fs/gcs/GoogleHadoopFSInputStream.java#L222-L235 |
112,929 | GoogleCloudPlatform/bigdata-interop | bigquery/src/main/java/com/google/cloud/hadoop/io/bigquery/AbstractBigQueryInputFormat.java | AbstractBigQueryInputFormat.setTemporaryCloudStorageDirectory | public static void setTemporaryCloudStorageDirectory(Configuration configuration, String path) {
configuration.set(BigQueryConfiguration.TEMP_GCS_PATH_KEY, path);
} | java | public static void setTemporaryCloudStorageDirectory(Configuration configuration, String path) {
configuration.set(BigQueryConfiguration.TEMP_GCS_PATH_KEY, path);
} | [
"public",
"static",
"void",
"setTemporaryCloudStorageDirectory",
"(",
"Configuration",
"configuration",
",",
"String",
"path",
")",
"{",
"configuration",
".",
"set",
"(",
"BigQueryConfiguration",
".",
"TEMP_GCS_PATH_KEY",
",",
"path",
")",
";",
"}"
] | Configure a directory to which we will export BigQuery data | [
"Configure",
"a",
"directory",
"to",
"which",
"we",
"will",
"export",
"BigQuery",
"data"
] | 918d91c80a63e36046edb28972a5c65d3326a858 | https://github.com/GoogleCloudPlatform/bigdata-interop/blob/918d91c80a63e36046edb28972a5c65d3326a858/bigquery/src/main/java/com/google/cloud/hadoop/io/bigquery/AbstractBigQueryInputFormat.java#L88-L90 |
112,930 | GoogleCloudPlatform/bigdata-interop | bigquery/src/main/java/com/google/cloud/hadoop/io/bigquery/AbstractBigQueryInputFormat.java | AbstractBigQueryInputFormat.cleanupJob | public static void cleanupJob(Configuration configuration, JobID jobId) throws IOException {
String exportPathRoot = BigQueryConfiguration.getTemporaryPathRoot(configuration, jobId);
configuration.set(BigQueryConfiguration.TEMP_GCS_PATH_KEY, exportPathRoot);
Bigquery bigquery = null;
try {
bigquer... | java | public static void cleanupJob(Configuration configuration, JobID jobId) throws IOException {
String exportPathRoot = BigQueryConfiguration.getTemporaryPathRoot(configuration, jobId);
configuration.set(BigQueryConfiguration.TEMP_GCS_PATH_KEY, exportPathRoot);
Bigquery bigquery = null;
try {
bigquer... | [
"public",
"static",
"void",
"cleanupJob",
"(",
"Configuration",
"configuration",
",",
"JobID",
"jobId",
")",
"throws",
"IOException",
"{",
"String",
"exportPathRoot",
"=",
"BigQueryConfiguration",
".",
"getTemporaryPathRoot",
"(",
"configuration",
",",
"jobId",
")",
... | Cleans up relevant temporary resources associated with a job which used the
GsonBigQueryInputFormat; this should be called explicitly after the completion of the entire
job. Possibly cleans up intermediate export tables if configured to use one due to
specifying a BigQuery "query" for the input. Cleans up the GCS direc... | [
"Cleans",
"up",
"relevant",
"temporary",
"resources",
"associated",
"with",
"a",
"job",
"which",
"used",
"the",
"GsonBigQueryInputFormat",
";",
"this",
"should",
"be",
"called",
"explicitly",
"after",
"the",
"completion",
"of",
"the",
"entire",
"job",
".",
"Poss... | 918d91c80a63e36046edb28972a5c65d3326a858 | https://github.com/GoogleCloudPlatform/bigdata-interop/blob/918d91c80a63e36046edb28972a5c65d3326a858/bigquery/src/main/java/com/google/cloud/hadoop/io/bigquery/AbstractBigQueryInputFormat.java#L207-L217 |
112,931 | GoogleCloudPlatform/bigdata-interop | util/src/main/java/com/google/cloud/hadoop/util/PropertyUtil.java | PropertyUtil.getPropertyOrDefault | public static String getPropertyOrDefault(
Class<?> referenceClass,
String propertyFile,
String key,
String defaultValue) {
try (InputStream stream = referenceClass.getResourceAsStream(propertyFile)) {
if (stream == null) {
logger.atSevere().log("Could not load properties file ... | java | public static String getPropertyOrDefault(
Class<?> referenceClass,
String propertyFile,
String key,
String defaultValue) {
try (InputStream stream = referenceClass.getResourceAsStream(propertyFile)) {
if (stream == null) {
logger.atSevere().log("Could not load properties file ... | [
"public",
"static",
"String",
"getPropertyOrDefault",
"(",
"Class",
"<",
"?",
">",
"referenceClass",
",",
"String",
"propertyFile",
",",
"String",
"key",
",",
"String",
"defaultValue",
")",
"{",
"try",
"(",
"InputStream",
"stream",
"=",
"referenceClass",
".",
... | Get the value of a property or a default value if there's an error retrieving the property key.
@param referenceClass The class which should be used to find the property file. The property
file is expected to be packaged in the same directory as this class.
@param propertyFile The name of the property file to be read.
... | [
"Get",
"the",
"value",
"of",
"a",
"property",
"or",
"a",
"default",
"value",
"if",
"there",
"s",
"an",
"error",
"retrieving",
"the",
"property",
"key",
"."
] | 918d91c80a63e36046edb28972a5c65d3326a858 | https://github.com/GoogleCloudPlatform/bigdata-interop/blob/918d91c80a63e36046edb28972a5c65d3326a858/util/src/main/java/com/google/cloud/hadoop/util/PropertyUtil.java#L41-L64 |
112,932 | GoogleCloudPlatform/bigdata-interop | bigquery/src/main/java/com/google/cloud/hadoop/io/bigquery/BigQueryHelper.java | BigQueryHelper.exportBigQueryToGcs | public void exportBigQueryToGcs(String projectId, TableReference tableRef, List<String> gcsPaths,
boolean awaitCompletion) throws IOException, InterruptedException {
logger.atFine().log(
"exportBigQueryToGcs(bigquery, '%s', '%s', '%s', '%s')",
projectId, BigQueryStrings.toString(tableRef), gcs... | java | public void exportBigQueryToGcs(String projectId, TableReference tableRef, List<String> gcsPaths,
boolean awaitCompletion) throws IOException, InterruptedException {
logger.atFine().log(
"exportBigQueryToGcs(bigquery, '%s', '%s', '%s', '%s')",
projectId, BigQueryStrings.toString(tableRef), gcs... | [
"public",
"void",
"exportBigQueryToGcs",
"(",
"String",
"projectId",
",",
"TableReference",
"tableRef",
",",
"List",
"<",
"String",
">",
"gcsPaths",
",",
"boolean",
"awaitCompletion",
")",
"throws",
"IOException",
",",
"InterruptedException",
"{",
"logger",
".",
"... | Exports BigQuery results into GCS, polls for completion before returning.
@param projectId the project on whose behalf to perform the export.
@param tableRef the table to export.
@param gcsPaths the GCS paths to export to.
@param awaitCompletion if true, block and poll until job completes, otherwise return as soon as
... | [
"Exports",
"BigQuery",
"results",
"into",
"GCS",
"polls",
"for",
"completion",
"before",
"returning",
"."
] | 918d91c80a63e36046edb28972a5c65d3326a858 | https://github.com/GoogleCloudPlatform/bigdata-interop/blob/918d91c80a63e36046edb28972a5c65d3326a858/bigquery/src/main/java/com/google/cloud/hadoop/io/bigquery/BigQueryHelper.java#L205-L247 |
112,933 | GoogleCloudPlatform/bigdata-interop | bigquery/src/main/java/com/google/cloud/hadoop/io/bigquery/BigQueryHelper.java | BigQueryHelper.tableExists | public boolean tableExists(TableReference tableRef) throws IOException {
try {
Table fetchedTable = service.tables().get(
tableRef.getProjectId(), tableRef.getDatasetId(), tableRef.getTableId()).execute();
logger.atFine().log(
"Successfully fetched table '%s' for tableRef '%s'", fetc... | java | public boolean tableExists(TableReference tableRef) throws IOException {
try {
Table fetchedTable = service.tables().get(
tableRef.getProjectId(), tableRef.getDatasetId(), tableRef.getTableId()).execute();
logger.atFine().log(
"Successfully fetched table '%s' for tableRef '%s'", fetc... | [
"public",
"boolean",
"tableExists",
"(",
"TableReference",
"tableRef",
")",
"throws",
"IOException",
"{",
"try",
"{",
"Table",
"fetchedTable",
"=",
"service",
".",
"tables",
"(",
")",
".",
"get",
"(",
"tableRef",
".",
"getProjectId",
"(",
")",
",",
"tableRef... | Returns true if the table exists, or false if not. | [
"Returns",
"true",
"if",
"the",
"table",
"exists",
"or",
"false",
"if",
"not",
"."
] | 918d91c80a63e36046edb28972a5c65d3326a858 | https://github.com/GoogleCloudPlatform/bigdata-interop/blob/918d91c80a63e36046edb28972a5c65d3326a858/bigquery/src/main/java/com/google/cloud/hadoop/io/bigquery/BigQueryHelper.java#L252-L267 |
112,934 | GoogleCloudPlatform/bigdata-interop | bigquery/src/main/java/com/google/cloud/hadoop/io/bigquery/BigQueryHelper.java | BigQueryHelper.getTable | public Table getTable(TableReference tableRef)
throws IOException {
Bigquery.Tables.Get getTablesReply = service.tables().get(
tableRef.getProjectId(), tableRef.getDatasetId(), tableRef.getTableId());
return getTablesReply.execute();
} | java | public Table getTable(TableReference tableRef)
throws IOException {
Bigquery.Tables.Get getTablesReply = service.tables().get(
tableRef.getProjectId(), tableRef.getDatasetId(), tableRef.getTableId());
return getTablesReply.execute();
} | [
"public",
"Table",
"getTable",
"(",
"TableReference",
"tableRef",
")",
"throws",
"IOException",
"{",
"Bigquery",
".",
"Tables",
".",
"Get",
"getTablesReply",
"=",
"service",
".",
"tables",
"(",
")",
".",
"get",
"(",
"tableRef",
".",
"getProjectId",
"(",
")",... | Gets the specified table resource by table ID. This method does not return the data in the
table, it only returns the table resource, which describes the structure of this table.
@param tableRef The BigQuery table reference.
@return The table resource, which describes the structure of this table.
@throws IOException | [
"Gets",
"the",
"specified",
"table",
"resource",
"by",
"table",
"ID",
".",
"This",
"method",
"does",
"not",
"return",
"the",
"data",
"in",
"the",
"table",
"it",
"only",
"returns",
"the",
"table",
"resource",
"which",
"describes",
"the",
"structure",
"of",
... | 918d91c80a63e36046edb28972a5c65d3326a858 | https://github.com/GoogleCloudPlatform/bigdata-interop/blob/918d91c80a63e36046edb28972a5c65d3326a858/bigquery/src/main/java/com/google/cloud/hadoop/io/bigquery/BigQueryHelper.java#L277-L282 |
112,935 | GoogleCloudPlatform/bigdata-interop | gcsio/src/main/java/com/google/cloud/hadoop/gcsio/GoogleCloudStorageFileSystem.java | GoogleCloudStorageFileSystem.create | public WritableByteChannel create(URI path, CreateFileOptions options) throws IOException {
logger.atFine().log("create(%s)", path);
Preconditions.checkNotNull(path, "path could not be null");
if (FileInfo.isDirectoryPath(path)) {
throw new IOException(
String.format("Cannot create a file wh... | java | public WritableByteChannel create(URI path, CreateFileOptions options) throws IOException {
logger.atFine().log("create(%s)", path);
Preconditions.checkNotNull(path, "path could not be null");
if (FileInfo.isDirectoryPath(path)) {
throw new IOException(
String.format("Cannot create a file wh... | [
"public",
"WritableByteChannel",
"create",
"(",
"URI",
"path",
",",
"CreateFileOptions",
"options",
")",
"throws",
"IOException",
"{",
"logger",
".",
"atFine",
"(",
")",
".",
"log",
"(",
"\"create(%s)\"",
",",
"path",
")",
";",
"Preconditions",
".",
"checkNotN... | Creates and opens an object for writing.
@param path Object full path of the form gs://bucket/object-path.
@return A channel for writing to the given object.
@throws IOException | [
"Creates",
"and",
"opens",
"an",
"object",
"for",
"writing",
"."
] | 918d91c80a63e36046edb28972a5c65d3326a858 | https://github.com/GoogleCloudPlatform/bigdata-interop/blob/918d91c80a63e36046edb28972a5c65d3326a858/gcsio/src/main/java/com/google/cloud/hadoop/gcsio/GoogleCloudStorageFileSystem.java#L258-L283 |
112,936 | GoogleCloudPlatform/bigdata-interop | gcsio/src/main/java/com/google/cloud/hadoop/gcsio/GoogleCloudStorageFileSystem.java | GoogleCloudStorageFileSystem.open | public SeekableByteChannel open(URI path, GoogleCloudStorageReadOptions readOptions)
throws IOException {
logger.atFine().log("open(%s, %s)", path, readOptions);
Preconditions.checkNotNull(path);
checkArgument(!FileInfo.isDirectoryPath(path), "Cannot open a directory for reading: %s", path);
// V... | java | public SeekableByteChannel open(URI path, GoogleCloudStorageReadOptions readOptions)
throws IOException {
logger.atFine().log("open(%s, %s)", path, readOptions);
Preconditions.checkNotNull(path);
checkArgument(!FileInfo.isDirectoryPath(path), "Cannot open a directory for reading: %s", path);
// V... | [
"public",
"SeekableByteChannel",
"open",
"(",
"URI",
"path",
",",
"GoogleCloudStorageReadOptions",
"readOptions",
")",
"throws",
"IOException",
"{",
"logger",
".",
"atFine",
"(",
")",
".",
"log",
"(",
"\"open(%s, %s)\"",
",",
"path",
",",
"readOptions",
")",
";"... | Opens an object for reading.
@param path Object full path of the form gs://bucket/object-path.
@param readOptions Fine-grained options for behaviors of retries, buffering, etc.
@return A channel for reading from the given object.
@throws FileNotFoundException if the given path does not exist.
@throws IOException if ob... | [
"Opens",
"an",
"object",
"for",
"reading",
"."
] | 918d91c80a63e36046edb28972a5c65d3326a858 | https://github.com/GoogleCloudPlatform/bigdata-interop/blob/918d91c80a63e36046edb28972a5c65d3326a858/gcsio/src/main/java/com/google/cloud/hadoop/gcsio/GoogleCloudStorageFileSystem.java#L331-L340 |
112,937 | GoogleCloudPlatform/bigdata-interop | gcsio/src/main/java/com/google/cloud/hadoop/gcsio/GoogleCloudStorageFileSystem.java | GoogleCloudStorageFileSystem.delete | public void delete(URI path, boolean recursive) throws IOException {
Preconditions.checkNotNull(path, "path can not be null");
checkArgument(!path.equals(GCS_ROOT), "Cannot delete root path (%s)", path);
logger.atFine().log("delete(%s, %s)", path, recursive);
FileInfo fileInfo = getFileInfo(path);
... | java | public void delete(URI path, boolean recursive) throws IOException {
Preconditions.checkNotNull(path, "path can not be null");
checkArgument(!path.equals(GCS_ROOT), "Cannot delete root path (%s)", path);
logger.atFine().log("delete(%s, %s)", path, recursive);
FileInfo fileInfo = getFileInfo(path);
... | [
"public",
"void",
"delete",
"(",
"URI",
"path",
",",
"boolean",
"recursive",
")",
"throws",
"IOException",
"{",
"Preconditions",
".",
"checkNotNull",
"(",
"path",
",",
"\"path can not be null\"",
")",
";",
"checkArgument",
"(",
"!",
"path",
".",
"equals",
"(",... | Deletes one or more items indicated by the given path.
<p>If path points to a directory:
<ul>
<li>if recursive is true, all items under that path are recursively deleted followed by
deletion of the directory.
<li>else,
<ul>
<li>the directory is deleted if it is empty,
<li>else, an IOException is thrown.
</ul>
</ul>
... | [
"Deletes",
"one",
"or",
"more",
"items",
"indicated",
"by",
"the",
"given",
"path",
"."
] | 918d91c80a63e36046edb28972a5c65d3326a858 | https://github.com/GoogleCloudPlatform/bigdata-interop/blob/918d91c80a63e36046edb28972a5c65d3326a858/gcsio/src/main/java/com/google/cloud/hadoop/gcsio/GoogleCloudStorageFileSystem.java#L364-L413 |
112,938 | GoogleCloudPlatform/bigdata-interop | gcsio/src/main/java/com/google/cloud/hadoop/gcsio/GoogleCloudStorageFileSystem.java | GoogleCloudStorageFileSystem.deleteInternal | private void deleteInternal(List<FileInfo> itemsToDelete, List<FileInfo> bucketsToDelete)
throws IOException {
// TODO(user): We might need to separate out children into separate batches from parents to
// avoid deleting a parent before somehow failing to delete a child.
// Delete children before the... | java | private void deleteInternal(List<FileInfo> itemsToDelete, List<FileInfo> bucketsToDelete)
throws IOException {
// TODO(user): We might need to separate out children into separate batches from parents to
// avoid deleting a parent before somehow failing to delete a child.
// Delete children before the... | [
"private",
"void",
"deleteInternal",
"(",
"List",
"<",
"FileInfo",
">",
"itemsToDelete",
",",
"List",
"<",
"FileInfo",
">",
"bucketsToDelete",
")",
"throws",
"IOException",
"{",
"// TODO(user): We might need to separate out children into separate batches from parents to",
"//... | Deletes all items in the given path list followed by all bucket items. | [
"Deletes",
"all",
"items",
"in",
"the",
"given",
"path",
"list",
"followed",
"by",
"all",
"bucket",
"items",
"."
] | 918d91c80a63e36046edb28972a5c65d3326a858 | https://github.com/GoogleCloudPlatform/bigdata-interop/blob/918d91c80a63e36046edb28972a5c65d3326a858/gcsio/src/main/java/com/google/cloud/hadoop/gcsio/GoogleCloudStorageFileSystem.java#L416-L454 |
112,939 | GoogleCloudPlatform/bigdata-interop | gcsio/src/main/java/com/google/cloud/hadoop/gcsio/GoogleCloudStorageFileSystem.java | GoogleCloudStorageFileSystem.exists | public boolean exists(URI path)
throws IOException {
logger.atFine().log("exists(%s)", path);
return getFileInfo(path).exists();
} | java | public boolean exists(URI path)
throws IOException {
logger.atFine().log("exists(%s)", path);
return getFileInfo(path).exists();
} | [
"public",
"boolean",
"exists",
"(",
"URI",
"path",
")",
"throws",
"IOException",
"{",
"logger",
".",
"atFine",
"(",
")",
".",
"log",
"(",
"\"exists(%s)\"",
",",
"path",
")",
";",
"return",
"getFileInfo",
"(",
"path",
")",
".",
"exists",
"(",
")",
";",
... | Indicates whether the given item exists.
@param path Path of the item to check.
@return true if the given item exists, false otherwise.
@throws IOException | [
"Indicates",
"whether",
"the",
"given",
"item",
"exists",
"."
] | 918d91c80a63e36046edb28972a5c65d3326a858 | https://github.com/GoogleCloudPlatform/bigdata-interop/blob/918d91c80a63e36046edb28972a5c65d3326a858/gcsio/src/main/java/com/google/cloud/hadoop/gcsio/GoogleCloudStorageFileSystem.java#L463-L467 |
112,940 | GoogleCloudPlatform/bigdata-interop | gcsio/src/main/java/com/google/cloud/hadoop/gcsio/GoogleCloudStorageFileSystem.java | GoogleCloudStorageFileSystem.mkdirs | public void mkdirs(URI path) throws IOException {
logger.atFine().log("mkdirs(%s)", path);
Preconditions.checkNotNull(path);
if (path.equals(GCS_ROOT)) {
// GCS_ROOT directory always exists, no need to go through the rest of the method.
return;
}
StorageResourceId resourceId = pathCode... | java | public void mkdirs(URI path) throws IOException {
logger.atFine().log("mkdirs(%s)", path);
Preconditions.checkNotNull(path);
if (path.equals(GCS_ROOT)) {
// GCS_ROOT directory always exists, no need to go through the rest of the method.
return;
}
StorageResourceId resourceId = pathCode... | [
"public",
"void",
"mkdirs",
"(",
"URI",
"path",
")",
"throws",
"IOException",
"{",
"logger",
".",
"atFine",
"(",
")",
".",
"log",
"(",
"\"mkdirs(%s)\"",
",",
"path",
")",
";",
"Preconditions",
".",
"checkNotNull",
"(",
"path",
")",
";",
"if",
"(",
"pat... | Creates a directory at the specified path. Also creates any parent directories as necessary.
Similar to 'mkdir -p' command.
@param path Path of the directory to create.
@throws IOException | [
"Creates",
"a",
"directory",
"at",
"the",
"specified",
"path",
".",
"Also",
"creates",
"any",
"parent",
"directories",
"as",
"necessary",
".",
"Similar",
"to",
"mkdir",
"-",
"p",
"command",
"."
] | 918d91c80a63e36046edb28972a5c65d3326a858 | https://github.com/GoogleCloudPlatform/bigdata-interop/blob/918d91c80a63e36046edb28972a5c65d3326a858/gcsio/src/main/java/com/google/cloud/hadoop/gcsio/GoogleCloudStorageFileSystem.java#L476-L545 |
112,941 | GoogleCloudPlatform/bigdata-interop | gcsio/src/main/java/com/google/cloud/hadoop/gcsio/GoogleCloudStorageFileSystem.java | GoogleCloudStorageFileSystem.compose | public void compose(List<URI> sources, URI destination, String contentType) throws IOException {
StorageResourceId destResource = StorageResourceId.fromObjectName(destination.toString());
List<String> sourceObjects =
Lists.transform(
sources, uri -> StorageResourceId.fromObjectName(uri.toStr... | java | public void compose(List<URI> sources, URI destination, String contentType) throws IOException {
StorageResourceId destResource = StorageResourceId.fromObjectName(destination.toString());
List<String> sourceObjects =
Lists.transform(
sources, uri -> StorageResourceId.fromObjectName(uri.toStr... | [
"public",
"void",
"compose",
"(",
"List",
"<",
"URI",
">",
"sources",
",",
"URI",
"destination",
",",
"String",
"contentType",
")",
"throws",
"IOException",
"{",
"StorageResourceId",
"destResource",
"=",
"StorageResourceId",
".",
"fromObjectName",
"(",
"destinatio... | Composes inputs into a single GCS object. This performs a GCS Compose. Objects will be composed
according to the order they appear in the input. The destination object, if already present,
will be overwritten. Sources and destination are assumed to be in the same bucket.
@param sources the list of URIs to be composed
... | [
"Composes",
"inputs",
"into",
"a",
"single",
"GCS",
"object",
".",
"This",
"performs",
"a",
"GCS",
"Compose",
".",
"Objects",
"will",
"be",
"composed",
"according",
"to",
"the",
"order",
"they",
"appear",
"in",
"the",
"input",
".",
"The",
"destination",
"o... | 918d91c80a63e36046edb28972a5c65d3326a858 | https://github.com/GoogleCloudPlatform/bigdata-interop/blob/918d91c80a63e36046edb28972a5c65d3326a858/gcsio/src/main/java/com/google/cloud/hadoop/gcsio/GoogleCloudStorageFileSystem.java#L716-L723 |
112,942 | GoogleCloudPlatform/bigdata-interop | gcsio/src/main/java/com/google/cloud/hadoop/gcsio/GoogleCloudStorageFileSystem.java | GoogleCloudStorageFileSystem.renameInternal | private void renameInternal(FileInfo srcInfo, URI dst) throws IOException {
if (srcInfo.isDirectory()) {
renameDirectoryInternal(srcInfo, dst);
} else {
URI src = srcInfo.getPath();
StorageResourceId srcResourceId = pathCodec.validatePathAndGetId(src, true);
StorageResourceId dstResource... | java | private void renameInternal(FileInfo srcInfo, URI dst) throws IOException {
if (srcInfo.isDirectory()) {
renameDirectoryInternal(srcInfo, dst);
} else {
URI src = srcInfo.getPath();
StorageResourceId srcResourceId = pathCodec.validatePathAndGetId(src, true);
StorageResourceId dstResource... | [
"private",
"void",
"renameInternal",
"(",
"FileInfo",
"srcInfo",
",",
"URI",
"dst",
")",
"throws",
"IOException",
"{",
"if",
"(",
"srcInfo",
".",
"isDirectory",
"(",
")",
")",
"{",
"renameDirectoryInternal",
"(",
"srcInfo",
",",
"dst",
")",
";",
"}",
"else... | Renames the given path without checking any parameters.
<p>GCS does not support atomic renames therefore a rename is implemented as copying source
metadata to destination and then deleting source metadata. Note that only the metadata is
copied and not the content of any file. | [
"Renames",
"the",
"given",
"path",
"without",
"checking",
"any",
"parameters",
"."
] | 918d91c80a63e36046edb28972a5c65d3326a858 | https://github.com/GoogleCloudPlatform/bigdata-interop/blob/918d91c80a63e36046edb28972a5c65d3326a858/gcsio/src/main/java/com/google/cloud/hadoop/gcsio/GoogleCloudStorageFileSystem.java#L732-L757 |
112,943 | GoogleCloudPlatform/bigdata-interop | gcsio/src/main/java/com/google/cloud/hadoop/gcsio/GoogleCloudStorageFileSystem.java | GoogleCloudStorageFileSystem.renameDirectoryInternal | private void renameDirectoryInternal(FileInfo srcInfo, URI dst) throws IOException {
checkArgument(srcInfo.isDirectory(), "'%s' should be a directory", srcInfo);
Pattern markerFilePattern = options.getMarkerFilePattern();
// Mapping from each src to its respective dst.
// Sort src items so that parent... | java | private void renameDirectoryInternal(FileInfo srcInfo, URI dst) throws IOException {
checkArgument(srcInfo.isDirectory(), "'%s' should be a directory", srcInfo);
Pattern markerFilePattern = options.getMarkerFilePattern();
// Mapping from each src to its respective dst.
// Sort src items so that parent... | [
"private",
"void",
"renameDirectoryInternal",
"(",
"FileInfo",
"srcInfo",
",",
"URI",
"dst",
")",
"throws",
"IOException",
"{",
"checkArgument",
"(",
"srcInfo",
".",
"isDirectory",
"(",
")",
",",
"\"'%s' should be a directory\"",
",",
"srcInfo",
")",
";",
"Pattern... | Renames given directory.
@see #renameInternal | [
"Renames",
"given",
"directory",
"."
] | 918d91c80a63e36046edb28972a5c65d3326a858 | https://github.com/GoogleCloudPlatform/bigdata-interop/blob/918d91c80a63e36046edb28972a5c65d3326a858/gcsio/src/main/java/com/google/cloud/hadoop/gcsio/GoogleCloudStorageFileSystem.java#L764-L833 |
112,944 | GoogleCloudPlatform/bigdata-interop | gcsio/src/main/java/com/google/cloud/hadoop/gcsio/GoogleCloudStorageFileSystem.java | GoogleCloudStorageFileSystem.copyInternal | private void copyInternal(Map<FileInfo, URI> srcToDstItemNames) throws IOException {
if (srcToDstItemNames.isEmpty()) {
return;
}
String srcBucketName = null;
String dstBucketName = null;
List<String> srcObjectNames = new ArrayList<>(srcToDstItemNames.size());
List<String> dstObjectNames ... | java | private void copyInternal(Map<FileInfo, URI> srcToDstItemNames) throws IOException {
if (srcToDstItemNames.isEmpty()) {
return;
}
String srcBucketName = null;
String dstBucketName = null;
List<String> srcObjectNames = new ArrayList<>(srcToDstItemNames.size());
List<String> dstObjectNames ... | [
"private",
"void",
"copyInternal",
"(",
"Map",
"<",
"FileInfo",
",",
"URI",
">",
"srcToDstItemNames",
")",
"throws",
"IOException",
"{",
"if",
"(",
"srcToDstItemNames",
".",
"isEmpty",
"(",
")",
")",
"{",
"return",
";",
"}",
"String",
"srcBucketName",
"=",
... | Copies items in given map that maps source items to destination items. | [
"Copies",
"items",
"in",
"given",
"map",
"that",
"maps",
"source",
"items",
"to",
"destination",
"items",
"."
] | 918d91c80a63e36046edb28972a5c65d3326a858 | https://github.com/GoogleCloudPlatform/bigdata-interop/blob/918d91c80a63e36046edb28972a5c65d3326a858/gcsio/src/main/java/com/google/cloud/hadoop/gcsio/GoogleCloudStorageFileSystem.java#L836-L862 |
112,945 | GoogleCloudPlatform/bigdata-interop | gcsio/src/main/java/com/google/cloud/hadoop/gcsio/GoogleCloudStorageFileSystem.java | GoogleCloudStorageFileSystem.listFileNames | public List<URI> listFileNames(FileInfo fileInfo, boolean recursive)
throws IOException {
Preconditions.checkNotNull(fileInfo);
URI path = fileInfo.getPath();
logger.atFine().log("listFileNames(%s)", path);
List<URI> paths = new ArrayList<>();
List<String> childNames;
// If it is a direc... | java | public List<URI> listFileNames(FileInfo fileInfo, boolean recursive)
throws IOException {
Preconditions.checkNotNull(fileInfo);
URI path = fileInfo.getPath();
logger.atFine().log("listFileNames(%s)", path);
List<URI> paths = new ArrayList<>();
List<String> childNames;
// If it is a direc... | [
"public",
"List",
"<",
"URI",
">",
"listFileNames",
"(",
"FileInfo",
"fileInfo",
",",
"boolean",
"recursive",
")",
"throws",
"IOException",
"{",
"Preconditions",
".",
"checkNotNull",
"(",
"fileInfo",
")",
";",
"URI",
"path",
"=",
"fileInfo",
".",
"getPath",
... | If the given item is a directory then the paths of its
children are returned, otherwise the path of the given item is returned.
@param fileInfo FileInfo of an item.
@param recursive If true, path of all children are returned;
else, only immediate children are returned.
@return Paths of children (if directory) or self ... | [
"If",
"the",
"given",
"item",
"is",
"a",
"directory",
"then",
"the",
"paths",
"of",
"its",
"children",
"are",
"returned",
"otherwise",
"the",
"path",
"of",
"the",
"given",
"item",
"is",
"returned",
"."
] | 918d91c80a63e36046edb28972a5c65d3326a858 | https://github.com/GoogleCloudPlatform/bigdata-interop/blob/918d91c80a63e36046edb28972a5c65d3326a858/gcsio/src/main/java/com/google/cloud/hadoop/gcsio/GoogleCloudStorageFileSystem.java#L887-L936 |
112,946 | GoogleCloudPlatform/bigdata-interop | gcsio/src/main/java/com/google/cloud/hadoop/gcsio/GoogleCloudStorageFileSystem.java | GoogleCloudStorageFileSystem.listFileInfo | public List<FileInfo> listFileInfo(URI path) throws IOException {
Preconditions.checkNotNull(path, "path can not be null");
logger.atFine().log("listFileInfo(%s)", path);
StorageResourceId pathId = pathCodec.validatePathAndGetId(path, true);
StorageResourceId dirId =
pathCodec.validatePathAndGe... | java | public List<FileInfo> listFileInfo(URI path) throws IOException {
Preconditions.checkNotNull(path, "path can not be null");
logger.atFine().log("listFileInfo(%s)", path);
StorageResourceId pathId = pathCodec.validatePathAndGetId(path, true);
StorageResourceId dirId =
pathCodec.validatePathAndGe... | [
"public",
"List",
"<",
"FileInfo",
">",
"listFileInfo",
"(",
"URI",
"path",
")",
"throws",
"IOException",
"{",
"Preconditions",
".",
"checkNotNull",
"(",
"path",
",",
"\"path can not be null\"",
")",
";",
"logger",
".",
"atFine",
"(",
")",
".",
"log",
"(",
... | If the given path points to a directory then the information about its children is returned,
otherwise information about the given file is returned.
<p>Note: This function is expensive to call, especially for a directory with many children. Use
the alternative {@link GoogleCloudStorageFileSystem#listFileNames(FileInfo... | [
"If",
"the",
"given",
"path",
"points",
"to",
"a",
"directory",
"then",
"the",
"information",
"about",
"its",
"children",
"is",
"returned",
"otherwise",
"information",
"about",
"the",
"given",
"file",
"is",
"returned",
"."
] | 918d91c80a63e36046edb28972a5c65d3326a858 | https://github.com/GoogleCloudPlatform/bigdata-interop/blob/918d91c80a63e36046edb28972a5c65d3326a858/gcsio/src/main/java/com/google/cloud/hadoop/gcsio/GoogleCloudStorageFileSystem.java#L1050-L1096 |
112,947 | GoogleCloudPlatform/bigdata-interop | gcsio/src/main/java/com/google/cloud/hadoop/gcsio/GoogleCloudStorageFileSystem.java | GoogleCloudStorageFileSystem.getFileInfo | public FileInfo getFileInfo(URI path) throws IOException {
logger.atFine().log("getFileInfo(%s)", path);
checkArgument(path != null, "path must not be null");
// Validate the given path. true == allow empty object name.
// One should be able to get info about top level directory (== bucket),
// ther... | java | public FileInfo getFileInfo(URI path) throws IOException {
logger.atFine().log("getFileInfo(%s)", path);
checkArgument(path != null, "path must not be null");
// Validate the given path. true == allow empty object name.
// One should be able to get info about top level directory (== bucket),
// ther... | [
"public",
"FileInfo",
"getFileInfo",
"(",
"URI",
"path",
")",
"throws",
"IOException",
"{",
"logger",
".",
"atFine",
"(",
")",
".",
"log",
"(",
"\"getFileInfo(%s)\"",
",",
"path",
")",
";",
"checkArgument",
"(",
"path",
"!=",
"null",
",",
"\"path must not be... | Gets information about the given path item.
@param path The path we want information about.
@return Information about the given path item.
@throws IOException | [
"Gets",
"information",
"about",
"the",
"given",
"path",
"item",
"."
] | 918d91c80a63e36046edb28972a5c65d3326a858 | https://github.com/GoogleCloudPlatform/bigdata-interop/blob/918d91c80a63e36046edb28972a5c65d3326a858/gcsio/src/main/java/com/google/cloud/hadoop/gcsio/GoogleCloudStorageFileSystem.java#L1105-L1118 |
112,948 | GoogleCloudPlatform/bigdata-interop | gcsio/src/main/java/com/google/cloud/hadoop/gcsio/GoogleCloudStorageFileSystem.java | GoogleCloudStorageFileSystem.close | public void close() {
if (gcs != null) {
logger.atFine().log("close()");
try {
gcs.close();
} finally {
gcs = null;
if (updateTimestampsExecutor != null) {
try {
shutdownExecutor(updateTimestampsExecutor, /* waitSeconds= */ 10);
} finally {
... | java | public void close() {
if (gcs != null) {
logger.atFine().log("close()");
try {
gcs.close();
} finally {
gcs = null;
if (updateTimestampsExecutor != null) {
try {
shutdownExecutor(updateTimestampsExecutor, /* waitSeconds= */ 10);
} finally {
... | [
"public",
"void",
"close",
"(",
")",
"{",
"if",
"(",
"gcs",
"!=",
"null",
")",
"{",
"logger",
".",
"atFine",
"(",
")",
".",
"log",
"(",
"\"close()\"",
")",
";",
"try",
"{",
"gcs",
".",
"close",
"(",
")",
";",
"}",
"finally",
"{",
"gcs",
"=",
... | Releases resources used by this instance. | [
"Releases",
"resources",
"used",
"by",
"this",
"instance",
"."
] | 918d91c80a63e36046edb28972a5c65d3326a858 | https://github.com/GoogleCloudPlatform/bigdata-interop/blob/918d91c80a63e36046edb28972a5c65d3326a858/gcsio/src/main/java/com/google/cloud/hadoop/gcsio/GoogleCloudStorageFileSystem.java#L1217-L1242 |
112,949 | GoogleCloudPlatform/bigdata-interop | gcsio/src/main/java/com/google/cloud/hadoop/gcsio/GoogleCloudStorageFileSystem.java | GoogleCloudStorageFileSystem.mkdir | @VisibleForTesting
public void mkdir(URI path)
throws IOException {
logger.atFine().log("mkdir(%s)", path);
Preconditions.checkNotNull(path);
checkArgument(!path.equals(GCS_ROOT), "Cannot create root directory.");
StorageResourceId resourceId = pathCodec.validatePathAndGetId(path, true);
... | java | @VisibleForTesting
public void mkdir(URI path)
throws IOException {
logger.atFine().log("mkdir(%s)", path);
Preconditions.checkNotNull(path);
checkArgument(!path.equals(GCS_ROOT), "Cannot create root directory.");
StorageResourceId resourceId = pathCodec.validatePathAndGetId(path, true);
... | [
"@",
"VisibleForTesting",
"public",
"void",
"mkdir",
"(",
"URI",
"path",
")",
"throws",
"IOException",
"{",
"logger",
".",
"atFine",
"(",
")",
".",
"log",
"(",
"\"mkdir(%s)\"",
",",
"path",
")",
";",
"Preconditions",
".",
"checkNotNull",
"(",
"path",
")",
... | Creates a directory at the specified path.
There are two conventions for using objects as directories in GCS.
1. An object of zero size with name ending in /
2. An object of zero size with name ending in _$folder$
#1 is the recommended convention by the GCS team. We use it when
creating a directory.
However, some ol... | [
"Creates",
"a",
"directory",
"at",
"the",
"specified",
"path",
"."
] | 918d91c80a63e36046edb28972a5c65d3326a858 | https://github.com/GoogleCloudPlatform/bigdata-interop/blob/918d91c80a63e36046edb28972a5c65d3326a858/gcsio/src/main/java/com/google/cloud/hadoop/gcsio/GoogleCloudStorageFileSystem.java#L1275-L1298 |
112,950 | GoogleCloudPlatform/bigdata-interop | gcsio/src/main/java/com/google/cloud/hadoop/gcsio/GoogleCloudStorageFileSystem.java | GoogleCloudStorageFileSystem.validateBucketName | static String validateBucketName(String bucketName) {
// If the name ends with /, remove it.
bucketName = FileInfo.convertToFilePath(bucketName);
if (Strings.isNullOrEmpty(bucketName)) {
throw new IllegalArgumentException(
"Google Cloud Storage bucket name cannot be empty.");
}
if... | java | static String validateBucketName(String bucketName) {
// If the name ends with /, remove it.
bucketName = FileInfo.convertToFilePath(bucketName);
if (Strings.isNullOrEmpty(bucketName)) {
throw new IllegalArgumentException(
"Google Cloud Storage bucket name cannot be empty.");
}
if... | [
"static",
"String",
"validateBucketName",
"(",
"String",
"bucketName",
")",
"{",
"// If the name ends with /, remove it.",
"bucketName",
"=",
"FileInfo",
".",
"convertToFilePath",
"(",
"bucketName",
")",
";",
"if",
"(",
"Strings",
".",
"isNullOrEmpty",
"(",
"bucketNam... | Validate the given bucket name to make sure that it can be used
as a part of a file system path.
Note: this is not designed to duplicate the exact checks that GCS
would perform on the server side. We make some checks
that are relevant to using GCS as a file system.
@param bucketName Bucket name to check. | [
"Validate",
"the",
"given",
"bucket",
"name",
"to",
"make",
"sure",
"that",
"it",
"can",
"be",
"used",
"as",
"a",
"part",
"of",
"a",
"file",
"system",
"path",
"."
] | 918d91c80a63e36046edb28972a5c65d3326a858 | https://github.com/GoogleCloudPlatform/bigdata-interop/blob/918d91c80a63e36046edb28972a5c65d3326a858/gcsio/src/main/java/com/google/cloud/hadoop/gcsio/GoogleCloudStorageFileSystem.java#L1416-L1434 |
112,951 | GoogleCloudPlatform/bigdata-interop | gcsio/src/main/java/com/google/cloud/hadoop/gcsio/GoogleCloudStorageFileSystem.java | GoogleCloudStorageFileSystem.validateObjectName | static String validateObjectName(String objectName, boolean allowEmptyObjectName) {
logger.atFine().log("validateObjectName('%s', %s)", objectName, allowEmptyObjectName);
if (isNullOrEmpty(objectName) || objectName.equals(PATH_DELIMITER)) {
if (allowEmptyObjectName) {
objectName = "";
} els... | java | static String validateObjectName(String objectName, boolean allowEmptyObjectName) {
logger.atFine().log("validateObjectName('%s', %s)", objectName, allowEmptyObjectName);
if (isNullOrEmpty(objectName) || objectName.equals(PATH_DELIMITER)) {
if (allowEmptyObjectName) {
objectName = "";
} els... | [
"static",
"String",
"validateObjectName",
"(",
"String",
"objectName",
",",
"boolean",
"allowEmptyObjectName",
")",
"{",
"logger",
".",
"atFine",
"(",
")",
".",
"log",
"(",
"\"validateObjectName('%s', %s)\"",
",",
"objectName",
",",
"allowEmptyObjectName",
")",
";",... | Validate the given object name to make sure that it can be used
as a part of a file system path.
Note: this is not designed to duplicate the exact checks that GCS
would perform on the server side. We make some checks
that are relevant to using GCS as a file system.
@param objectName Object name to check.
@param allow... | [
"Validate",
"the",
"given",
"object",
"name",
"to",
"make",
"sure",
"that",
"it",
"can",
"be",
"used",
"as",
"a",
"part",
"of",
"a",
"file",
"system",
"path",
"."
] | 918d91c80a63e36046edb28972a5c65d3326a858 | https://github.com/GoogleCloudPlatform/bigdata-interop/blob/918d91c80a63e36046edb28972a5c65d3326a858/gcsio/src/main/java/com/google/cloud/hadoop/gcsio/GoogleCloudStorageFileSystem.java#L1447-L1477 |
112,952 | GoogleCloudPlatform/bigdata-interop | gcsio/src/main/java/com/google/cloud/hadoop/gcsio/GoogleCloudStorageFileSystem.java | GoogleCloudStorageFileSystem.getItemName | String getItemName(URI path) {
Preconditions.checkNotNull(path);
// There is no leaf item for the root path.
if (path.equals(GCS_ROOT)) {
return null;
}
StorageResourceId resourceId = pathCodec.validatePathAndGetId(path, true);
if (resourceId.isBucket()) {
return resourceId.getBuc... | java | String getItemName(URI path) {
Preconditions.checkNotNull(path);
// There is no leaf item for the root path.
if (path.equals(GCS_ROOT)) {
return null;
}
StorageResourceId resourceId = pathCodec.validatePathAndGetId(path, true);
if (resourceId.isBucket()) {
return resourceId.getBuc... | [
"String",
"getItemName",
"(",
"URI",
"path",
")",
"{",
"Preconditions",
".",
"checkNotNull",
"(",
"path",
")",
";",
"// There is no leaf item for the root path.",
"if",
"(",
"path",
".",
"equals",
"(",
"GCS_ROOT",
")",
")",
"{",
"return",
"null",
";",
"}",
"... | Gets the leaf item of the given path. | [
"Gets",
"the",
"leaf",
"item",
"of",
"the",
"given",
"path",
"."
] | 918d91c80a63e36046edb28972a5c65d3326a858 | https://github.com/GoogleCloudPlatform/bigdata-interop/blob/918d91c80a63e36046edb28972a5c65d3326a858/gcsio/src/main/java/com/google/cloud/hadoop/gcsio/GoogleCloudStorageFileSystem.java#L1482-L1504 |
112,953 | GoogleCloudPlatform/bigdata-interop | gcsio/src/main/java/com/google/cloud/hadoop/gcsio/GoogleCloudStorageFileSystem.java | GoogleCloudStorageFileSystem.validatePathAndGetId | @Deprecated
public static StorageResourceId validatePathAndGetId(URI uri, boolean allowEmptyObjectNames) {
return LEGACY_PATH_CODEC.validatePathAndGetId(uri, allowEmptyObjectNames);
} | java | @Deprecated
public static StorageResourceId validatePathAndGetId(URI uri, boolean allowEmptyObjectNames) {
return LEGACY_PATH_CODEC.validatePathAndGetId(uri, allowEmptyObjectNames);
} | [
"@",
"Deprecated",
"public",
"static",
"StorageResourceId",
"validatePathAndGetId",
"(",
"URI",
"uri",
",",
"boolean",
"allowEmptyObjectNames",
")",
"{",
"return",
"LEGACY_PATH_CODEC",
".",
"validatePathAndGetId",
"(",
"uri",
",",
"allowEmptyObjectNames",
")",
";",
"}... | Validate a URI using the legacy path codec and return a StorageResourceId.
@deprecated This method is deprecated as each instance of GCS FS can be configured
with a codec. | [
"Validate",
"a",
"URI",
"using",
"the",
"legacy",
"path",
"codec",
"and",
"return",
"a",
"StorageResourceId",
"."
] | 918d91c80a63e36046edb28972a5c65d3326a858 | https://github.com/GoogleCloudPlatform/bigdata-interop/blob/918d91c80a63e36046edb28972a5c65d3326a858/gcsio/src/main/java/com/google/cloud/hadoop/gcsio/GoogleCloudStorageFileSystem.java#L1536-L1539 |
112,954 | GoogleCloudPlatform/bigdata-interop | gcsio/src/main/java/com/google/cloud/hadoop/gcsio/GoogleCloudStorageFileSystem.java | GoogleCloudStorageFileSystem.getParentPath | @Deprecated
public static URI getParentPath(PathCodec pathCodec, URI path) {
Preconditions.checkNotNull(path);
// Root path has no parent.
if (path.equals(GCS_ROOT)) {
return null;
}
StorageResourceId resourceId = pathCodec.validatePathAndGetId(path, true);
if (resourceId.isBucket()) ... | java | @Deprecated
public static URI getParentPath(PathCodec pathCodec, URI path) {
Preconditions.checkNotNull(path);
// Root path has no parent.
if (path.equals(GCS_ROOT)) {
return null;
}
StorageResourceId resourceId = pathCodec.validatePathAndGetId(path, true);
if (resourceId.isBucket()) ... | [
"@",
"Deprecated",
"public",
"static",
"URI",
"getParentPath",
"(",
"PathCodec",
"pathCodec",
",",
"URI",
"path",
")",
"{",
"Preconditions",
".",
"checkNotNull",
"(",
"path",
")",
";",
"// Root path has no parent.",
"if",
"(",
"path",
".",
"equals",
"(",
"GCS_... | Gets the parent directory of the given path.
@deprecated This static method is included as a transitional utility and the
instance method variant should be preferred.
@param path Path to convert.
@return Path of parent directory of the given item or null for root path. | [
"Gets",
"the",
"parent",
"directory",
"of",
"the",
"given",
"path",
"."
] | 918d91c80a63e36046edb28972a5c65d3326a858 | https://github.com/GoogleCloudPlatform/bigdata-interop/blob/918d91c80a63e36046edb28972a5c65d3326a858/gcsio/src/main/java/com/google/cloud/hadoop/gcsio/GoogleCloudStorageFileSystem.java#L1583-L1608 |
112,955 | GoogleCloudPlatform/bigdata-interop | bigquery/src/main/java/com/google/cloud/hadoop/io/bigquery/output/FederatedBigQueryOutputCommitter.java | FederatedBigQueryOutputCommitter.commitJob | @Override
public void commitJob(JobContext context) throws IOException {
super.commitJob(context);
// Get the destination configuration information.
Configuration conf = context.getConfiguration();
TableReference destTable = BigQueryOutputConfiguration.getTableReference(conf);
String destProjectI... | java | @Override
public void commitJob(JobContext context) throws IOException {
super.commitJob(context);
// Get the destination configuration information.
Configuration conf = context.getConfiguration();
TableReference destTable = BigQueryOutputConfiguration.getTableReference(conf);
String destProjectI... | [
"@",
"Override",
"public",
"void",
"commitJob",
"(",
"JobContext",
"context",
")",
"throws",
"IOException",
"{",
"super",
".",
"commitJob",
"(",
"context",
")",
";",
"// Get the destination configuration information.",
"Configuration",
"conf",
"=",
"context",
".",
"... | Runs a federated import job on BigQuery for the data in the output path in addition to calling
the delegate's commitJob. | [
"Runs",
"a",
"federated",
"import",
"job",
"on",
"BigQuery",
"for",
"the",
"data",
"in",
"the",
"output",
"path",
"in",
"addition",
"to",
"calling",
"the",
"delegate",
"s",
"commitJob",
"."
] | 918d91c80a63e36046edb28972a5c65d3326a858 | https://github.com/GoogleCloudPlatform/bigdata-interop/blob/918d91c80a63e36046edb28972a5c65d3326a858/bigquery/src/main/java/com/google/cloud/hadoop/io/bigquery/output/FederatedBigQueryOutputCommitter.java#L55-L74 |
112,956 | GoogleCloudPlatform/bigdata-interop | gcs/src/main/java/com/google/cloud/hadoop/fs/gcs/GoogleHadoopFileSystem.java | GoogleHadoopFileSystem.configureBuckets | @Override
@VisibleForTesting
protected void configureBuckets(GoogleCloudStorageFileSystem gcsFs) throws IOException {
rootBucket = initUri.getAuthority();
checkArgument(rootBucket != null, "No bucket specified in GCS URI: %s", initUri);
// Validate root bucket name
pathCodec.getPath(rootBucket, /* o... | java | @Override
@VisibleForTesting
protected void configureBuckets(GoogleCloudStorageFileSystem gcsFs) throws IOException {
rootBucket = initUri.getAuthority();
checkArgument(rootBucket != null, "No bucket specified in GCS URI: %s", initUri);
// Validate root bucket name
pathCodec.getPath(rootBucket, /* o... | [
"@",
"Override",
"@",
"VisibleForTesting",
"protected",
"void",
"configureBuckets",
"(",
"GoogleCloudStorageFileSystem",
"gcsFs",
")",
"throws",
"IOException",
"{",
"rootBucket",
"=",
"initUri",
".",
"getAuthority",
"(",
")",
";",
"checkArgument",
"(",
"rootBucket",
... | Sets and validates the root bucket. | [
"Sets",
"and",
"validates",
"the",
"root",
"bucket",
"."
] | 918d91c80a63e36046edb28972a5c65d3326a858 | https://github.com/GoogleCloudPlatform/bigdata-interop/blob/918d91c80a63e36046edb28972a5c65d3326a858/gcs/src/main/java/com/google/cloud/hadoop/fs/gcs/GoogleHadoopFileSystem.java#L67-L76 |
112,957 | GoogleCloudPlatform/bigdata-interop | gcs/src/main/java/com/google/cloud/hadoop/fs/gcs/GoogleHadoopFileSystem.java | GoogleHadoopFileSystem.getHadoopPath | @Override
public Path getHadoopPath(URI gcsPath) {
logger.atFine().log("GHFS.getHadoopPath: %s", gcsPath);
// Handle root. Delegate to getGcsPath on "gs:/" to resolve the appropriate gs://<bucket> URI.
if (gcsPath.equals(getGcsPath(getFileSystemRoot()))) {
return getFileSystemRoot();
}
Sto... | java | @Override
public Path getHadoopPath(URI gcsPath) {
logger.atFine().log("GHFS.getHadoopPath: %s", gcsPath);
// Handle root. Delegate to getGcsPath on "gs:/" to resolve the appropriate gs://<bucket> URI.
if (gcsPath.equals(getGcsPath(getFileSystemRoot()))) {
return getFileSystemRoot();
}
Sto... | [
"@",
"Override",
"public",
"Path",
"getHadoopPath",
"(",
"URI",
"gcsPath",
")",
"{",
"logger",
".",
"atFine",
"(",
")",
".",
"log",
"(",
"\"GHFS.getHadoopPath: %s\"",
",",
"gcsPath",
")",
";",
"// Handle root. Delegate to getGcsPath on \"gs:/\" to resolve the appropriat... | Validates GCS Path belongs to this file system. The bucket must
match the root bucket provided at initialization time. | [
"Validates",
"GCS",
"Path",
"belongs",
"to",
"this",
"file",
"system",
".",
"The",
"bucket",
"must",
"match",
"the",
"root",
"bucket",
"provided",
"at",
"initialization",
"time",
"."
] | 918d91c80a63e36046edb28972a5c65d3326a858 | https://github.com/GoogleCloudPlatform/bigdata-interop/blob/918d91c80a63e36046edb28972a5c65d3326a858/gcs/src/main/java/com/google/cloud/hadoop/fs/gcs/GoogleHadoopFileSystem.java#L113-L134 |
112,958 | GoogleCloudPlatform/bigdata-interop | gcsio/src/main/java/com/google/cloud/hadoop/gcsio/GoogleCloudStorageImpl.java | GoogleCloudStorageImpl.getDeletionCallback | private JsonBatchCallback<Void> getDeletionCallback(
final StorageResourceId resourceId,
final KeySetView<IOException, Boolean> innerExceptions,
final BatchHelper batchHelper,
final int attempt,
final long generation) {
return new JsonBatchCallback<Void>() {
@Override
publi... | java | private JsonBatchCallback<Void> getDeletionCallback(
final StorageResourceId resourceId,
final KeySetView<IOException, Boolean> innerExceptions,
final BatchHelper batchHelper,
final int attempt,
final long generation) {
return new JsonBatchCallback<Void>() {
@Override
publi... | [
"private",
"JsonBatchCallback",
"<",
"Void",
">",
"getDeletionCallback",
"(",
"final",
"StorageResourceId",
"resourceId",
",",
"final",
"KeySetView",
"<",
"IOException",
",",
"Boolean",
">",
"innerExceptions",
",",
"final",
"BatchHelper",
"batchHelper",
",",
"final",
... | Helper to create a callback for a particular deletion request. | [
"Helper",
"to",
"create",
"a",
"callback",
"for",
"a",
"particular",
"deletion",
"request",
"."
] | 918d91c80a63e36046edb28972a5c65d3326a858 | https://github.com/GoogleCloudPlatform/bigdata-interop/blob/918d91c80a63e36046edb28972a5c65d3326a858/gcsio/src/main/java/com/google/cloud/hadoop/gcsio/GoogleCloudStorageImpl.java#L691-L727 |
112,959 | GoogleCloudPlatform/bigdata-interop | gcsio/src/main/java/com/google/cloud/hadoop/gcsio/GoogleCloudStorageImpl.java | GoogleCloudStorageImpl.rewriteInternal | private void rewriteInternal(
final BatchHelper batchHelper,
final KeySetView<IOException, Boolean> innerExceptions,
final String srcBucketName, final String srcObjectName,
final String dstBucketName, final String dstObjectName)
throws IOException {
Storage.Objects.Rewrite rewriteObjec... | java | private void rewriteInternal(
final BatchHelper batchHelper,
final KeySetView<IOException, Boolean> innerExceptions,
final String srcBucketName, final String srcObjectName,
final String dstBucketName, final String dstObjectName)
throws IOException {
Storage.Objects.Rewrite rewriteObjec... | [
"private",
"void",
"rewriteInternal",
"(",
"final",
"BatchHelper",
"batchHelper",
",",
"final",
"KeySetView",
"<",
"IOException",
",",
"Boolean",
">",
"innerExceptions",
",",
"final",
"String",
"srcBucketName",
",",
"final",
"String",
"srcObjectName",
",",
"final",
... | Performs copy operation using GCS Rewrite requests
@see GoogleCloudStorage#copy(String, List, String, List) | [
"Performs",
"copy",
"operation",
"using",
"GCS",
"Rewrite",
"requests"
] | 918d91c80a63e36046edb28972a5c65d3326a858 | https://github.com/GoogleCloudPlatform/bigdata-interop/blob/918d91c80a63e36046edb28972a5c65d3326a858/gcsio/src/main/java/com/google/cloud/hadoop/gcsio/GoogleCloudStorageImpl.java#L915-L969 |
112,960 | GoogleCloudPlatform/bigdata-interop | gcsio/src/main/java/com/google/cloud/hadoop/gcsio/GoogleCloudStorageImpl.java | GoogleCloudStorageImpl.copyInternal | private void copyInternal(
BatchHelper batchHelper,
final KeySetView<IOException, Boolean> innerExceptions,
final String srcBucketName, final String srcObjectName,
final String dstBucketName, final String dstObjectName)
throws IOException {
Storage.Objects.Copy copyObject =
con... | java | private void copyInternal(
BatchHelper batchHelper,
final KeySetView<IOException, Boolean> innerExceptions,
final String srcBucketName, final String srcObjectName,
final String dstBucketName, final String dstObjectName)
throws IOException {
Storage.Objects.Copy copyObject =
con... | [
"private",
"void",
"copyInternal",
"(",
"BatchHelper",
"batchHelper",
",",
"final",
"KeySetView",
"<",
"IOException",
",",
"Boolean",
">",
"innerExceptions",
",",
"final",
"String",
"srcBucketName",
",",
"final",
"String",
"srcObjectName",
",",
"final",
"String",
... | Performs copy operation using GCS Copy requests
@see GoogleCloudStorage#copy(String, List, String, List) | [
"Performs",
"copy",
"operation",
"using",
"GCS",
"Copy",
"requests"
] | 918d91c80a63e36046edb28972a5c65d3326a858 | https://github.com/GoogleCloudPlatform/bigdata-interop/blob/918d91c80a63e36046edb28972a5c65d3326a858/gcsio/src/main/java/com/google/cloud/hadoop/gcsio/GoogleCloudStorageImpl.java#L976-L1002 |
112,961 | GoogleCloudPlatform/bigdata-interop | gcsio/src/main/java/com/google/cloud/hadoop/gcsio/GoogleCloudStorageImpl.java | GoogleCloudStorageImpl.onCopyFailure | private void onCopyFailure(
KeySetView<IOException, Boolean> innerExceptions,
GoogleJsonError e,
String srcBucketName, String srcObjectName) {
if (errorExtractor.itemNotFound(e)) {
FileNotFoundException fnfe =
GoogleCloudStorageExceptions.getFileNotFoundException(srcBucketName, src... | java | private void onCopyFailure(
KeySetView<IOException, Boolean> innerExceptions,
GoogleJsonError e,
String srcBucketName, String srcObjectName) {
if (errorExtractor.itemNotFound(e)) {
FileNotFoundException fnfe =
GoogleCloudStorageExceptions.getFileNotFoundException(srcBucketName, src... | [
"private",
"void",
"onCopyFailure",
"(",
"KeySetView",
"<",
"IOException",
",",
"Boolean",
">",
"innerExceptions",
",",
"GoogleJsonError",
"e",
",",
"String",
"srcBucketName",
",",
"String",
"srcObjectName",
")",
"{",
"if",
"(",
"errorExtractor",
".",
"itemNotFoun... | Processes failed copy requests | [
"Processes",
"failed",
"copy",
"requests"
] | 918d91c80a63e36046edb28972a5c65d3326a858 | https://github.com/GoogleCloudPlatform/bigdata-interop/blob/918d91c80a63e36046edb28972a5c65d3326a858/gcsio/src/main/java/com/google/cloud/hadoop/gcsio/GoogleCloudStorageImpl.java#L1005-L1017 |
112,962 | GoogleCloudPlatform/bigdata-interop | gcsio/src/main/java/com/google/cloud/hadoop/gcsio/GoogleCloudStorageImpl.java | GoogleCloudStorageImpl.handlePrefixes | private void handlePrefixes(
String bucketName, List<String> prefixes, List<GoogleCloudStorageItemInfo> objectInfos) {
if (storageOptions.isInferImplicitDirectoriesEnabled()) {
for (String prefix : prefixes) {
objectInfos.add(
GoogleCloudStorageItemInfo.createInferredDirectory(
... | java | private void handlePrefixes(
String bucketName, List<String> prefixes, List<GoogleCloudStorageItemInfo> objectInfos) {
if (storageOptions.isInferImplicitDirectoriesEnabled()) {
for (String prefix : prefixes) {
objectInfos.add(
GoogleCloudStorageItemInfo.createInferredDirectory(
... | [
"private",
"void",
"handlePrefixes",
"(",
"String",
"bucketName",
",",
"List",
"<",
"String",
">",
"prefixes",
",",
"List",
"<",
"GoogleCloudStorageItemInfo",
">",
"objectInfos",
")",
"{",
"if",
"(",
"storageOptions",
".",
"isInferImplicitDirectoriesEnabled",
"(",
... | Handle prefixes without prefix objects. | [
"Handle",
"prefixes",
"without",
"prefix",
"objects",
"."
] | 918d91c80a63e36046edb28972a5c65d3326a858 | https://github.com/GoogleCloudPlatform/bigdata-interop/blob/918d91c80a63e36046edb28972a5c65d3326a858/gcsio/src/main/java/com/google/cloud/hadoop/gcsio/GoogleCloudStorageImpl.java#L1435-L1448 |
112,963 | GoogleCloudPlatform/bigdata-interop | gcsio/src/main/java/com/google/cloud/hadoop/gcsio/GoogleCloudStorageImpl.java | GoogleCloudStorageImpl.createItemInfoForBucket | public static GoogleCloudStorageItemInfo createItemInfoForBucket(
StorageResourceId resourceId, Bucket bucket) {
Preconditions.checkArgument(resourceId != null, "resourceId must not be null");
Preconditions.checkArgument(bucket != null, "bucket must not be null");
Preconditions.checkArgument(
... | java | public static GoogleCloudStorageItemInfo createItemInfoForBucket(
StorageResourceId resourceId, Bucket bucket) {
Preconditions.checkArgument(resourceId != null, "resourceId must not be null");
Preconditions.checkArgument(bucket != null, "bucket must not be null");
Preconditions.checkArgument(
... | [
"public",
"static",
"GoogleCloudStorageItemInfo",
"createItemInfoForBucket",
"(",
"StorageResourceId",
"resourceId",
",",
"Bucket",
"bucket",
")",
"{",
"Preconditions",
".",
"checkArgument",
"(",
"resourceId",
"!=",
"null",
",",
"\"resourceId must not be null\"",
")",
";"... | Helper for converting a StorageResourceId + Bucket into a GoogleCloudStorageItemInfo. | [
"Helper",
"for",
"converting",
"a",
"StorageResourceId",
"+",
"Bucket",
"into",
"a",
"GoogleCloudStorageItemInfo",
"."
] | 918d91c80a63e36046edb28972a5c65d3326a858 | https://github.com/GoogleCloudPlatform/bigdata-interop/blob/918d91c80a63e36046edb28972a5c65d3326a858/gcsio/src/main/java/com/google/cloud/hadoop/gcsio/GoogleCloudStorageImpl.java#L1451-L1465 |
112,964 | GoogleCloudPlatform/bigdata-interop | gcsio/src/main/java/com/google/cloud/hadoop/gcsio/GoogleCloudStorageImpl.java | GoogleCloudStorageImpl.createItemInfoForStorageObject | public static GoogleCloudStorageItemInfo createItemInfoForStorageObject(
StorageResourceId resourceId, StorageObject object) {
Preconditions.checkArgument(resourceId != null, "resourceId must not be null");
Preconditions.checkArgument(object != null, "object must not be null");
Preconditions.checkArgu... | java | public static GoogleCloudStorageItemInfo createItemInfoForStorageObject(
StorageResourceId resourceId, StorageObject object) {
Preconditions.checkArgument(resourceId != null, "resourceId must not be null");
Preconditions.checkArgument(object != null, "object must not be null");
Preconditions.checkArgu... | [
"public",
"static",
"GoogleCloudStorageItemInfo",
"createItemInfoForStorageObject",
"(",
"StorageResourceId",
"resourceId",
",",
"StorageObject",
"object",
")",
"{",
"Preconditions",
".",
"checkArgument",
"(",
"resourceId",
"!=",
"null",
",",
"\"resourceId must not be null\""... | Helper for converting a StorageResourceId + StorageObject into a GoogleCloudStorageItemInfo. | [
"Helper",
"for",
"converting",
"a",
"StorageResourceId",
"+",
"StorageObject",
"into",
"a",
"GoogleCloudStorageItemInfo",
"."
] | 918d91c80a63e36046edb28972a5c65d3326a858 | https://github.com/GoogleCloudPlatform/bigdata-interop/blob/918d91c80a63e36046edb28972a5c65d3326a858/gcsio/src/main/java/com/google/cloud/hadoop/gcsio/GoogleCloudStorageImpl.java#L1470-L1515 |
112,965 | GoogleCloudPlatform/bigdata-interop | gcsio/src/main/java/com/google/cloud/hadoop/gcsio/GoogleCloudStorageImpl.java | GoogleCloudStorageImpl.getBucket | private Bucket getBucket(String bucketName)
throws IOException {
logger.atFine().log("getBucket(%s)", bucketName);
checkArgument(!Strings.isNullOrEmpty(bucketName), "bucketName must not be null or empty");
Storage.Buckets.Get getBucket = configureRequest(gcs.buckets().get(bucketName), bucketName);
... | java | private Bucket getBucket(String bucketName)
throws IOException {
logger.atFine().log("getBucket(%s)", bucketName);
checkArgument(!Strings.isNullOrEmpty(bucketName), "bucketName must not be null or empty");
Storage.Buckets.Get getBucket = configureRequest(gcs.buckets().get(bucketName), bucketName);
... | [
"private",
"Bucket",
"getBucket",
"(",
"String",
"bucketName",
")",
"throws",
"IOException",
"{",
"logger",
".",
"atFine",
"(",
")",
".",
"log",
"(",
"\"getBucket(%s)\"",
",",
"bucketName",
")",
";",
"checkArgument",
"(",
"!",
"Strings",
".",
"isNullOrEmpty",
... | Gets the bucket with the given name.
@param bucketName name of the bucket to get
@return the bucket with the given name or null if bucket not found
@throws IOException if the bucket exists but cannot be accessed | [
"Gets",
"the",
"bucket",
"with",
"the",
"given",
"name",
"."
] | 918d91c80a63e36046edb28972a5c65d3326a858 | https://github.com/GoogleCloudPlatform/bigdata-interop/blob/918d91c80a63e36046edb28972a5c65d3326a858/gcsio/src/main/java/com/google/cloud/hadoop/gcsio/GoogleCloudStorageImpl.java#L1789-L1803 |
112,966 | GoogleCloudPlatform/bigdata-interop | gcsio/src/main/java/com/google/cloud/hadoop/gcsio/GoogleCloudStorageImpl.java | GoogleCloudStorageImpl.getWriteGeneration | private long getWriteGeneration(StorageResourceId resourceId, boolean overwritable)
throws IOException {
logger.atFine().log("getWriteGeneration(%s, %s)", resourceId, overwritable);
GoogleCloudStorageItemInfo info = getItemInfo(resourceId);
if (!info.exists()) {
return 0L;
}
if (info.exi... | java | private long getWriteGeneration(StorageResourceId resourceId, boolean overwritable)
throws IOException {
logger.atFine().log("getWriteGeneration(%s, %s)", resourceId, overwritable);
GoogleCloudStorageItemInfo info = getItemInfo(resourceId);
if (!info.exists()) {
return 0L;
}
if (info.exi... | [
"private",
"long",
"getWriteGeneration",
"(",
"StorageResourceId",
"resourceId",
",",
"boolean",
"overwritable",
")",
"throws",
"IOException",
"{",
"logger",
".",
"atFine",
"(",
")",
".",
"log",
"(",
"\"getWriteGeneration(%s, %s)\"",
",",
"resourceId",
",",
"overwri... | Gets the object generation for a Write operation
@param resourceId object for which generation info is requested
@return the generation of the object
@throws IOException if the object already exists and cannot be overwritten | [
"Gets",
"the",
"object",
"generation",
"for",
"a",
"Write",
"operation"
] | 918d91c80a63e36046edb28972a5c65d3326a858 | https://github.com/GoogleCloudPlatform/bigdata-interop/blob/918d91c80a63e36046edb28972a5c65d3326a858/gcsio/src/main/java/com/google/cloud/hadoop/gcsio/GoogleCloudStorageImpl.java#L1812-L1825 |
112,967 | GoogleCloudPlatform/bigdata-interop | gcsio/src/main/java/com/google/cloud/hadoop/gcsio/GoogleCloudStorageImpl.java | GoogleCloudStorageImpl.getObject | private StorageObject getObject(StorageResourceId resourceId)
throws IOException {
logger.atFine().log("getObject(%s)", resourceId);
Preconditions.checkArgument(
resourceId.isStorageObject(), "Expected full StorageObject id, got %s", resourceId);
String bucketName = resourceId.getBucketName();... | java | private StorageObject getObject(StorageResourceId resourceId)
throws IOException {
logger.atFine().log("getObject(%s)", resourceId);
Preconditions.checkArgument(
resourceId.isStorageObject(), "Expected full StorageObject id, got %s", resourceId);
String bucketName = resourceId.getBucketName();... | [
"private",
"StorageObject",
"getObject",
"(",
"StorageResourceId",
"resourceId",
")",
"throws",
"IOException",
"{",
"logger",
".",
"atFine",
"(",
")",
".",
"log",
"(",
"\"getObject(%s)\"",
",",
"resourceId",
")",
";",
"Preconditions",
".",
"checkArgument",
"(",
... | Gets the object with the given resourceId.
@param resourceId identifies a StorageObject
@return the object with the given name or null if object not found
@throws IOException if the object exists but cannot be accessed | [
"Gets",
"the",
"object",
"with",
"the",
"given",
"resourceId",
"."
] | 918d91c80a63e36046edb28972a5c65d3326a858 | https://github.com/GoogleCloudPlatform/bigdata-interop/blob/918d91c80a63e36046edb28972a5c65d3326a858/gcsio/src/main/java/com/google/cloud/hadoop/gcsio/GoogleCloudStorageImpl.java#L1834-L1852 |
112,968 | GoogleCloudPlatform/bigdata-interop | util/src/main/java/com/google/cloud/hadoop/util/CredentialFactory.java | CredentialFactory.getStaticHttpTransport | private static synchronized HttpTransport getStaticHttpTransport()
throws IOException, GeneralSecurityException {
if (staticHttpTransport == null) {
staticHttpTransport = HttpTransportFactory.createHttpTransport(HttpTransportType.JAVA_NET);
}
return staticHttpTransport;
} | java | private static synchronized HttpTransport getStaticHttpTransport()
throws IOException, GeneralSecurityException {
if (staticHttpTransport == null) {
staticHttpTransport = HttpTransportFactory.createHttpTransport(HttpTransportType.JAVA_NET);
}
return staticHttpTransport;
} | [
"private",
"static",
"synchronized",
"HttpTransport",
"getStaticHttpTransport",
"(",
")",
"throws",
"IOException",
",",
"GeneralSecurityException",
"{",
"if",
"(",
"staticHttpTransport",
"==",
"null",
")",
"{",
"staticHttpTransport",
"=",
"HttpTransportFactory",
".",
"c... | Returns shared staticHttpTransport instance; initializes staticHttpTransport if it hasn't
already been initialized. | [
"Returns",
"shared",
"staticHttpTransport",
"instance",
";",
"initializes",
"staticHttpTransport",
"if",
"it",
"hasn",
"t",
"already",
"been",
"initialized",
"."
] | 918d91c80a63e36046edb28972a5c65d3326a858 | https://github.com/GoogleCloudPlatform/bigdata-interop/blob/918d91c80a63e36046edb28972a5c65d3326a858/util/src/main/java/com/google/cloud/hadoop/util/CredentialFactory.java#L208-L214 |
112,969 | GoogleCloudPlatform/bigdata-interop | util/src/main/java/com/google/cloud/hadoop/util/CredentialFactory.java | CredentialFactory.getCredentialFromJsonKeyFile | public Credential getCredentialFromJsonKeyFile(
String serviceAccountJsonKeyFile, List<String> scopes, HttpTransport transport)
throws IOException, GeneralSecurityException {
logger.atFine().log("getCredentialFromJsonKeyFile(%s, %s)", serviceAccountJsonKeyFile, scopes);
try (FileInputStream fis = n... | java | public Credential getCredentialFromJsonKeyFile(
String serviceAccountJsonKeyFile, List<String> scopes, HttpTransport transport)
throws IOException, GeneralSecurityException {
logger.atFine().log("getCredentialFromJsonKeyFile(%s, %s)", serviceAccountJsonKeyFile, scopes);
try (FileInputStream fis = n... | [
"public",
"Credential",
"getCredentialFromJsonKeyFile",
"(",
"String",
"serviceAccountJsonKeyFile",
",",
"List",
"<",
"String",
">",
"scopes",
",",
"HttpTransport",
"transport",
")",
"throws",
"IOException",
",",
"GeneralSecurityException",
"{",
"logger",
".",
"atFine",... | Get credentials listed in a JSON file.
@param serviceAccountJsonKeyFile A file path pointing to a JSON file containing credentials.
@param scopes The OAuth scopes that the credential should be valid for.
@param transport The HttpTransport used for authorization | [
"Get",
"credentials",
"listed",
"in",
"a",
"JSON",
"file",
"."
] | 918d91c80a63e36046edb28972a5c65d3326a858 | https://github.com/GoogleCloudPlatform/bigdata-interop/blob/918d91c80a63e36046edb28972a5c65d3326a858/util/src/main/java/com/google/cloud/hadoop/util/CredentialFactory.java#L275-L284 |
112,970 | GoogleCloudPlatform/bigdata-interop | bigquery/src/main/java/com/google/cloud/hadoop/io/bigquery/DynamicFileListRecordReader.java | DynamicFileListRecordReader.nextKeyValue | @Override
public boolean nextKeyValue()
throws IOException, InterruptedException {
currentValue = null;
// Check if we already have a reader in-progress.
if (delegateReader != null) {
if (delegateReader.nextKeyValue()) {
populateCurrentKeyValue();
return true;
} else {
... | java | @Override
public boolean nextKeyValue()
throws IOException, InterruptedException {
currentValue = null;
// Check if we already have a reader in-progress.
if (delegateReader != null) {
if (delegateReader.nextKeyValue()) {
populateCurrentKeyValue();
return true;
} else {
... | [
"@",
"Override",
"public",
"boolean",
"nextKeyValue",
"(",
")",
"throws",
"IOException",
",",
"InterruptedException",
"{",
"currentValue",
"=",
"null",
";",
"// Check if we already have a reader in-progress.",
"if",
"(",
"delegateReader",
"!=",
"null",
")",
"{",
"if",... | Reads the next key, value pair. Gets next line and parses Json object. May hang for a long
time waiting for more files to appear in this reader's directory.
@return true if a key/value pair was read.
@throws IOException on IO Error. | [
"Reads",
"the",
"next",
"key",
"value",
"pair",
".",
"Gets",
"next",
"line",
"and",
"parses",
"Json",
"object",
".",
"May",
"hang",
"for",
"a",
"long",
"time",
"waiting",
"for",
"more",
"files",
"to",
"appear",
"in",
"this",
"reader",
"s",
"directory",
... | 918d91c80a63e36046edb28972a5c65d3326a858 | https://github.com/GoogleCloudPlatform/bigdata-interop/blob/918d91c80a63e36046edb28972a5c65d3326a858/bigquery/src/main/java/com/google/cloud/hadoop/io/bigquery/DynamicFileListRecordReader.java#L145-L205 |
112,971 | GoogleCloudPlatform/bigdata-interop | bigquery/src/main/java/com/google/cloud/hadoop/io/bigquery/DynamicFileListRecordReader.java | DynamicFileListRecordReader.close | @Override
public void close()
throws IOException {
if (delegateReader != null) {
logger.atWarning().log(
"Got non-null delegateReader during close(); possible premature close() call.");
delegateReader.close();
delegateReader = null;
}
} | java | @Override
public void close()
throws IOException {
if (delegateReader != null) {
logger.atWarning().log(
"Got non-null delegateReader during close(); possible premature close() call.");
delegateReader.close();
delegateReader = null;
}
} | [
"@",
"Override",
"public",
"void",
"close",
"(",
")",
"throws",
"IOException",
"{",
"if",
"(",
"delegateReader",
"!=",
"null",
")",
"{",
"logger",
".",
"atWarning",
"(",
")",
".",
"log",
"(",
"\"Got non-null delegateReader during close(); possible premature close() ... | Closes the record reader.
@throws IOException on IO Error. | [
"Closes",
"the",
"record",
"reader",
"."
] | 918d91c80a63e36046edb28972a5c65d3326a858 | https://github.com/GoogleCloudPlatform/bigdata-interop/blob/918d91c80a63e36046edb28972a5c65d3326a858/bigquery/src/main/java/com/google/cloud/hadoop/io/bigquery/DynamicFileListRecordReader.java#L245-L254 |
112,972 | GoogleCloudPlatform/bigdata-interop | bigquery/src/main/java/com/google/cloud/hadoop/io/bigquery/DynamicFileListRecordReader.java | DynamicFileListRecordReader.setEndFileMarkerFile | private void setEndFileMarkerFile(String fileName) {
int fileIndex = parseFileIndex(fileName);
if (endFileNumber == -1) {
// First time finding the end-marker file.
endFileNumber = fileIndex;
logger.atInfo().log("Found end-marker file '%s' with index %s", fileName, endFileNumber);
// Sa... | java | private void setEndFileMarkerFile(String fileName) {
int fileIndex = parseFileIndex(fileName);
if (endFileNumber == -1) {
// First time finding the end-marker file.
endFileNumber = fileIndex;
logger.atInfo().log("Found end-marker file '%s' with index %s", fileName, endFileNumber);
// Sa... | [
"private",
"void",
"setEndFileMarkerFile",
"(",
"String",
"fileName",
")",
"{",
"int",
"fileIndex",
"=",
"parseFileIndex",
"(",
"fileName",
")",
";",
"if",
"(",
"endFileNumber",
"==",
"-",
"1",
")",
"{",
"// First time finding the end-marker file.",
"endFileNumber",... | Record a specific file as being the 0-record end of stream marker. | [
"Record",
"a",
"specific",
"file",
"as",
"being",
"the",
"0",
"-",
"record",
"end",
"of",
"stream",
"marker",
"."
] | 918d91c80a63e36046edb28972a5c65d3326a858 | https://github.com/GoogleCloudPlatform/bigdata-interop/blob/918d91c80a63e36046edb28972a5c65d3326a858/bigquery/src/main/java/com/google/cloud/hadoop/io/bigquery/DynamicFileListRecordReader.java#L331-L353 |
112,973 | GoogleCloudPlatform/bigdata-interop | bigquery/src/main/java/com/google/cloud/hadoop/io/bigquery/DynamicFileListRecordReader.java | DynamicFileListRecordReader.refreshFileList | private void refreshFileList()
throws IOException {
FileStatus[] files = fileSystem.globStatus(inputDirectoryAndPattern);
for (FileStatus file : files) {
String fileName = file.getPath().getName();
if (!knownFileSet.contains(fileName)) {
if (endFileNumber != -1) {
// Sanity c... | java | private void refreshFileList()
throws IOException {
FileStatus[] files = fileSystem.globStatus(inputDirectoryAndPattern);
for (FileStatus file : files) {
String fileName = file.getPath().getName();
if (!knownFileSet.contains(fileName)) {
if (endFileNumber != -1) {
// Sanity c... | [
"private",
"void",
"refreshFileList",
"(",
")",
"throws",
"IOException",
"{",
"FileStatus",
"[",
"]",
"files",
"=",
"fileSystem",
".",
"globStatus",
"(",
"inputDirectoryAndPattern",
")",
";",
"for",
"(",
"FileStatus",
"file",
":",
"files",
")",
"{",
"String",
... | Lists files, and sifts through the results for any new files we haven't found before.
If a file of size 0 is found, we mark the 'endFileNumber' from it. | [
"Lists",
"files",
"and",
"sifts",
"through",
"the",
"results",
"for",
"any",
"new",
"files",
"we",
"haven",
"t",
"found",
"before",
".",
"If",
"a",
"file",
"of",
"size",
"0",
"is",
"found",
"we",
"mark",
"the",
"endFileNumber",
"from",
"it",
"."
] | 918d91c80a63e36046edb28972a5c65d3326a858 | https://github.com/GoogleCloudPlatform/bigdata-interop/blob/918d91c80a63e36046edb28972a5c65d3326a858/bigquery/src/main/java/com/google/cloud/hadoop/io/bigquery/DynamicFileListRecordReader.java#L359-L379 |
112,974 | GoogleCloudPlatform/bigdata-interop | gcs/src/main/java/com/google/cloud/hadoop/fs/gcs/auth/GcsDelegationTokens.java | GcsDelegationTokens.bindToAnyDelegationToken | public void bindToAnyDelegationToken() throws IOException {
validateAccessTokenProvider();
Token<DelegationTokenIdentifier> token = selectTokenFromFsOwner();
if (token != null) {
bindToDelegationToken(token);
} else {
deployUnbonded();
}
if (accessTokenProvider == null) {
throw... | java | public void bindToAnyDelegationToken() throws IOException {
validateAccessTokenProvider();
Token<DelegationTokenIdentifier> token = selectTokenFromFsOwner();
if (token != null) {
bindToDelegationToken(token);
} else {
deployUnbonded();
}
if (accessTokenProvider == null) {
throw... | [
"public",
"void",
"bindToAnyDelegationToken",
"(",
")",
"throws",
"IOException",
"{",
"validateAccessTokenProvider",
"(",
")",
";",
"Token",
"<",
"DelegationTokenIdentifier",
">",
"token",
"=",
"selectTokenFromFsOwner",
"(",
")",
";",
"if",
"(",
"token",
"!=",
"nu... | Attempt to bind to any existing DT, including unmarshalling its contents and creating the GCP
credential provider used to authenticate the client.
<p>If successful:
<ol>
<li>{@link #boundDT} is set to the retrieved token.
<li>{@link #accessTokenProvider} is set to the credential provider(s) returned by the token
bind... | [
"Attempt",
"to",
"bind",
"to",
"any",
"existing",
"DT",
"including",
"unmarshalling",
"its",
"contents",
"and",
"creating",
"the",
"GCP",
"credential",
"provider",
"used",
"to",
"authenticate",
"the",
"client",
"."
] | 918d91c80a63e36046edb28972a5c65d3326a858 | https://github.com/GoogleCloudPlatform/bigdata-interop/blob/918d91c80a63e36046edb28972a5c65d3326a858/gcs/src/main/java/com/google/cloud/hadoop/fs/gcs/auth/GcsDelegationTokens.java#L123-L135 |
112,975 | GoogleCloudPlatform/bigdata-interop | gcs/src/main/java/com/google/cloud/hadoop/fs/gcs/auth/GcsDelegationTokens.java | GcsDelegationTokens.selectTokenFromFsOwner | public Token<DelegationTokenIdentifier> selectTokenFromFsOwner() throws IOException {
return lookupToken(user.getCredentials(), service, tokenBinding.getKind());
} | java | public Token<DelegationTokenIdentifier> selectTokenFromFsOwner() throws IOException {
return lookupToken(user.getCredentials(), service, tokenBinding.getKind());
} | [
"public",
"Token",
"<",
"DelegationTokenIdentifier",
">",
"selectTokenFromFsOwner",
"(",
")",
"throws",
"IOException",
"{",
"return",
"lookupToken",
"(",
"user",
".",
"getCredentials",
"(",
")",
",",
"service",
",",
"tokenBinding",
".",
"getKind",
"(",
")",
")",... | Find a token for the FS user and service name.
@return the token, or null if one cannot be found.
@throws IOException on a failure to unmarshall the token. | [
"Find",
"a",
"token",
"for",
"the",
"FS",
"user",
"and",
"service",
"name",
"."
] | 918d91c80a63e36046edb28972a5c65d3326a858 | https://github.com/GoogleCloudPlatform/bigdata-interop/blob/918d91c80a63e36046edb28972a5c65d3326a858/gcs/src/main/java/com/google/cloud/hadoop/fs/gcs/auth/GcsDelegationTokens.java#L143-L145 |
112,976 | GoogleCloudPlatform/bigdata-interop | gcs/src/main/java/com/google/cloud/hadoop/fs/gcs/auth/GcsDelegationTokens.java | GcsDelegationTokens.bindToDelegationToken | public void bindToDelegationToken(Token<DelegationTokenIdentifier> token) throws IOException {
validateAccessTokenProvider();
boundDT = token;
DelegationTokenIdentifier dti = extractIdentifier(token);
logger.atInfo().log("Using delegation token %s", dti);
// extract the credential providers.
acc... | java | public void bindToDelegationToken(Token<DelegationTokenIdentifier> token) throws IOException {
validateAccessTokenProvider();
boundDT = token;
DelegationTokenIdentifier dti = extractIdentifier(token);
logger.atInfo().log("Using delegation token %s", dti);
// extract the credential providers.
acc... | [
"public",
"void",
"bindToDelegationToken",
"(",
"Token",
"<",
"DelegationTokenIdentifier",
">",
"token",
")",
"throws",
"IOException",
"{",
"validateAccessTokenProvider",
"(",
")",
";",
"boundDT",
"=",
"token",
";",
"DelegationTokenIdentifier",
"dti",
"=",
"extractIde... | Bind to a delegation token retrieved for this filesystem. Extract the secrets from the token
and set internal fields to the values.
<ol>
<li>{@link #boundDT} is set to {@code token}.
<li>{@link #accessTokenProvider} is set to the credential provider(s) returned by the token
binding.
</ol>
@param token token to decode... | [
"Bind",
"to",
"a",
"delegation",
"token",
"retrieved",
"for",
"this",
"filesystem",
".",
"Extract",
"the",
"secrets",
"from",
"the",
"token",
"and",
"set",
"internal",
"fields",
"to",
"the",
"values",
"."
] | 918d91c80a63e36046edb28972a5c65d3326a858 | https://github.com/GoogleCloudPlatform/bigdata-interop/blob/918d91c80a63e36046edb28972a5c65d3326a858/gcs/src/main/java/com/google/cloud/hadoop/fs/gcs/auth/GcsDelegationTokens.java#L176-L183 |
112,977 | GoogleCloudPlatform/bigdata-interop | gcs/src/main/java/com/google/cloud/hadoop/fs/gcs/auth/GcsDelegationTokens.java | GcsDelegationTokens.getBoundOrNewDT | @SuppressWarnings("OptionalGetWithoutIsPresent")
public Token<DelegationTokenIdentifier> getBoundOrNewDT(String renewer) throws IOException {
logger.atFine().log("Delegation token requested");
if (isBoundToDT()) {
// the FS was created on startup with a token, so return it.
logger.atFine().log("Re... | java | @SuppressWarnings("OptionalGetWithoutIsPresent")
public Token<DelegationTokenIdentifier> getBoundOrNewDT(String renewer) throws IOException {
logger.atFine().log("Delegation token requested");
if (isBoundToDT()) {
// the FS was created on startup with a token, so return it.
logger.atFine().log("Re... | [
"@",
"SuppressWarnings",
"(",
"\"OptionalGetWithoutIsPresent\"",
")",
"public",
"Token",
"<",
"DelegationTokenIdentifier",
">",
"getBoundOrNewDT",
"(",
"String",
"renewer",
")",
"throws",
"IOException",
"{",
"logger",
".",
"atFine",
"(",
")",
".",
"log",
"(",
"\"D... | Get any bound DT or create a new one.
@return a delegation token.
@throws IOException if one cannot be created | [
"Get",
"any",
"bound",
"DT",
"or",
"create",
"a",
"new",
"one",
"."
] | 918d91c80a63e36046edb28972a5c65d3326a858 | https://github.com/GoogleCloudPlatform/bigdata-interop/blob/918d91c80a63e36046edb28972a5c65d3326a858/gcs/src/main/java/com/google/cloud/hadoop/fs/gcs/auth/GcsDelegationTokens.java#L209-L222 |
112,978 | GoogleCloudPlatform/bigdata-interop | gcs/src/main/java/com/google/cloud/hadoop/fs/gcs/auth/GcsDelegationTokens.java | GcsDelegationTokens.extractIdentifier | public static DelegationTokenIdentifier extractIdentifier(
final Token<? extends DelegationTokenIdentifier> token) throws IOException {
checkArgument(token != null, "null token");
DelegationTokenIdentifier identifier;
// harden up decode beyond what Token does itself
try {
identifier = token... | java | public static DelegationTokenIdentifier extractIdentifier(
final Token<? extends DelegationTokenIdentifier> token) throws IOException {
checkArgument(token != null, "null token");
DelegationTokenIdentifier identifier;
// harden up decode beyond what Token does itself
try {
identifier = token... | [
"public",
"static",
"DelegationTokenIdentifier",
"extractIdentifier",
"(",
"final",
"Token",
"<",
"?",
"extends",
"DelegationTokenIdentifier",
">",
"token",
")",
"throws",
"IOException",
"{",
"checkArgument",
"(",
"token",
"!=",
"null",
",",
"\"null token\"",
")",
"... | From a token, get the session token identifier.
@param token token to process
@return the session token identifier
@throws IOException failure to validate/read data encoded in identifier.
@throws IllegalArgumentException if the token isn't an GCP session token | [
"From",
"a",
"token",
"get",
"the",
"session",
"token",
"identifier",
"."
] | 918d91c80a63e36046edb28972a5c65d3326a858 | https://github.com/GoogleCloudPlatform/bigdata-interop/blob/918d91c80a63e36046edb28972a5c65d3326a858/gcs/src/main/java/com/google/cloud/hadoop/fs/gcs/auth/GcsDelegationTokens.java#L232-L251 |
112,979 | GoogleCloudPlatform/bigdata-interop | gcs/src/main/java/com/google/cloud/hadoop/fs/gcs/auth/GcsDelegationTokens.java | GcsDelegationTokens.lookupToken | @SuppressWarnings("unchecked") // safe by contract of lookupToken()
private static Token<DelegationTokenIdentifier> lookupToken(
Credentials credentials, Text service, Text kind) throws DelegationTokenIOException {
logger.atFine().log("Looking for token for service %s in credentials", service);
Token<?>... | java | @SuppressWarnings("unchecked") // safe by contract of lookupToken()
private static Token<DelegationTokenIdentifier> lookupToken(
Credentials credentials, Text service, Text kind) throws DelegationTokenIOException {
logger.atFine().log("Looking for token for service %s in credentials", service);
Token<?>... | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"// safe by contract of lookupToken()",
"private",
"static",
"Token",
"<",
"DelegationTokenIdentifier",
">",
"lookupToken",
"(",
"Credentials",
"credentials",
",",
"Text",
"service",
",",
"Text",
"kind",
")",
"throws",... | Look up a token from the credentials, verify it is of the correct kind.
@param credentials credentials to look up.
@param service service name
@param kind token kind to look for
@return the token or null if no suitable token was found
@throws DelegationTokenIOException wrong token kind found | [
"Look",
"up",
"a",
"token",
"from",
"the",
"credentials",
"verify",
"it",
"is",
"of",
"the",
"correct",
"kind",
"."
] | 918d91c80a63e36046edb28972a5c65d3326a858 | https://github.com/GoogleCloudPlatform/bigdata-interop/blob/918d91c80a63e36046edb28972a5c65d3326a858/gcs/src/main/java/com/google/cloud/hadoop/fs/gcs/auth/GcsDelegationTokens.java#L262-L281 |
112,980 | GoogleCloudPlatform/bigdata-interop | util-hadoop/src/main/java/com/google/cloud/hadoop/util/ConfigurationUtil.java | ConfigurationUtil.getMandatoryConfig | public static String getMandatoryConfig(Configuration config, String key)
throws IOException {
String value = config.get(key);
if (Strings.isNullOrEmpty(value)) {
throw new IOException("Must supply a value for configuration setting: " + key);
}
return value;
} | java | public static String getMandatoryConfig(Configuration config, String key)
throws IOException {
String value = config.get(key);
if (Strings.isNullOrEmpty(value)) {
throw new IOException("Must supply a value for configuration setting: " + key);
}
return value;
} | [
"public",
"static",
"String",
"getMandatoryConfig",
"(",
"Configuration",
"config",
",",
"String",
"key",
")",
"throws",
"IOException",
"{",
"String",
"value",
"=",
"config",
".",
"get",
"(",
"key",
")",
";",
"if",
"(",
"Strings",
".",
"isNullOrEmpty",
"(",
... | Gets value for the given key or throws if value is not found. | [
"Gets",
"value",
"for",
"the",
"given",
"key",
"or",
"throws",
"if",
"value",
"is",
"not",
"found",
"."
] | 918d91c80a63e36046edb28972a5c65d3326a858 | https://github.com/GoogleCloudPlatform/bigdata-interop/blob/918d91c80a63e36046edb28972a5c65d3326a858/util-hadoop/src/main/java/com/google/cloud/hadoop/util/ConfigurationUtil.java#L35-L42 |
112,981 | GoogleCloudPlatform/bigdata-interop | util-hadoop/src/main/java/com/google/cloud/hadoop/util/ConfigurationUtil.java | ConfigurationUtil.getMandatoryConfig | public static Map<String, String> getMandatoryConfig(
Configuration config, List<String> keys)
throws IOException {
List<String> missingKeys = new ArrayList<>();
Map<String, String> values = new HashMap<>();
for (String key : keys) {
String value = config.get(key);
if (Strings.isNull... | java | public static Map<String, String> getMandatoryConfig(
Configuration config, List<String> keys)
throws IOException {
List<String> missingKeys = new ArrayList<>();
Map<String, String> values = new HashMap<>();
for (String key : keys) {
String value = config.get(key);
if (Strings.isNull... | [
"public",
"static",
"Map",
"<",
"String",
",",
"String",
">",
"getMandatoryConfig",
"(",
"Configuration",
"config",
",",
"List",
"<",
"String",
">",
"keys",
")",
"throws",
"IOException",
"{",
"List",
"<",
"String",
">",
"missingKeys",
"=",
"new",
"ArrayList"... | Gets value for the given keys or throws if one or more values are not found. | [
"Gets",
"value",
"for",
"the",
"given",
"keys",
"or",
"throws",
"if",
"one",
"or",
"more",
"values",
"are",
"not",
"found",
"."
] | 918d91c80a63e36046edb28972a5c65d3326a858 | https://github.com/GoogleCloudPlatform/bigdata-interop/blob/918d91c80a63e36046edb28972a5c65d3326a858/util-hadoop/src/main/java/com/google/cloud/hadoop/util/ConfigurationUtil.java#L47-L66 |
112,982 | GoogleCloudPlatform/bigdata-interop | util/src/main/java/com/google/cloud/hadoop/util/AbstractGoogleAsyncWriteChannel.java | AbstractGoogleAsyncWriteChannel.setUploadChunkSize | public void setUploadChunkSize(int chunkSize) {
Preconditions.checkArgument(chunkSize > 0, "Upload chunk size must be great than 0.");
Preconditions.checkArgument(
chunkSize % MediaHttpUploader.MINIMUM_CHUNK_SIZE == 0,
"Upload chunk size must be a multiple of MediaHttpUploader.MINIMUM_CHUNK_SIZE... | java | public void setUploadChunkSize(int chunkSize) {
Preconditions.checkArgument(chunkSize > 0, "Upload chunk size must be great than 0.");
Preconditions.checkArgument(
chunkSize % MediaHttpUploader.MINIMUM_CHUNK_SIZE == 0,
"Upload chunk size must be a multiple of MediaHttpUploader.MINIMUM_CHUNK_SIZE... | [
"public",
"void",
"setUploadChunkSize",
"(",
"int",
"chunkSize",
")",
"{",
"Preconditions",
".",
"checkArgument",
"(",
"chunkSize",
">",
"0",
",",
"\"Upload chunk size must be great than 0.\"",
")",
";",
"Preconditions",
".",
"checkArgument",
"(",
"chunkSize",
"%",
... | Sets size of upload buffer used. | [
"Sets",
"size",
"of",
"upload",
"buffer",
"used",
"."
] | 918d91c80a63e36046edb28972a5c65d3326a858 | https://github.com/GoogleCloudPlatform/bigdata-interop/blob/918d91c80a63e36046edb28972a5c65d3326a858/util/src/main/java/com/google/cloud/hadoop/util/AbstractGoogleAsyncWriteChannel.java#L141-L152 |
112,983 | GoogleCloudPlatform/bigdata-interop | util/src/main/java/com/google/cloud/hadoop/util/AbstractGoogleAsyncWriteChannel.java | AbstractGoogleAsyncWriteChannel.write | @Override
public synchronized int write(ByteBuffer buffer) throws IOException {
checkState(isInitialized, "initialize() must be invoked before use.");
if (!isOpen()) {
throw new ClosedChannelException();
}
// No point in writing further if upload failed on another thread.
if (uploadOperatio... | java | @Override
public synchronized int write(ByteBuffer buffer) throws IOException {
checkState(isInitialized, "initialize() must be invoked before use.");
if (!isOpen()) {
throw new ClosedChannelException();
}
// No point in writing further if upload failed on another thread.
if (uploadOperatio... | [
"@",
"Override",
"public",
"synchronized",
"int",
"write",
"(",
"ByteBuffer",
"buffer",
")",
"throws",
"IOException",
"{",
"checkState",
"(",
"isInitialized",
",",
"\"initialize() must be invoked before use.\"",
")",
";",
"if",
"(",
"!",
"isOpen",
"(",
")",
")",
... | Writes contents of the given buffer to this channel.
<p>Note: The data that one writes gets written to a pipe which must not block if the pipe has
sufficient buffer space. A success code returned from this method does not mean that the
specific data was successfully written to the underlying storage. It simply means t... | [
"Writes",
"contents",
"of",
"the",
"given",
"buffer",
"to",
"this",
"channel",
"."
] | 918d91c80a63e36046edb28972a5c65d3326a858 | https://github.com/GoogleCloudPlatform/bigdata-interop/blob/918d91c80a63e36046edb28972a5c65d3326a858/util/src/main/java/com/google/cloud/hadoop/util/AbstractGoogleAsyncWriteChannel.java#L181-L194 |
112,984 | GoogleCloudPlatform/bigdata-interop | util/src/main/java/com/google/cloud/hadoop/util/AbstractGoogleAsyncWriteChannel.java | AbstractGoogleAsyncWriteChannel.initialize | public void initialize() throws IOException {
// Create a pipe such that its one end is connected to the input stream used by
// the uploader and the other end is the write channel used by the caller.
PipedInputStream pipeSource = new PipedInputStream(pipeBufferSize);
OutputStream pipeSink = new PipedOu... | java | public void initialize() throws IOException {
// Create a pipe such that its one end is connected to the input stream used by
// the uploader and the other end is the write channel used by the caller.
PipedInputStream pipeSource = new PipedInputStream(pipeBufferSize);
OutputStream pipeSink = new PipedOu... | [
"public",
"void",
"initialize",
"(",
")",
"throws",
"IOException",
"{",
"// Create a pipe such that its one end is connected to the input stream used by",
"// the uploader and the other end is the write channel used by the caller.",
"PipedInputStream",
"pipeSource",
"=",
"new",
"PipedInp... | Initialize this channel object for writing.
@throws IOException | [
"Initialize",
"this",
"channel",
"object",
"for",
"writing",
"."
] | 918d91c80a63e36046edb28972a5c65d3326a858 | https://github.com/GoogleCloudPlatform/bigdata-interop/blob/918d91c80a63e36046edb28972a5c65d3326a858/util/src/main/java/com/google/cloud/hadoop/util/AbstractGoogleAsyncWriteChannel.java#L233-L257 |
112,985 | GoogleCloudPlatform/bigdata-interop | util/src/main/java/com/google/cloud/hadoop/util/AbstractGoogleAsyncWriteChannel.java | AbstractGoogleAsyncWriteChannel.waitForCompletionAndThrowIfUploadFailed | private S waitForCompletionAndThrowIfUploadFailed() throws IOException {
try {
return uploadOperation.get();
} catch (InterruptedException e) {
// If we were interrupted, we need to cancel the upload operation.
uploadOperation.cancel(true);
IOException exception = new ClosedByInterruptEx... | java | private S waitForCompletionAndThrowIfUploadFailed() throws IOException {
try {
return uploadOperation.get();
} catch (InterruptedException e) {
// If we were interrupted, we need to cancel the upload operation.
uploadOperation.cancel(true);
IOException exception = new ClosedByInterruptEx... | [
"private",
"S",
"waitForCompletionAndThrowIfUploadFailed",
"(",
")",
"throws",
"IOException",
"{",
"try",
"{",
"return",
"uploadOperation",
".",
"get",
"(",
")",
";",
"}",
"catch",
"(",
"InterruptedException",
"e",
")",
"{",
"// If we were interrupted, we need to canc... | Throws if upload operation failed. Propagates any errors.
@throws IOException on IO error | [
"Throws",
"if",
"upload",
"operation",
"failed",
".",
"Propagates",
"any",
"errors",
"."
] | 918d91c80a63e36046edb28972a5c65d3326a858 | https://github.com/GoogleCloudPlatform/bigdata-interop/blob/918d91c80a63e36046edb28972a5c65d3326a858/util/src/main/java/com/google/cloud/hadoop/util/AbstractGoogleAsyncWriteChannel.java#L300-L315 |
112,986 | GoogleCloudPlatform/bigdata-interop | gcsio/src/main/java/com/google/cloud/hadoop/gcsio/GoogleCloudStorageExceptions.java | GoogleCloudStorageExceptions.getFileNotFoundException | public static FileNotFoundException getFileNotFoundException(
String bucketName, String objectName) {
checkArgument(!isNullOrEmpty(bucketName), "bucketName must not be null or empty");
return new FileNotFoundException(
String.format(
"Item not found: '%s'."
+ " If you e... | java | public static FileNotFoundException getFileNotFoundException(
String bucketName, String objectName) {
checkArgument(!isNullOrEmpty(bucketName), "bucketName must not be null or empty");
return new FileNotFoundException(
String.format(
"Item not found: '%s'."
+ " If you e... | [
"public",
"static",
"FileNotFoundException",
"getFileNotFoundException",
"(",
"String",
"bucketName",
",",
"String",
"objectName",
")",
"{",
"checkArgument",
"(",
"!",
"isNullOrEmpty",
"(",
"bucketName",
")",
",",
"\"bucketName must not be null or empty\"",
")",
";",
"r... | Creates FileNotFoundException with suitable message for a GCS bucket or object. | [
"Creates",
"FileNotFoundException",
"with",
"suitable",
"message",
"for",
"a",
"GCS",
"bucket",
"or",
"object",
"."
] | 918d91c80a63e36046edb28972a5c65d3326a858 | https://github.com/GoogleCloudPlatform/bigdata-interop/blob/918d91c80a63e36046edb28972a5c65d3326a858/gcsio/src/main/java/com/google/cloud/hadoop/gcsio/GoogleCloudStorageExceptions.java#L34-L43 |
112,987 | GoogleCloudPlatform/bigdata-interop | util/src/main/java/com/google/cloud/hadoop/util/ResilientOperation.java | ResilientOperation.retry | @SuppressWarnings("unchecked")
public static <T, X extends Exception> T retry(
CheckedCallable<T, X> callable,
BackOff backoff,
RetryDeterminer<? super X> retryDet,
Class<X> classType,
Sleeper sleeper)
throws X, InterruptedException {
checkNotNull(backoff, "Must provide a non-n... | java | @SuppressWarnings("unchecked")
public static <T, X extends Exception> T retry(
CheckedCallable<T, X> callable,
BackOff backoff,
RetryDeterminer<? super X> retryDet,
Class<X> classType,
Sleeper sleeper)
throws X, InterruptedException {
checkNotNull(backoff, "Must provide a non-n... | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"public",
"static",
"<",
"T",
",",
"X",
"extends",
"Exception",
">",
"T",
"retry",
"(",
"CheckedCallable",
"<",
"T",
",",
"X",
">",
"callable",
",",
"BackOff",
"backoff",
",",
"RetryDeterminer",
"<",
"?",... | Retries the given executable function in the case of transient errors defined by the
RetryDeterminer.
<p>Does not support unchecked exceptions that are not instances of RuntimeException.
@param callable CheckedCallable to retry execution of
@param backoff BackOff to determine how long to sleep for
@param retryDet Ret... | [
"Retries",
"the",
"given",
"executable",
"function",
"in",
"the",
"case",
"of",
"transient",
"errors",
"defined",
"by",
"the",
"RetryDeterminer",
"."
] | 918d91c80a63e36046edb28972a5c65d3326a858 | https://github.com/GoogleCloudPlatform/bigdata-interop/blob/918d91c80a63e36046edb28972a5c65d3326a858/util/src/main/java/com/google/cloud/hadoop/util/ResilientOperation.java#L51-L85 |
112,988 | GoogleCloudPlatform/bigdata-interop | util/src/main/java/com/google/cloud/hadoop/util/ResilientOperation.java | ResilientOperation.retry | public static <T, X extends Exception> T retry(
CheckedCallable<T, X> callable,
BackOff backoff,
RetryDeterminer<? super X> retryDet,
Class<X> classType)
throws X, InterruptedException {
return retry(callable, backoff, retryDet, classType, Sleeper.DEFAULT);
} | java | public static <T, X extends Exception> T retry(
CheckedCallable<T, X> callable,
BackOff backoff,
RetryDeterminer<? super X> retryDet,
Class<X> classType)
throws X, InterruptedException {
return retry(callable, backoff, retryDet, classType, Sleeper.DEFAULT);
} | [
"public",
"static",
"<",
"T",
",",
"X",
"extends",
"Exception",
">",
"T",
"retry",
"(",
"CheckedCallable",
"<",
"T",
",",
"X",
">",
"callable",
",",
"BackOff",
"backoff",
",",
"RetryDeterminer",
"<",
"?",
"super",
"X",
">",
"retryDet",
",",
"Class",
"<... | Retries the given executable function in the case of transient errors defined by the
RetryDeterminer and uses default sleeper.
@param callable CheckedCallable to retry execution of
@param backoff BackOff to determine how long to sleep for
@param retryDet RetryDeterminer to determine when to retry
@param classType clas... | [
"Retries",
"the",
"given",
"executable",
"function",
"in",
"the",
"case",
"of",
"transient",
"errors",
"defined",
"by",
"the",
"RetryDeterminer",
"and",
"uses",
"default",
"sleeper",
"."
] | 918d91c80a63e36046edb28972a5c65d3326a858 | https://github.com/GoogleCloudPlatform/bigdata-interop/blob/918d91c80a63e36046edb28972a5c65d3326a858/util/src/main/java/com/google/cloud/hadoop/util/ResilientOperation.java#L100-L107 |
112,989 | GoogleCloudPlatform/bigdata-interop | util/src/main/java/com/google/cloud/hadoop/util/ResilientOperation.java | ResilientOperation.nextSleep | private static boolean nextSleep(BackOff backoff, Sleeper sleeper, Exception currentException)
throws InterruptedException {
long backOffTime;
try {
backOffTime = backoff.nextBackOffMillis();
} catch (IOException e) {
throw new RuntimeException("Failed to to get next back off time", e);
... | java | private static boolean nextSleep(BackOff backoff, Sleeper sleeper, Exception currentException)
throws InterruptedException {
long backOffTime;
try {
backOffTime = backoff.nextBackOffMillis();
} catch (IOException e) {
throw new RuntimeException("Failed to to get next back off time", e);
... | [
"private",
"static",
"boolean",
"nextSleep",
"(",
"BackOff",
"backoff",
",",
"Sleeper",
"sleeper",
",",
"Exception",
"currentException",
")",
"throws",
"InterruptedException",
"{",
"long",
"backOffTime",
";",
"try",
"{",
"backOffTime",
"=",
"backoff",
".",
"nextBa... | Determines the amount to sleep for and sleeps if needed.
@param backoff BackOff to determine how long to sleep for
@param sleeper Used to sleep
@param currentException exception that caused the retry and sleep. For logging.
@throws InterruptedException if sleep is interrupted | [
"Determines",
"the",
"amount",
"to",
"sleep",
"for",
"and",
"sleeps",
"if",
"needed",
"."
] | 918d91c80a63e36046edb28972a5c65d3326a858 | https://github.com/GoogleCloudPlatform/bigdata-interop/blob/918d91c80a63e36046edb28972a5c65d3326a858/util/src/main/java/com/google/cloud/hadoop/util/ResilientOperation.java#L117-L132 |
112,990 | GoogleCloudPlatform/bigdata-interop | gcsio/src/main/java/com/google/cloud/hadoop/gcsio/StorageResourceId.java | StorageResourceId.objectHasDirectoryPath | static boolean objectHasDirectoryPath(String objectName) {
return !Strings.isNullOrEmpty(objectName)
&& objectName.endsWith(GoogleCloudStorage.PATH_DELIMITER);
} | java | static boolean objectHasDirectoryPath(String objectName) {
return !Strings.isNullOrEmpty(objectName)
&& objectName.endsWith(GoogleCloudStorage.PATH_DELIMITER);
} | [
"static",
"boolean",
"objectHasDirectoryPath",
"(",
"String",
"objectName",
")",
"{",
"return",
"!",
"Strings",
".",
"isNullOrEmpty",
"(",
"objectName",
")",
"&&",
"objectName",
".",
"endsWith",
"(",
"GoogleCloudStorage",
".",
"PATH_DELIMITER",
")",
";",
"}"
] | Indicates whether the given object name looks like a directory path.
@param objectName Name of the object to inspect.
@return Whether the given object name looks like a directory path. | [
"Indicates",
"whether",
"the",
"given",
"object",
"name",
"looks",
"like",
"a",
"directory",
"path",
"."
] | 918d91c80a63e36046edb28972a5c65d3326a858 | https://github.com/GoogleCloudPlatform/bigdata-interop/blob/918d91c80a63e36046edb28972a5c65d3326a858/gcsio/src/main/java/com/google/cloud/hadoop/gcsio/StorageResourceId.java#L246-L249 |
112,991 | GoogleCloudPlatform/bigdata-interop | gcsio/src/main/java/com/google/cloud/hadoop/gcsio/BatchHelper.java | BatchHelper.flushIfPossible | private void flushIfPossible(boolean flushAll) throws IOException {
if (flushAll) {
flushLock.lock();
} else if (pendingRequests.isEmpty() || !flushLock.tryLock()) {
return;
}
try {
do {
flushPendingRequests();
if (flushAll) {
awaitRequestsCompletion();
... | java | private void flushIfPossible(boolean flushAll) throws IOException {
if (flushAll) {
flushLock.lock();
} else if (pendingRequests.isEmpty() || !flushLock.tryLock()) {
return;
}
try {
do {
flushPendingRequests();
if (flushAll) {
awaitRequestsCompletion();
... | [
"private",
"void",
"flushIfPossible",
"(",
"boolean",
"flushAll",
")",
"throws",
"IOException",
"{",
"if",
"(",
"flushAll",
")",
"{",
"flushLock",
".",
"lock",
"(",
")",
";",
"}",
"else",
"if",
"(",
"pendingRequests",
".",
"isEmpty",
"(",
")",
"||",
"!",... | Flush our buffer if we are not already in a flush operation and we have data to flush. | [
"Flush",
"our",
"buffer",
"if",
"we",
"are",
"not",
"already",
"in",
"a",
"flush",
"operation",
"and",
"we",
"have",
"data",
"to",
"flush",
"."
] | 918d91c80a63e36046edb28972a5c65d3326a858 | https://github.com/GoogleCloudPlatform/bigdata-interop/blob/918d91c80a63e36046edb28972a5c65d3326a858/gcsio/src/main/java/com/google/cloud/hadoop/gcsio/BatchHelper.java#L194-L210 |
112,992 | GoogleCloudPlatform/bigdata-interop | gcsio/src/main/java/com/google/cloud/hadoop/gcsio/BatchHelper.java | BatchHelper.flush | public void flush() throws IOException {
try {
flushIfPossible(true);
checkState(pendingRequests.isEmpty(), "pendingRequests should be empty after flush");
checkState(responseFutures.isEmpty(), "responseFutures should be empty after flush");
} finally {
requestsExecutor.shutdown();
... | java | public void flush() throws IOException {
try {
flushIfPossible(true);
checkState(pendingRequests.isEmpty(), "pendingRequests should be empty after flush");
checkState(responseFutures.isEmpty(), "responseFutures should be empty after flush");
} finally {
requestsExecutor.shutdown();
... | [
"public",
"void",
"flush",
"(",
")",
"throws",
"IOException",
"{",
"try",
"{",
"flushIfPossible",
"(",
"true",
")",
";",
"checkState",
"(",
"pendingRequests",
".",
"isEmpty",
"(",
")",
",",
"\"pendingRequests should be empty after flush\"",
")",
";",
"checkState",... | Sends any currently remaining requests in the batch; should be called at the end of any series
of batched requests to ensure everything has been sent. | [
"Sends",
"any",
"currently",
"remaining",
"requests",
"in",
"the",
"batch",
";",
"should",
"be",
"called",
"at",
"the",
"end",
"of",
"any",
"series",
"of",
"batched",
"requests",
"to",
"ensure",
"everything",
"has",
"been",
"sent",
"."
] | 918d91c80a63e36046edb28972a5c65d3326a858 | https://github.com/GoogleCloudPlatform/bigdata-interop/blob/918d91c80a63e36046edb28972a5c65d3326a858/gcsio/src/main/java/com/google/cloud/hadoop/gcsio/BatchHelper.java#L233-L251 |
112,993 | GoogleCloudPlatform/bigdata-interop | gcsio/src/main/java/com/google/cloud/hadoop/gcsio/BatchHelper.java | BatchHelper.awaitRequestsCompletion | private void awaitRequestsCompletion() throws IOException {
// Don't wait until all requests will be completed if enough requests are pending for full batch
while (!responseFutures.isEmpty() && pendingRequests.size() < maxRequestsPerBatch) {
try {
responseFutures.remove().get();
} catch (Int... | java | private void awaitRequestsCompletion() throws IOException {
// Don't wait until all requests will be completed if enough requests are pending for full batch
while (!responseFutures.isEmpty() && pendingRequests.size() < maxRequestsPerBatch) {
try {
responseFutures.remove().get();
} catch (Int... | [
"private",
"void",
"awaitRequestsCompletion",
"(",
")",
"throws",
"IOException",
"{",
"// Don't wait until all requests will be completed if enough requests are pending for full batch",
"while",
"(",
"!",
"responseFutures",
".",
"isEmpty",
"(",
")",
"&&",
"pendingRequests",
"."... | Awaits until all sent requests are completed. Should be serialized | [
"Awaits",
"until",
"all",
"sent",
"requests",
"are",
"completed",
".",
"Should",
"be",
"serialized"
] | 918d91c80a63e36046edb28972a5c65d3326a858 | https://github.com/GoogleCloudPlatform/bigdata-interop/blob/918d91c80a63e36046edb28972a5c65d3326a858/gcsio/src/main/java/com/google/cloud/hadoop/gcsio/BatchHelper.java#L259-L271 |
112,994 | GoogleCloudPlatform/bigdata-interop | gcsio/src/main/java/com/google/cloud/hadoop/gcsio/PrefixMappedItemCache.java | PrefixMappedItemCache.putItem | public synchronized GoogleCloudStorageItemInfo putItem(GoogleCloudStorageItemInfo item) {
StorageResourceId id = item.getResourceId();
PrefixKey key = new PrefixKey(id.getBucketName(), id.getObjectName());
CacheValue<GoogleCloudStorageItemInfo> value =
new CacheValue<GoogleCloudStorageItemInfo>(item... | java | public synchronized GoogleCloudStorageItemInfo putItem(GoogleCloudStorageItemInfo item) {
StorageResourceId id = item.getResourceId();
PrefixKey key = new PrefixKey(id.getBucketName(), id.getObjectName());
CacheValue<GoogleCloudStorageItemInfo> value =
new CacheValue<GoogleCloudStorageItemInfo>(item... | [
"public",
"synchronized",
"GoogleCloudStorageItemInfo",
"putItem",
"(",
"GoogleCloudStorageItemInfo",
"item",
")",
"{",
"StorageResourceId",
"id",
"=",
"item",
".",
"getResourceId",
"(",
")",
";",
"PrefixKey",
"key",
"=",
"new",
"PrefixKey",
"(",
"id",
".",
"getBu... | Inserts an item into the cache. If an item with the same resource id is present, it is
overwritten by the new item.
@param item the item to insert. The item must have a valid resource id.
@return the overwritten item, null if no item was overwritten. | [
"Inserts",
"an",
"item",
"into",
"the",
"cache",
".",
"If",
"an",
"item",
"with",
"the",
"same",
"resource",
"id",
"is",
"present",
"it",
"is",
"overwritten",
"by",
"the",
"new",
"item",
"."
] | 918d91c80a63e36046edb28972a5c65d3326a858 | https://github.com/GoogleCloudPlatform/bigdata-interop/blob/918d91c80a63e36046edb28972a5c65d3326a858/gcsio/src/main/java/com/google/cloud/hadoop/gcsio/PrefixMappedItemCache.java#L134-L152 |
112,995 | GoogleCloudPlatform/bigdata-interop | gcsio/src/main/java/com/google/cloud/hadoop/gcsio/PrefixMappedItemCache.java | PrefixMappedItemCache.removeItem | public synchronized GoogleCloudStorageItemInfo removeItem(StorageResourceId id) {
PrefixKey key = new PrefixKey(id.getBucketName(), id.getObjectName());
CacheValue<GoogleCloudStorageItemInfo> value = itemMap.remove(key);
if (value == null) {
return null;
}
if (isExpired(value)) {
clean... | java | public synchronized GoogleCloudStorageItemInfo removeItem(StorageResourceId id) {
PrefixKey key = new PrefixKey(id.getBucketName(), id.getObjectName());
CacheValue<GoogleCloudStorageItemInfo> value = itemMap.remove(key);
if (value == null) {
return null;
}
if (isExpired(value)) {
clean... | [
"public",
"synchronized",
"GoogleCloudStorageItemInfo",
"removeItem",
"(",
"StorageResourceId",
"id",
")",
"{",
"PrefixKey",
"key",
"=",
"new",
"PrefixKey",
"(",
"id",
".",
"getBucketName",
"(",
")",
",",
"id",
".",
"getObjectName",
"(",
")",
")",
";",
"CacheV... | Removes the item from the cache. If the item has expired, associated lists are invalidated.
@param id the resource id of the item to remove.
@return the removed item, null if no item was removed. | [
"Removes",
"the",
"item",
"from",
"the",
"cache",
".",
"If",
"the",
"item",
"has",
"expired",
"associated",
"lists",
"are",
"invalidated",
"."
] | 918d91c80a63e36046edb28972a5c65d3326a858 | https://github.com/GoogleCloudPlatform/bigdata-interop/blob/918d91c80a63e36046edb28972a5c65d3326a858/gcsio/src/main/java/com/google/cloud/hadoop/gcsio/PrefixMappedItemCache.java#L191-L205 |
112,996 | GoogleCloudPlatform/bigdata-interop | gcsio/src/main/java/com/google/cloud/hadoop/gcsio/PrefixMappedItemCache.java | PrefixMappedItemCache.invalidateBucket | public synchronized void invalidateBucket(String bucket) {
PrefixKey key = new PrefixKey(bucket, "");
getPrefixSubMap(itemMap, key).clear();
getPrefixSubMap(prefixMap, key).clear();
} | java | public synchronized void invalidateBucket(String bucket) {
PrefixKey key = new PrefixKey(bucket, "");
getPrefixSubMap(itemMap, key).clear();
getPrefixSubMap(prefixMap, key).clear();
} | [
"public",
"synchronized",
"void",
"invalidateBucket",
"(",
"String",
"bucket",
")",
"{",
"PrefixKey",
"key",
"=",
"new",
"PrefixKey",
"(",
"bucket",
",",
"\"\"",
")",
";",
"getPrefixSubMap",
"(",
"itemMap",
",",
"key",
")",
".",
"clear",
"(",
")",
";",
"... | Invalidates all cached items and lists associated with the given bucket.
@param bucket the bucket to invalidate. This must not be null. | [
"Invalidates",
"all",
"cached",
"items",
"and",
"lists",
"associated",
"with",
"the",
"given",
"bucket",
"."
] | 918d91c80a63e36046edb28972a5c65d3326a858 | https://github.com/GoogleCloudPlatform/bigdata-interop/blob/918d91c80a63e36046edb28972a5c65d3326a858/gcsio/src/main/java/com/google/cloud/hadoop/gcsio/PrefixMappedItemCache.java#L212-L217 |
112,997 | GoogleCloudPlatform/bigdata-interop | gcsio/src/main/java/com/google/cloud/hadoop/gcsio/PrefixMappedItemCache.java | PrefixMappedItemCache.cleanupLists | private void cleanupLists(PrefixKey key) {
// Remove expired list entries. Keep track of the last list removed.
NavigableMap<PrefixKey, CacheValue<Object>> head = prefixMap.headMap(key, true).descendingMap();
Iterator<Entry<PrefixKey, CacheValue<Object>>> headItr = head.entrySet().iterator();
Entry<Pref... | java | private void cleanupLists(PrefixKey key) {
// Remove expired list entries. Keep track of the last list removed.
NavigableMap<PrefixKey, CacheValue<Object>> head = prefixMap.headMap(key, true).descendingMap();
Iterator<Entry<PrefixKey, CacheValue<Object>>> headItr = head.entrySet().iterator();
Entry<Pref... | [
"private",
"void",
"cleanupLists",
"(",
"PrefixKey",
"key",
")",
"{",
"// Remove expired list entries. Keep track of the last list removed.",
"NavigableMap",
"<",
"PrefixKey",
",",
"CacheValue",
"<",
"Object",
">",
">",
"head",
"=",
"prefixMap",
".",
"headMap",
"(",
"... | Removes expired list entries that contain the given key. If a list was removed, it's contained
items are checked for expiration too.
@param key the key to cleanup the list entries for. | [
"Removes",
"expired",
"list",
"entries",
"that",
"contain",
"the",
"given",
"key",
".",
"If",
"a",
"list",
"was",
"removed",
"it",
"s",
"contained",
"items",
"are",
"checked",
"for",
"expiration",
"too",
"."
] | 918d91c80a63e36046edb28972a5c65d3326a858 | https://github.com/GoogleCloudPlatform/bigdata-interop/blob/918d91c80a63e36046edb28972a5c65d3326a858/gcsio/src/main/java/com/google/cloud/hadoop/gcsio/PrefixMappedItemCache.java#L242-L262 |
112,998 | GoogleCloudPlatform/bigdata-interop | gcsio/src/main/java/com/google/cloud/hadoop/gcsio/PrefixMappedItemCache.java | PrefixMappedItemCache.aggregateCacheValues | private static <K, V> List<V> aggregateCacheValues(Map<K, CacheValue<V>> map) {
List<V> values = new ArrayList<>(map.size());
for (Map.Entry<K, CacheValue<V>> entry : map.entrySet()) {
values.add(entry.getValue().getValue());
}
return values;
} | java | private static <K, V> List<V> aggregateCacheValues(Map<K, CacheValue<V>> map) {
List<V> values = new ArrayList<>(map.size());
for (Map.Entry<K, CacheValue<V>> entry : map.entrySet()) {
values.add(entry.getValue().getValue());
}
return values;
} | [
"private",
"static",
"<",
"K",
",",
"V",
">",
"List",
"<",
"V",
">",
"aggregateCacheValues",
"(",
"Map",
"<",
"K",
",",
"CacheValue",
"<",
"V",
">",
">",
"map",
")",
"{",
"List",
"<",
"V",
">",
"values",
"=",
"new",
"ArrayList",
"<>",
"(",
"map",... | Extracts all the cached values in a map.
@param map the map to extract the cached values from.
@return a list of references to cached values in the map. If the is empty, and empty list is
returned. | [
"Extracts",
"all",
"the",
"cached",
"values",
"in",
"a",
"map",
"."
] | 918d91c80a63e36046edb28972a5c65d3326a858 | https://github.com/GoogleCloudPlatform/bigdata-interop/blob/918d91c80a63e36046edb28972a5c65d3326a858/gcsio/src/main/java/com/google/cloud/hadoop/gcsio/PrefixMappedItemCache.java#L271-L277 |
112,999 | GoogleCloudPlatform/bigdata-interop | gcs/src/main/hadoop3/java/com/google/cloud/hadoop/fs/gcs/auth/GcsDtFetcher.java | GcsDtFetcher.addDelegationTokens | @Override
public Token<?> addDelegationTokens(
Configuration conf, Credentials creds, String renewer, String url) throws Exception {
if (!url.startsWith(SCHEME)) {
url = SCHEME + "://" + url;
}
FileSystem fs = FileSystem.get(URI.create(url), conf);
Token<?> token = fs.getDelegationToken(re... | java | @Override
public Token<?> addDelegationTokens(
Configuration conf, Credentials creds, String renewer, String url) throws Exception {
if (!url.startsWith(SCHEME)) {
url = SCHEME + "://" + url;
}
FileSystem fs = FileSystem.get(URI.create(url), conf);
Token<?> token = fs.getDelegationToken(re... | [
"@",
"Override",
"public",
"Token",
"<",
"?",
">",
"addDelegationTokens",
"(",
"Configuration",
"conf",
",",
"Credentials",
"creds",
",",
"String",
"renewer",
",",
"String",
"url",
")",
"throws",
"Exception",
"{",
"if",
"(",
"!",
"url",
".",
"startsWith",
... | Returns Token object via FileSystem, null if bad argument.
@param conf - a Configuration object used with FileSystem.get()
@param creds - a Credentials object to which token(s) will be added
@param renewer - the renewer to send with the token request
@param url - the URL to which the request is sent
@return a Token, o... | [
"Returns",
"Token",
"object",
"via",
"FileSystem",
"null",
"if",
"bad",
"argument",
"."
] | 918d91c80a63e36046edb28972a5c65d3326a858 | https://github.com/GoogleCloudPlatform/bigdata-interop/blob/918d91c80a63e36046edb28972a5c65d3326a858/gcs/src/main/hadoop3/java/com/google/cloud/hadoop/fs/gcs/auth/GcsDtFetcher.java#L55-L68 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.