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 | partition stringclasses 1
value |
|---|---|---|---|---|---|---|---|---|---|---|---|
hpsa/hpe-application-automation-tools-plugin | src/main/java/com/hp/application/automation/tools/results/LrGraphUtils.java | LrGraphUtils.constructTotalHitsGraph | static void constructTotalHitsGraph(Map.Entry<String, LrProjectScenarioResults> scenarioResults,
JSONObject scenarioGraphData) {
Map<Integer, WholeRunResult> totalHitsResults = scenarioResults.getValue().getTotalHitsResults();
JSONObject totalHitsGraphSet = extrac... | java | static void constructTotalHitsGraph(Map.Entry<String, LrProjectScenarioResults> scenarioResults,
JSONObject scenarioGraphData) {
Map<Integer, WholeRunResult> totalHitsResults = scenarioResults.getValue().getTotalHitsResults();
JSONObject totalHitsGraphSet = extrac... | [
"static",
"void",
"constructTotalHitsGraph",
"(",
"Map",
".",
"Entry",
"<",
"String",
",",
"LrProjectScenarioResults",
">",
"scenarioResults",
",",
"JSONObject",
"scenarioGraphData",
")",
"{",
"Map",
"<",
"Integer",
",",
"WholeRunResult",
">",
"totalHitsResults",
"=... | Construct total hits graph.
@param scenarioResults the scenario results
@param scenarioGraphData the scenario graph data | [
"Construct",
"total",
"hits",
"graph",
"."
] | 987536f5551bc76fd028d746a951d1fd72c7567a | https://github.com/hpsa/hpe-application-automation-tools-plugin/blob/987536f5551bc76fd028d746a951d1fd72c7567a/src/main/java/com/hp/application/automation/tools/results/LrGraphUtils.java#L356-L372 | train |
hpsa/hpe-application-automation-tools-plugin | src/main/java/com/hp/application/automation/tools/sse/sdk/HttpRequestDecorator.java | HttpRequestDecorator.digestToString | private static String digestToString(byte[] b) {
StringBuilder result = new StringBuilder(128);
for (byte aB : b) {
result.append(Integer.toString((aB & 0xff) + 0x100, 16).substring(1));
}
return result.toString();
} | java | private static String digestToString(byte[] b) {
StringBuilder result = new StringBuilder(128);
for (byte aB : b) {
result.append(Integer.toString((aB & 0xff) + 0x100, 16).substring(1));
}
return result.toString();
} | [
"private",
"static",
"String",
"digestToString",
"(",
"byte",
"[",
"]",
"b",
")",
"{",
"StringBuilder",
"result",
"=",
"new",
"StringBuilder",
"(",
"128",
")",
";",
"for",
"(",
"byte",
"aB",
":",
"b",
")",
"{",
"result",
".",
"append",
"(",
"Integer",
... | This method convert byte array to string regardless the charset
@param b
byte array input
@return the corresponding string | [
"This",
"method",
"convert",
"byte",
"array",
"to",
"string",
"regardless",
"the",
"charset"
] | 987536f5551bc76fd028d746a951d1fd72c7567a | https://github.com/hpsa/hpe-application-automation-tools-plugin/blob/987536f5551bc76fd028d746a951d1fd72c7567a/src/main/java/com/hp/application/automation/tools/sse/sdk/HttpRequestDecorator.java#L56-L64 | train |
hpsa/hpe-application-automation-tools-plugin | src/main/java/com/hp/application/automation/tools/results/PerformanceProjectAction.java | PerformanceProjectAction.getScenarioList | @JavaScriptMethod
public JSONArray getScenarioList() {
JSONArray scenarioList = new JSONArray();
for (String scenarioName : _projectResult.getScenarioResults().keySet()) {
JSONObject scenario = new JSONObject();
scenario.put("ScenarioName", scenarioName);
scenario... | java | @JavaScriptMethod
public JSONArray getScenarioList() {
JSONArray scenarioList = new JSONArray();
for (String scenarioName : _projectResult.getScenarioResults().keySet()) {
JSONObject scenario = new JSONObject();
scenario.put("ScenarioName", scenarioName);
scenario... | [
"@",
"JavaScriptMethod",
"public",
"JSONArray",
"getScenarioList",
"(",
")",
"{",
"JSONArray",
"scenarioList",
"=",
"new",
"JSONArray",
"(",
")",
";",
"for",
"(",
"String",
"scenarioName",
":",
"_projectResult",
".",
"getScenarioResults",
"(",
")",
".",
"keySet"... | Gets scenario list.
@return the scenario list | [
"Gets",
"scenario",
"list",
"."
] | 987536f5551bc76fd028d746a951d1fd72c7567a | https://github.com/hpsa/hpe-application-automation-tools-plugin/blob/987536f5551bc76fd028d746a951d1fd72c7567a/src/main/java/com/hp/application/automation/tools/results/PerformanceProjectAction.java#L103-L112 | train |
hpsa/hpe-application-automation-tools-plugin | src/main/java/com/hp/application/automation/tools/results/PerformanceProjectAction.java | PerformanceProjectAction.getGraphData | @JavaScriptMethod
public JSONObject getGraphData() {
JSONObject projectDataSet = new JSONObject();
if (_projectResult == null) {
// getUpdatedData();
return new JSONObject();
}
for (SortedMap.Entry<String, LrProjectScenarioResults> scenarioResults : _projectR... | java | @JavaScriptMethod
public JSONObject getGraphData() {
JSONObject projectDataSet = new JSONObject();
if (_projectResult == null) {
// getUpdatedData();
return new JSONObject();
}
for (SortedMap.Entry<String, LrProjectScenarioResults> scenarioResults : _projectR... | [
"@",
"JavaScriptMethod",
"public",
"JSONObject",
"getGraphData",
"(",
")",
"{",
"JSONObject",
"projectDataSet",
"=",
"new",
"JSONObject",
"(",
")",
";",
"if",
"(",
"_projectResult",
"==",
"null",
")",
"{",
"// getUpdatedData();",
"return",
"new",
"JSONO... | Collates graph data per scenario per build for the whole project.
Adds the respected graphs with scenario as the key
@return the graph data | [
"Collates",
"graph",
"data",
"per",
"scenario",
"per",
"build",
"for",
"the",
"whole",
"project",
".",
"Adds",
"the",
"respected",
"graphs",
"with",
"scenario",
"as",
"the",
"key"
] | 987536f5551bc76fd028d746a951d1fd72c7567a | https://github.com/hpsa/hpe-application-automation-tools-plugin/blob/987536f5551bc76fd028d746a951d1fd72c7567a/src/main/java/com/hp/application/automation/tools/results/PerformanceProjectAction.java#L120-L164 | train |
hpsa/hpe-application-automation-tools-plugin | src/main/java/com/hp/application/automation/tools/results/PerformanceProjectAction.java | PerformanceProjectAction.isVisible | boolean isVisible() {
List<? extends Run<?, ?>> builds = currentProject.getBuilds();
for (Run run : builds) {
if (run.getAction(PerformanceJobReportAction.class) != null) {
return true;
}
}
return false;
} | java | boolean isVisible() {
List<? extends Run<?, ?>> builds = currentProject.getBuilds();
for (Run run : builds) {
if (run.getAction(PerformanceJobReportAction.class) != null) {
return true;
}
}
return false;
} | [
"boolean",
"isVisible",
"(",
")",
"{",
"List",
"<",
"?",
"extends",
"Run",
"<",
"?",
",",
"?",
">",
">",
"builds",
"=",
"currentProject",
".",
"getBuilds",
"(",
")",
";",
"for",
"(",
"Run",
"run",
":",
"builds",
")",
"{",
"if",
"(",
"run",
".",
... | Is visible boolean.
@return the boolean | [
"Is",
"visible",
"boolean",
"."
] | 987536f5551bc76fd028d746a951d1fd72c7567a | https://github.com/hpsa/hpe-application-automation-tools-plugin/blob/987536f5551bc76fd028d746a951d1fd72c7567a/src/main/java/com/hp/application/automation/tools/results/PerformanceProjectAction.java#L214-L222 | train |
hpsa/hpe-application-automation-tools-plugin | src/main/java/com/hp/application/automation/tools/results/PerformanceProjectAction.java | PerformanceProjectAction.getUpdatedData | public synchronized void getUpdatedData() {
if (!isUpdateDataNeeded()) {
return;
}
this._projectResult = new ProjectLrResults();
_workedBuilds = new ArrayList<Integer>();
RunList<? extends Run> projectBuilds = currentProject.getBuilds();
// updateLastBuild... | java | public synchronized void getUpdatedData() {
if (!isUpdateDataNeeded()) {
return;
}
this._projectResult = new ProjectLrResults();
_workedBuilds = new ArrayList<Integer>();
RunList<? extends Run> projectBuilds = currentProject.getBuilds();
// updateLastBuild... | [
"public",
"synchronized",
"void",
"getUpdatedData",
"(",
")",
"{",
"if",
"(",
"!",
"isUpdateDataNeeded",
"(",
")",
")",
"{",
"return",
";",
"}",
"this",
".",
"_projectResult",
"=",
"new",
"ProjectLrResults",
"(",
")",
";",
"_workedBuilds",
"=",
"new",
"Arr... | Gets updated data. | [
"Gets",
"updated",
"data",
"."
] | 987536f5551bc76fd028d746a951d1fd72c7567a | https://github.com/hpsa/hpe-application-automation-tools-plugin/blob/987536f5551bc76fd028d746a951d1fd72c7567a/src/main/java/com/hp/application/automation/tools/results/PerformanceProjectAction.java#L227-L288 | train |
hpsa/hpe-application-automation-tools-plugin | src/main/java/com/hp/application/automation/tools/model/RunFromFileSystemModel.java | RunFromFileSystemModel.getJobDetails | public JSONObject getJobDetails(String mcUrl, String proxyAddress, String proxyUserName, String proxyPassword){
if(StringUtils.isBlank(fsUserName) || StringUtils.isBlank(fsPassword.getPlainText())){
return null;
}
return JobConfigurationProxy.getInstance().getJobById(mcUrl, fsUserNam... | java | public JSONObject getJobDetails(String mcUrl, String proxyAddress, String proxyUserName, String proxyPassword){
if(StringUtils.isBlank(fsUserName) || StringUtils.isBlank(fsPassword.getPlainText())){
return null;
}
return JobConfigurationProxy.getInstance().getJobById(mcUrl, fsUserNam... | [
"public",
"JSONObject",
"getJobDetails",
"(",
"String",
"mcUrl",
",",
"String",
"proxyAddress",
",",
"String",
"proxyUserName",
",",
"String",
"proxyPassword",
")",
"{",
"if",
"(",
"StringUtils",
".",
"isBlank",
"(",
"fsUserName",
")",
"||",
"StringUtils",
".",
... | Get proxy details json object.
@param mcUrl the mc url
@param proxyAddress the proxy address
@param proxyUserName the proxy user name
@param proxyPassword the proxy password
@return the json object | [
"Get",
"proxy",
"details",
"json",
"object",
"."
] | 987536f5551bc76fd028d746a951d1fd72c7567a | https://github.com/hpsa/hpe-application-automation-tools-plugin/blob/987536f5551bc76fd028d746a951d1fd72c7567a/src/main/java/com/hp/application/automation/tools/model/RunFromFileSystemModel.java#L646-L651 | train |
Intel-HLS/GKL | src/main/java/com/intel/gkl/smithwaterman/IntelSmithWaterman.java | IntelSmithWaterman.align | @Override
public SWNativeAlignerResult align(byte[] refArray, byte[] altArray, SWParameters parameters, SWOverhangStrategy overhangStrategy)
{
int intStrategy = getStrategy(overhangStrategy);
byte[] cigar = new byte[2*Integer.max(refArray.length, altArray.length)];
int offset = alignNa... | java | @Override
public SWNativeAlignerResult align(byte[] refArray, byte[] altArray, SWParameters parameters, SWOverhangStrategy overhangStrategy)
{
int intStrategy = getStrategy(overhangStrategy);
byte[] cigar = new byte[2*Integer.max(refArray.length, altArray.length)];
int offset = alignNa... | [
"@",
"Override",
"public",
"SWNativeAlignerResult",
"align",
"(",
"byte",
"[",
"]",
"refArray",
",",
"byte",
"[",
"]",
"altArray",
",",
"SWParameters",
"parameters",
",",
"SWOverhangStrategy",
"overhangStrategy",
")",
"{",
"int",
"intStrategy",
"=",
"getStrategy",... | Implements the native implementation of SmithWaterman, and returns the Cigar String and alignment_offset
@param refArray array of reference data
@param altArray array of alternate data | [
"Implements",
"the",
"native",
"implementation",
"of",
"SmithWaterman",
"and",
"returns",
"the",
"Cigar",
"String",
"and",
"alignment_offset"
] | c071276633f01d8198198fb40df468a0dffb0d41 | https://github.com/Intel-HLS/GKL/blob/c071276633f01d8198198fb40df468a0dffb0d41/src/main/java/com/intel/gkl/smithwaterman/IntelSmithWaterman.java#L95-L104 | train |
Intel-HLS/GKL | src/main/java/com/intel/gkl/compression/IntelDeflaterFactory.java | IntelDeflaterFactory.makeDeflater | public Deflater makeDeflater(final int compressionLevel, final boolean gzipCompatible) {
if (intelDeflaterSupported) {
if ((compressionLevel == 1 && gzipCompatible) || compressionLevel != 1) {
return new IntelDeflater(compressionLevel, gzipCompatible);
}
}
... | java | public Deflater makeDeflater(final int compressionLevel, final boolean gzipCompatible) {
if (intelDeflaterSupported) {
if ((compressionLevel == 1 && gzipCompatible) || compressionLevel != 1) {
return new IntelDeflater(compressionLevel, gzipCompatible);
}
}
... | [
"public",
"Deflater",
"makeDeflater",
"(",
"final",
"int",
"compressionLevel",
",",
"final",
"boolean",
"gzipCompatible",
")",
"{",
"if",
"(",
"intelDeflaterSupported",
")",
"{",
"if",
"(",
"(",
"compressionLevel",
"==",
"1",
"&&",
"gzipCompatible",
")",
"||",
... | Returns an IntelDeflater if supported on the platform, otherwise returns a Java Deflater
@param compressionLevel the compression level (0-9)
@param gzipCompatible if true the use GZIP compatible compression
@return a Deflater object | [
"Returns",
"an",
"IntelDeflater",
"if",
"supported",
"on",
"the",
"platform",
"otherwise",
"returns",
"a",
"Java",
"Deflater"
] | c071276633f01d8198198fb40df468a0dffb0d41 | https://github.com/Intel-HLS/GKL/blob/c071276633f01d8198198fb40df468a0dffb0d41/src/main/java/com/intel/gkl/compression/IntelDeflaterFactory.java#L32-L40 | train |
Intel-HLS/GKL | src/main/java/com/intel/gkl/pairhmm/IntelPairHmm.java | IntelPairHmm.initialize | public void initialize(PairHMMNativeArguments args) {
if (args == null) {
args = new PairHMMNativeArguments();
args.useDoublePrecision = false;
args.maxNumberOfThreads = 1;
}
if(!useFpga && gklUtils.isAvx512Supported()) {
logger.info("Using CPU-su... | java | public void initialize(PairHMMNativeArguments args) {
if (args == null) {
args = new PairHMMNativeArguments();
args.useDoublePrecision = false;
args.maxNumberOfThreads = 1;
}
if(!useFpga && gklUtils.isAvx512Supported()) {
logger.info("Using CPU-su... | [
"public",
"void",
"initialize",
"(",
"PairHMMNativeArguments",
"args",
")",
"{",
"if",
"(",
"args",
"==",
"null",
")",
"{",
"args",
"=",
"new",
"PairHMMNativeArguments",
"(",
")",
";",
"args",
".",
"useDoublePrecision",
"=",
"false",
";",
"args",
".",
"max... | Initialize native PairHMM with the supplied args.
@param args the args used to configure native PairHMM | [
"Initialize",
"native",
"PairHMM",
"with",
"the",
"supplied",
"args",
"."
] | c071276633f01d8198198fb40df468a0dffb0d41 | https://github.com/Intel-HLS/GKL/blob/c071276633f01d8198198fb40df468a0dffb0d41/src/main/java/com/intel/gkl/pairhmm/IntelPairHmm.java#L63-L101 | train |
sbt-compiler-maven-plugin/sbt-compiler-maven-plugin | sbt-compiler-maven-plugin/src/main/java/com/google/code/sbt/compiler/plugin/SBTAddManagedSourcesMojo.java | SBTAddManagedSourcesMojo.execute | @Override
public void execute()
{
if ( "pom".equals( project.getPackaging() ) )
{
return;
}
File managedPath = new File( project.getBuild().getDirectory(), "src_managed" );
String managedPathStr = managedPath.getAbsolutePath();
if ( !project.getCompil... | java | @Override
public void execute()
{
if ( "pom".equals( project.getPackaging() ) )
{
return;
}
File managedPath = new File( project.getBuild().getDirectory(), "src_managed" );
String managedPathStr = managedPath.getAbsolutePath();
if ( !project.getCompil... | [
"@",
"Override",
"public",
"void",
"execute",
"(",
")",
"{",
"if",
"(",
"\"pom\"",
".",
"equals",
"(",
"project",
".",
"getPackaging",
"(",
")",
")",
")",
"{",
"return",
";",
"}",
"File",
"managedPath",
"=",
"new",
"File",
"(",
"project",
".",
"getBu... | Adds default SBT managed sources location to Maven project.
<code>${project.build.directory}/src_managed</code> is added to project's compile source roots | [
"Adds",
"default",
"SBT",
"managed",
"sources",
"location",
"to",
"Maven",
"project",
"."
] | cf8b8766956841c13f388eb311d214644dba9137 | https://github.com/sbt-compiler-maven-plugin/sbt-compiler-maven-plugin/blob/cf8b8766956841c13f388eb311d214644dba9137/sbt-compiler-maven-plugin/src/main/java/com/google/code/sbt/compiler/plugin/SBTAddManagedSourcesMojo.java#L53-L68 | train |
sbt-compiler-maven-plugin/sbt-compiler-maven-plugin | sbt-compiler-maven-plugin/src/main/java/com/google/code/sbt/compiler/plugin/SBTAddScalaSourcesMojo.java | SBTAddScalaSourcesMojo.execute | @Override
public void execute()
{
if ( "pom".equals( project.getPackaging() ) )
{
return;
}
File baseDir = project.getBasedir();
File mainScalaPath = new File( baseDir, "src/main/scala" );
if ( mainScalaPath.isDirectory() )
{
Stri... | java | @Override
public void execute()
{
if ( "pom".equals( project.getPackaging() ) )
{
return;
}
File baseDir = project.getBasedir();
File mainScalaPath = new File( baseDir, "src/main/scala" );
if ( mainScalaPath.isDirectory() )
{
Stri... | [
"@",
"Override",
"public",
"void",
"execute",
"(",
")",
"{",
"if",
"(",
"\"pom\"",
".",
"equals",
"(",
"project",
".",
"getPackaging",
"(",
")",
")",
")",
"{",
"return",
";",
"}",
"File",
"baseDir",
"=",
"project",
".",
"getBasedir",
"(",
")",
";",
... | Adds default Scala sources locations to Maven project.
<ul>
<li>{@code src/main/scala} is added to project's compile source roots</li>
<li>{@code src/test/scala} is added to project's test compile source roots</li>
</ul> | [
"Adds",
"default",
"Scala",
"sources",
"locations",
"to",
"Maven",
"project",
"."
] | cf8b8766956841c13f388eb311d214644dba9137 | https://github.com/sbt-compiler-maven-plugin/sbt-compiler-maven-plugin/blob/cf8b8766956841c13f388eb311d214644dba9137/sbt-compiler-maven-plugin/src/main/java/com/google/code/sbt/compiler/plugin/SBTAddScalaSourcesMojo.java#L59-L90 | train |
sbt-compiler-maven-plugin/sbt-compiler-maven-plugin | sbt-compiler-api/src/main/java/com/google/code/sbt/compiler/api/Compilers.java | Compilers.getCacheDirectory | public static File getCacheDirectory( File classesDirectory )
{
String classesDirectoryName = classesDirectory.getName();
String cacheDirectoryName = classesDirectoryName.replace( TEST_CLASSES, CACHE ).replace( CLASSES, CACHE );
return new File( classesDirectory.getParentFile(), cacheDirecto... | java | public static File getCacheDirectory( File classesDirectory )
{
String classesDirectoryName = classesDirectory.getName();
String cacheDirectoryName = classesDirectoryName.replace( TEST_CLASSES, CACHE ).replace( CLASSES, CACHE );
return new File( classesDirectory.getParentFile(), cacheDirecto... | [
"public",
"static",
"File",
"getCacheDirectory",
"(",
"File",
"classesDirectory",
")",
"{",
"String",
"classesDirectoryName",
"=",
"classesDirectory",
".",
"getName",
"(",
")",
";",
"String",
"cacheDirectoryName",
"=",
"classesDirectoryName",
".",
"replace",
"(",
"T... | Returns directory for incremental compilation cache files.
@param classesDirectory compilation output directory
@return directory for incremental compilation cache files | [
"Returns",
"directory",
"for",
"incremental",
"compilation",
"cache",
"files",
"."
] | cf8b8766956841c13f388eb311d214644dba9137 | https://github.com/sbt-compiler-maven-plugin/sbt-compiler-maven-plugin/blob/cf8b8766956841c13f388eb311d214644dba9137/sbt-compiler-api/src/main/java/com/google/code/sbt/compiler/api/Compilers.java#L84-L89 | train |
sbt-compiler-maven-plugin/sbt-compiler-maven-plugin | sbt-compilers/sbt-compiler-sbt012/src/main/java/com/google/code/sbt/compiler/sbt012/SBT012Compiler.java | SBT012Compiler.getScalacProblems | private CompilationProblem[] getScalacProblems( Problem[] problems )
{
CompilationProblem[] result = new CompilationProblem[problems.length];
for ( int i = 0; i < problems.length; i++ )
{
Problem problem = problems[i];
Position position = problem.position();
... | java | private CompilationProblem[] getScalacProblems( Problem[] problems )
{
CompilationProblem[] result = new CompilationProblem[problems.length];
for ( int i = 0; i < problems.length; i++ )
{
Problem problem = problems[i];
Position position = problem.position();
... | [
"private",
"CompilationProblem",
"[",
"]",
"getScalacProblems",
"(",
"Problem",
"[",
"]",
"problems",
")",
"{",
"CompilationProblem",
"[",
"]",
"result",
"=",
"new",
"CompilationProblem",
"[",
"problems",
".",
"length",
"]",
";",
"for",
"(",
"int",
"i",
"=",... | scalac problems conversion | [
"scalac",
"problems",
"conversion"
] | cf8b8766956841c13f388eb311d214644dba9137 | https://github.com/sbt-compiler-maven-plugin/sbt-compiler-maven-plugin/blob/cf8b8766956841c13f388eb311d214644dba9137/sbt-compilers/sbt-compiler-sbt012/src/main/java/com/google/code/sbt/compiler/sbt012/SBT012Compiler.java#L141-L163 | train |
qubole/qds-sdk-java | examples/src/main/java/com/qubole/qds/sdk/java/examples/SparkCommandExample.java | SparkCommandExample.submitScalaProgram | private static void submitScalaProgram(QdsClient client) throws Exception {
String sampleProgram = "println(\"hello world\")";
SparkCommandBuilder sparkBuilder = client.command().spark();
// Give a name to the command. (Optional)
sparkBuilder.name("spark-scala-test");
//Settin... | java | private static void submitScalaProgram(QdsClient client) throws Exception {
String sampleProgram = "println(\"hello world\")";
SparkCommandBuilder sparkBuilder = client.command().spark();
// Give a name to the command. (Optional)
sparkBuilder.name("spark-scala-test");
//Settin... | [
"private",
"static",
"void",
"submitScalaProgram",
"(",
"QdsClient",
"client",
")",
"throws",
"Exception",
"{",
"String",
"sampleProgram",
"=",
"\"println(\\\"hello world\\\")\"",
";",
"SparkCommandBuilder",
"sparkBuilder",
"=",
"client",
".",
"command",
"(",
")",
"."... | An Example of submitting Spark Command as a Scala program.
Similarly, we can submit Spark Command as a SQL query, R program
and Java program. | [
"An",
"Example",
"of",
"submitting",
"Spark",
"Command",
"as",
"a",
"Scala",
"program",
".",
"Similarly",
"we",
"can",
"submit",
"Spark",
"Command",
"as",
"a",
"SQL",
"query",
"R",
"program",
"and",
"Java",
"program",
"."
] | c652374075c7b72071f73db960f5f3a43f922afd | https://github.com/qubole/qds-sdk-java/blob/c652374075c7b72071f73db960f5f3a43f922afd/examples/src/main/java/com/qubole/qds/sdk/java/examples/SparkCommandExample.java#L51-L72 | train |
qubole/qds-sdk-java | examples/src/main/java/com/qubole/qds/sdk/java/examples/SparkCommandExample.java | SparkCommandExample.submitSQLQuery | private static void submitSQLQuery(QdsClient client) throws Exception {
String sampleSqlQuery =
"select * from default_qubole_airline_origin_destination limit 100";
SparkCommandBuilder sparkBuilder = client.command().spark();
// Give a name to the command. (Optional)
sparkB... | java | private static void submitSQLQuery(QdsClient client) throws Exception {
String sampleSqlQuery =
"select * from default_qubole_airline_origin_destination limit 100";
SparkCommandBuilder sparkBuilder = client.command().spark();
// Give a name to the command. (Optional)
sparkB... | [
"private",
"static",
"void",
"submitSQLQuery",
"(",
"QdsClient",
"client",
")",
"throws",
"Exception",
"{",
"String",
"sampleSqlQuery",
"=",
"\"select * from default_qubole_airline_origin_destination limit 100\"",
";",
"SparkCommandBuilder",
"sparkBuilder",
"=",
"client",
"."... | An example of submitting Spark Command as a SQL query. | [
"An",
"example",
"of",
"submitting",
"Spark",
"Command",
"as",
"a",
"SQL",
"query",
"."
] | c652374075c7b72071f73db960f5f3a43f922afd | https://github.com/qubole/qds-sdk-java/blob/c652374075c7b72071f73db960f5f3a43f922afd/examples/src/main/java/com/qubole/qds/sdk/java/examples/SparkCommandExample.java#L77-L96 | train |
abego/treelayout | org.abego.treelayout/src/main/java/org/abego/treelayout/TreeLayout.java | TreeLayout.secondWalk | private void secondWalk(TreeNode v, double m, int level, double levelStart) {
// construct the position from the prelim and the level information
// The rootLocation affects the way how x and y are changed and in what
// direction.
double levelChangeSign = getLevelChangeSign();
boolean levelChangeOnYAxis = i... | java | private void secondWalk(TreeNode v, double m, int level, double levelStart) {
// construct the position from the prelim and the level information
// The rootLocation affects the way how x and y are changed and in what
// direction.
double levelChangeSign = getLevelChangeSign();
boolean levelChangeOnYAxis = i... | [
"private",
"void",
"secondWalk",
"(",
"TreeNode",
"v",
",",
"double",
"m",
",",
"int",
"level",
",",
"double",
"levelStart",
")",
"{",
"// construct the position from the prelim and the level information",
"// The rootLocation affects the way how x and y are changed and in what",... | In difference to the original algorithm we also pass in extra level
information.
@param v
@param m
@param level
@param levelStart | [
"In",
"difference",
"to",
"the",
"original",
"algorithm",
"we",
"also",
"pass",
"in",
"extra",
"level",
"information",
"."
] | aa73af5803c6ec30db0b4ad192c7cba55d0862d2 | https://github.com/abego/treelayout/blob/aa73af5803c6ec30db0b4ad192c7cba55d0862d2/org.abego.treelayout/src/main/java/org/abego/treelayout/TreeLayout.java#L642-L684 | train |
abego/treelayout | org.abego.treelayout/src/main/java/org/abego/treelayout/TreeLayout.java | TreeLayout.dumpTree | public void dumpTree(PrintStream printStream, DumpConfiguration dumpConfiguration) {
dumpTree(printStream,tree.getRoot(),0, dumpConfiguration);
} | java | public void dumpTree(PrintStream printStream, DumpConfiguration dumpConfiguration) {
dumpTree(printStream,tree.getRoot(),0, dumpConfiguration);
} | [
"public",
"void",
"dumpTree",
"(",
"PrintStream",
"printStream",
",",
"DumpConfiguration",
"dumpConfiguration",
")",
"{",
"dumpTree",
"(",
"printStream",
",",
"tree",
".",
"getRoot",
"(",
")",
",",
"0",
",",
"dumpConfiguration",
")",
";",
"}"
] | Prints a dump of the tree to the given printStream, using the node's
"toString" method.
@param printStream
@param dumpConfiguration
[default: new DumpConfiguration()] | [
"Prints",
"a",
"dump",
"of",
"the",
"tree",
"to",
"the",
"given",
"printStream",
"using",
"the",
"node",
"s",
"toString",
"method",
"."
] | aa73af5803c6ec30db0b4ad192c7cba55d0862d2 | https://github.com/abego/treelayout/blob/aa73af5803c6ec30db0b4ad192c7cba55d0862d2/org.abego.treelayout/src/main/java/org/abego/treelayout/TreeLayout.java#L894-L896 | train |
abego/treelayout | org.abego.treelayout.demo/src/main/java/org/abego/treelayout/demo/svg/SVGUtil.java | SVGUtil.main | public static void main(String[] args) throws IOException {
String s = doc(svg(
160,
200,
rect(0, 0, 160, 200, "fill:red;")
+ svg(10,
10,
100,
100,
rect(0, 0, 100, 100,
"fill:orange; stroke:rgb(0,0,0);"))
+ line(20, 20, 100, 100,
"stroke:black;... | java | public static void main(String[] args) throws IOException {
String s = doc(svg(
160,
200,
rect(0, 0, 160, 200, "fill:red;")
+ svg(10,
10,
100,
100,
rect(0, 0, 100, 100,
"fill:orange; stroke:rgb(0,0,0);"))
+ line(20, 20, 100, 100,
"stroke:black;... | [
"public",
"static",
"void",
"main",
"(",
"String",
"[",
"]",
"args",
")",
"throws",
"IOException",
"{",
"String",
"s",
"=",
"doc",
"(",
"svg",
"(",
"160",
",",
"200",
",",
"rect",
"(",
"0",
",",
"0",
",",
"160",
",",
"200",
",",
"\"fill:red;\"",
... | Creates a sample SVG file "demo.svg"
@param args option '-view': view the just created file
(may not be supported on all platforms)
@throws IOException | [
"Creates",
"a",
"sample",
"SVG",
"file",
"demo",
".",
"svg"
] | aa73af5803c6ec30db0b4ad192c7cba55d0862d2 | https://github.com/abego/treelayout/blob/aa73af5803c6ec30db0b4ad192c7cba55d0862d2/org.abego.treelayout.demo/src/main/java/org/abego/treelayout/demo/svg/SVGUtil.java#L218-L257 | train |
qubole/qds-sdk-java | src/main/java/com/qubole/qds/sdk/java/client/ResultStreamer.java | ResultStreamer.getResults | public Reader getResults(ResultValue resultValue) throws Exception
{
if (resultValue.isInline())
{
return new StringReader(resultValue.getResults());
}
return readFromS3(resultValue.getResult_location());
} | java | public Reader getResults(ResultValue resultValue) throws Exception
{
if (resultValue.isInline())
{
return new StringReader(resultValue.getResults());
}
return readFromS3(resultValue.getResult_location());
} | [
"public",
"Reader",
"getResults",
"(",
"ResultValue",
"resultValue",
")",
"throws",
"Exception",
"{",
"if",
"(",
"resultValue",
".",
"isInline",
"(",
")",
")",
"{",
"return",
"new",
"StringReader",
"(",
"resultValue",
".",
"getResults",
"(",
")",
")",
";",
... | Return a stream over the given results. If the results are not inline, the
results will come from S3
@param resultValue result
@return stream
@throws Exception errors | [
"Return",
"a",
"stream",
"over",
"the",
"given",
"results",
".",
"If",
"the",
"results",
"are",
"not",
"inline",
"the",
"results",
"will",
"come",
"from",
"S3"
] | c652374075c7b72071f73db960f5f3a43f922afd | https://github.com/qubole/qds-sdk-java/blob/c652374075c7b72071f73db960f5f3a43f922afd/src/main/java/com/qubole/qds/sdk/java/client/ResultStreamer.java#L81-L89 | train |
qubole/qds-sdk-java | src/main/java/com/qubole/qds/sdk/java/details/CompositeCommandBuilderImpl.java | CompositeCommandBuilderImpl.checkCommandTypeSupported | private boolean checkCommandTypeSupported(BaseCommand command)
{
// for command type none or composite
// we dont support adding it as base command
if ((command.getCommandType() == BaseCommand.COMMAND_TYPE.NONE)
|| (command.getCommandType() == BaseCommand.COMMAND_TYPE.COMPOSITE))... | java | private boolean checkCommandTypeSupported(BaseCommand command)
{
// for command type none or composite
// we dont support adding it as base command
if ((command.getCommandType() == BaseCommand.COMMAND_TYPE.NONE)
|| (command.getCommandType() == BaseCommand.COMMAND_TYPE.COMPOSITE))... | [
"private",
"boolean",
"checkCommandTypeSupported",
"(",
"BaseCommand",
"command",
")",
"{",
"// for command type none or composite",
"// we dont support adding it as base command",
"if",
"(",
"(",
"command",
".",
"getCommandType",
"(",
")",
"==",
"BaseCommand",
".",
"COMMAN... | workflow or not | [
"workflow",
"or",
"not"
] | c652374075c7b72071f73db960f5f3a43f922afd | https://github.com/qubole/qds-sdk-java/blob/c652374075c7b72071f73db960f5f3a43f922afd/src/main/java/com/qubole/qds/sdk/java/details/CompositeCommandBuilderImpl.java#L79-L89 | train |
abego/treelayout | org.abego.treelayout/src/main/java/org/abego/treelayout/internal/util/java/lang/string/StringUtil.java | StringUtil.quote | public static String quote(String s, String nullResult) {
if (s == null) {
return nullResult;
}
StringBuffer result = new StringBuffer();
result.append('"');
int length = s.length();
for (int i = 0; i < length; i++) {
char c = s.charAt(i);
switch (c) {
case '\b': {
result.append("\\b");
... | java | public static String quote(String s, String nullResult) {
if (s == null) {
return nullResult;
}
StringBuffer result = new StringBuffer();
result.append('"');
int length = s.length();
for (int i = 0; i < length; i++) {
char c = s.charAt(i);
switch (c) {
case '\b': {
result.append("\\b");
... | [
"public",
"static",
"String",
"quote",
"(",
"String",
"s",
",",
"String",
"nullResult",
")",
"{",
"if",
"(",
"s",
"==",
"null",
")",
"{",
"return",
"nullResult",
";",
"}",
"StringBuffer",
"result",
"=",
"new",
"StringBuffer",
"(",
")",
";",
"result",
"... | Returns a quoted version of a given string, i.e. as a Java String
Literal.
@param s
[nullable] the string to quote
@param nullResult
[default="null"] the String to be returned for null values.
@return the nullResult when s is null, otherwise s as a quoted string
(i.e. Java String Literal) | [
"Returns",
"a",
"quoted",
"version",
"of",
"a",
"given",
"string",
"i",
".",
"e",
".",
"as",
"a",
"Java",
"String",
"Literal",
"."
] | aa73af5803c6ec30db0b4ad192c7cba55d0862d2 | https://github.com/abego/treelayout/blob/aa73af5803c6ec30db0b4ad192c7cba55d0862d2/org.abego.treelayout/src/main/java/org/abego/treelayout/internal/util/java/lang/string/StringUtil.java#L45-L97 | train |
digitalheir/java-xml-to-json | src/main/java/org/leibnizcenter/xml/TerseJson.java | TerseJson.parse | public static Document parse(JsonReader reader) throws IOException, NotImplemented {
reader.beginArray();
int nodeType = reader.nextInt();
CoreDocumentImpl doc = new DocumentImpl();
if (nodeType == Node.ELEMENT_NODE) {
addInitialElement(reader, doc);
} else if (nod... | java | public static Document parse(JsonReader reader) throws IOException, NotImplemented {
reader.beginArray();
int nodeType = reader.nextInt();
CoreDocumentImpl doc = new DocumentImpl();
if (nodeType == Node.ELEMENT_NODE) {
addInitialElement(reader, doc);
} else if (nod... | [
"public",
"static",
"Document",
"parse",
"(",
"JsonReader",
"reader",
")",
"throws",
"IOException",
",",
"NotImplemented",
"{",
"reader",
".",
"beginArray",
"(",
")",
";",
"int",
"nodeType",
"=",
"reader",
".",
"nextInt",
"(",
")",
";",
"CoreDocumentImpl",
"... | First element must be a document node or element node
@param reader JSON stream
@return XML document | [
"First",
"element",
"must",
"be",
"a",
"document",
"node",
"or",
"element",
"node"
] | 94b4cef671bea9b79fb6daa685cd5bf78c222179 | https://github.com/digitalheir/java-xml-to-json/blob/94b4cef671bea9b79fb6daa685cd5bf78c222179/src/main/java/org/leibnizcenter/xml/TerseJson.java#L35-L51 | train |
digitalheir/java-xml-to-json | src/main/java/org/leibnizcenter/xml/TerseJson.java | TerseJson.toXml | public Document toXml(InputStream json) throws IOException, NotImplemented {
JsonReader reader = null;
try {
reader = new JsonReader(new InputStreamReader(json, "utf-8"));
return parse(reader);
} catch (UnsupportedEncodingException e) {
throw new IllegalStateE... | java | public Document toXml(InputStream json) throws IOException, NotImplemented {
JsonReader reader = null;
try {
reader = new JsonReader(new InputStreamReader(json, "utf-8"));
return parse(reader);
} catch (UnsupportedEncodingException e) {
throw new IllegalStateE... | [
"public",
"Document",
"toXml",
"(",
"InputStream",
"json",
")",
"throws",
"IOException",
",",
"NotImplemented",
"{",
"JsonReader",
"reader",
"=",
"null",
";",
"try",
"{",
"reader",
"=",
"new",
"JsonReader",
"(",
"new",
"InputStreamReader",
"(",
"json",
",",
... | First element must be a document
@param json JSON stream
@return XML document | [
"First",
"element",
"must",
"be",
"a",
"document"
] | 94b4cef671bea9b79fb6daa685cd5bf78c222179 | https://github.com/digitalheir/java-xml-to-json/blob/94b4cef671bea9b79fb6daa685cd5bf78c222179/src/main/java/org/leibnizcenter/xml/TerseJson.java#L214-L225 | train |
zalando-stups/booties | misc/github-client-parent/github-client-spring/src/main/java/org/zalando/github/spring/StatusesTemplate.java | StatusesTemplate.getCombinedStatus | @Override
public CombinedStatus getCombinedStatus(String owner, String repository, String ref) {
Map<String, Object> uriVariables = new HashMap<>();
uriVariables.put("owner", owner);
uriVariables.put("repository", repository);
uriVariables.put("ref", ref);
return getRestOperations().exchange(buildUri("/repo... | java | @Override
public CombinedStatus getCombinedStatus(String owner, String repository, String ref) {
Map<String, Object> uriVariables = new HashMap<>();
uriVariables.put("owner", owner);
uriVariables.put("repository", repository);
uriVariables.put("ref", ref);
return getRestOperations().exchange(buildUri("/repo... | [
"@",
"Override",
"public",
"CombinedStatus",
"getCombinedStatus",
"(",
"String",
"owner",
",",
"String",
"repository",
",",
"String",
"ref",
")",
"{",
"Map",
"<",
"String",
",",
"Object",
">",
"uriVariables",
"=",
"new",
"HashMap",
"<>",
"(",
")",
";",
"ur... | 'ref' can be SHA, branch or tag. | [
"ref",
"can",
"be",
"SHA",
"branch",
"or",
"tag",
"."
] | 4147ceccfa3c1b0139df86d86bd10f673b05549f | https://github.com/zalando-stups/booties/blob/4147ceccfa3c1b0139df86d86bd10f673b05549f/misc/github-client-parent/github-client-spring/src/main/java/org/zalando/github/spring/StatusesTemplate.java#L73-L82 | train |
tdomzal/junit-docker-rule | src/main/java/pl/domzal/junit/docker/rule/DockerRule.java | DockerRule.waitForLogMessage | public void waitForLogMessage(final String logSearchString, int waitTime) throws TimeoutException {
WaitForContainer.waitForCondition(new LogChecker(this, logSearchString), waitTime, describe());
} | java | public void waitForLogMessage(final String logSearchString, int waitTime) throws TimeoutException {
WaitForContainer.waitForCondition(new LogChecker(this, logSearchString), waitTime, describe());
} | [
"public",
"void",
"waitForLogMessage",
"(",
"final",
"String",
"logSearchString",
",",
"int",
"waitTime",
")",
"throws",
"TimeoutException",
"{",
"WaitForContainer",
".",
"waitForCondition",
"(",
"new",
"LogChecker",
"(",
"this",
",",
"logSearchString",
")",
",",
... | Stop and wait till given string will show in container output.
@param logSearchString String to wait for in container output.
@param waitTime Wait time.
@throws TimeoutException On wait timeout. | [
"Stop",
"and",
"wait",
"till",
"given",
"string",
"will",
"show",
"in",
"container",
"output",
"."
] | 5a0ba2fd095d201530d3f9e614bc5e88d0afaeb2 | https://github.com/tdomzal/junit-docker-rule/blob/5a0ba2fd095d201530d3f9e614bc5e88d0afaeb2/src/main/java/pl/domzal/junit/docker/rule/DockerRule.java#L361-L363 | train |
tdomzal/junit-docker-rule | src/main/java/pl/domzal/junit/docker/rule/DockerRule.java | DockerRule.waitForExit | public void waitForExit() throws InterruptedException {
try {
dockerClient.waitContainer(container.id());
} catch (DockerException e) {
throw new IllegalStateException(e);
}
} | java | public void waitForExit() throws InterruptedException {
try {
dockerClient.waitContainer(container.id());
} catch (DockerException e) {
throw new IllegalStateException(e);
}
} | [
"public",
"void",
"waitForExit",
"(",
")",
"throws",
"InterruptedException",
"{",
"try",
"{",
"dockerClient",
".",
"waitContainer",
"(",
"container",
".",
"id",
"(",
")",
")",
";",
"}",
"catch",
"(",
"DockerException",
"e",
")",
"{",
"throw",
"new",
"Illeg... | Block until container exit. | [
"Block",
"until",
"container",
"exit",
"."
] | 5a0ba2fd095d201530d3f9e614bc5e88d0afaeb2 | https://github.com/tdomzal/junit-docker-rule/blob/5a0ba2fd095d201530d3f9e614bc5e88d0afaeb2/src/main/java/pl/domzal/junit/docker/rule/DockerRule.java#L368-L374 | train |
tdomzal/junit-docker-rule | src/main/java/pl/domzal/junit/docker/rule/DockerRule.java | DockerRule.getLog | public String getLog() {
try (LogStream stream = dockerClient.logs(container.id(), LogsParam.stdout(), LogsParam.stderr());) {
String fullLog = stream.readFully();
if (log.isTraceEnabled()) {
log.trace("{} full log: {}", containerShortId, StringUtils.replace(fullLog, "\n"... | java | public String getLog() {
try (LogStream stream = dockerClient.logs(container.id(), LogsParam.stdout(), LogsParam.stderr());) {
String fullLog = stream.readFully();
if (log.isTraceEnabled()) {
log.trace("{} full log: {}", containerShortId, StringUtils.replace(fullLog, "\n"... | [
"public",
"String",
"getLog",
"(",
")",
"{",
"try",
"(",
"LogStream",
"stream",
"=",
"dockerClient",
".",
"logs",
"(",
"container",
".",
"id",
"(",
")",
",",
"LogsParam",
".",
"stdout",
"(",
")",
",",
"LogsParam",
".",
"stderr",
"(",
")",
")",
";",
... | Container log. | [
"Container",
"log",
"."
] | 5a0ba2fd095d201530d3f9e614bc5e88d0afaeb2 | https://github.com/tdomzal/junit-docker-rule/blob/5a0ba2fd095d201530d3f9e614bc5e88d0afaeb2/src/main/java/pl/domzal/junit/docker/rule/DockerRule.java#L379-L390 | train |
tdomzal/junit-docker-rule | src/main/java/pl/domzal/junit/docker/rule/DockerRuleBuilder.java | DockerRuleBuilder.keepContainer | public DockerRuleBuilder keepContainer(boolean keepContainer) {
if (keepContainer) {
this.stopOptions.setOptions(StopOption.KEEP);
} else {
this.stopOptions.setOptions(StopOption.REMOVE);
}
return this;
} | java | public DockerRuleBuilder keepContainer(boolean keepContainer) {
if (keepContainer) {
this.stopOptions.setOptions(StopOption.KEEP);
} else {
this.stopOptions.setOptions(StopOption.REMOVE);
}
return this;
} | [
"public",
"DockerRuleBuilder",
"keepContainer",
"(",
"boolean",
"keepContainer",
")",
"{",
"if",
"(",
"keepContainer",
")",
"{",
"this",
".",
"stopOptions",
".",
"setOptions",
"(",
"StopOption",
".",
"KEEP",
")",
";",
"}",
"else",
"{",
"this",
".",
"stopOpti... | Keep stopped container after test.
@deprecated Use {@link #stopOptions(StopOption...)} instead. | [
"Keep",
"stopped",
"container",
"after",
"test",
"."
] | 5a0ba2fd095d201530d3f9e614bc5e88d0afaeb2 | https://github.com/tdomzal/junit-docker-rule/blob/5a0ba2fd095d201530d3f9e614bc5e88d0afaeb2/src/main/java/pl/domzal/junit/docker/rule/DockerRuleBuilder.java#L153-L160 | train |
tdomzal/junit-docker-rule | src/main/java/pl/domzal/junit/docker/rule/DockerRuleBuilder.java | DockerRuleBuilder.env | public DockerRuleBuilder env(String envName, String envValue) {
env.add(String.format("%s=%s", envName, envValue));
return this;
} | java | public DockerRuleBuilder env(String envName, String envValue) {
env.add(String.format("%s=%s", envName, envValue));
return this;
} | [
"public",
"DockerRuleBuilder",
"env",
"(",
"String",
"envName",
",",
"String",
"envValue",
")",
"{",
"env",
".",
"add",
"(",
"String",
".",
"format",
"(",
"\"%s=%s\"",
",",
"envName",
",",
"envValue",
")",
")",
";",
"return",
"this",
";",
"}"
] | Set environment variable in the container. | [
"Set",
"environment",
"variable",
"in",
"the",
"container",
"."
] | 5a0ba2fd095d201530d3f9e614bc5e88d0afaeb2 | https://github.com/tdomzal/junit-docker-rule/blob/5a0ba2fd095d201530d3f9e614bc5e88d0afaeb2/src/main/java/pl/domzal/junit/docker/rule/DockerRuleBuilder.java#L209-L212 | train |
tdomzal/junit-docker-rule | src/main/java/pl/domzal/junit/docker/rule/WaitForContainer.java | WaitForContainer.waitForCondition | static void waitForCondition(final StartConditionCheck condition, int timeoutSeconds, final String containerDescription) throws TimeoutException {
try {
log.info("wait for {} started", condition.describe());
new WaitForUnit(TimeUnit.SECONDS, timeoutSeconds, TimeUnit.SECONDS, 1, new WaitF... | java | static void waitForCondition(final StartConditionCheck condition, int timeoutSeconds, final String containerDescription) throws TimeoutException {
try {
log.info("wait for {} started", condition.describe());
new WaitForUnit(TimeUnit.SECONDS, timeoutSeconds, TimeUnit.SECONDS, 1, new WaitF... | [
"static",
"void",
"waitForCondition",
"(",
"final",
"StartConditionCheck",
"condition",
",",
"int",
"timeoutSeconds",
",",
"final",
"String",
"containerDescription",
")",
"throws",
"TimeoutException",
"{",
"try",
"{",
"log",
".",
"info",
"(",
"\"wait for {} started\""... | Wait till all given conditions are met.
@param condition Conditions to wait for - all must be met to continue.
@param timeoutSeconds Wait timeout.
@param containerDescription Container description. For log and exception message usage only. | [
"Wait",
"till",
"all",
"given",
"conditions",
"are",
"met",
"."
] | 5a0ba2fd095d201530d3f9e614bc5e88d0afaeb2 | https://github.com/tdomzal/junit-docker-rule/blob/5a0ba2fd095d201530d3f9e614bc5e88d0afaeb2/src/main/java/pl/domzal/junit/docker/rule/WaitForContainer.java#L25-L42 | train |
paymill/paymill-java | src/main/java/com/paymill/services/ClientService.java | ClientService.update | public void update( Client client ) {
RestfulUtils.update( ClientService.PATH, client, Client.class, super.httpClient );
} | java | public void update( Client client ) {
RestfulUtils.update( ClientService.PATH, client, Client.class, super.httpClient );
} | [
"public",
"void",
"update",
"(",
"Client",
"client",
")",
"{",
"RestfulUtils",
".",
"update",
"(",
"ClientService",
".",
"PATH",
",",
"client",
",",
"Client",
".",
"class",
",",
"super",
".",
"httpClient",
")",
";",
"}"
] | This function updates the data of a client. To change only a specific attribute you can set this attribute in the update
request. All other attributes that should not be edited are not inserted. You can only edit the description, email and credit
card. The subscription can not be changed by updating the client data. Th... | [
"This",
"function",
"updates",
"the",
"data",
"of",
"a",
"client",
".",
"To",
"change",
"only",
"a",
"specific",
"attribute",
"you",
"can",
"set",
"this",
"attribute",
"in",
"the",
"update",
"request",
".",
"All",
"other",
"attributes",
"that",
"should",
"... | 17281a0d4376c76f1711af9f09bfc138c90ba65a | https://github.com/paymill/paymill-java/blob/17281a0d4376c76f1711af9f09bfc138c90ba65a/src/main/java/com/paymill/services/ClientService.java#L149-L151 | train |
paymill/paymill-java | src/main/java/com/paymill/services/ClientService.java | ClientService.delete | public void delete( Client client ) {
RestfulUtils.delete( ClientService.PATH, client, Client.class, super.httpClient );
} | java | public void delete( Client client ) {
RestfulUtils.delete( ClientService.PATH, client, Client.class, super.httpClient );
} | [
"public",
"void",
"delete",
"(",
"Client",
"client",
")",
"{",
"RestfulUtils",
".",
"delete",
"(",
"ClientService",
".",
"PATH",
",",
"client",
",",
"Client",
".",
"class",
",",
"super",
".",
"httpClient",
")",
";",
"}"
] | This function deletes a client, but its transactions are not deleted.
@param client
A {@link Client} with Id. | [
"This",
"function",
"deletes",
"a",
"client",
"but",
"its",
"transactions",
"are",
"not",
"deleted",
"."
] | 17281a0d4376c76f1711af9f09bfc138c90ba65a | https://github.com/paymill/paymill-java/blob/17281a0d4376c76f1711af9f09bfc138c90ba65a/src/main/java/com/paymill/services/ClientService.java#L158-L160 | train |
paymill/paymill-java | src/main/java/com/paymill/services/PreauthorizationService.java | PreauthorizationService.delete | public void delete( final Preauthorization preauthorization ) {
RestfulUtils.delete( PreauthorizationService.PATH, preauthorization, Preauthorization.class, super.httpClient );
} | java | public void delete( final Preauthorization preauthorization ) {
RestfulUtils.delete( PreauthorizationService.PATH, preauthorization, Preauthorization.class, super.httpClient );
} | [
"public",
"void",
"delete",
"(",
"final",
"Preauthorization",
"preauthorization",
")",
"{",
"RestfulUtils",
".",
"delete",
"(",
"PreauthorizationService",
".",
"PATH",
",",
"preauthorization",
",",
"Preauthorization",
".",
"class",
",",
"super",
".",
"httpClient",
... | This function deletes a preauthorization.
@param preauthorization
The {@link Preauthorization} object to be deleted. | [
"This",
"function",
"deletes",
"a",
"preauthorization",
"."
] | 17281a0d4376c76f1711af9f09bfc138c90ba65a | https://github.com/paymill/paymill-java/blob/17281a0d4376c76f1711af9f09bfc138c90ba65a/src/main/java/com/paymill/services/PreauthorizationService.java#L196-L198 | train |
paymill/paymill-java | src/main/java/com/paymill/services/OfferService.java | OfferService.delete | public void delete(Offer offer, boolean removeWithSubscriptions) {
ParameterMap<String, String> params = new ParameterMap<String, String>();
params.add("remove_with_subscriptions", String.valueOf(removeWithSubscriptions));
RestfulUtils.delete(OfferService.PATH, offer, params, Offer.class, super.... | java | public void delete(Offer offer, boolean removeWithSubscriptions) {
ParameterMap<String, String> params = new ParameterMap<String, String>();
params.add("remove_with_subscriptions", String.valueOf(removeWithSubscriptions));
RestfulUtils.delete(OfferService.PATH, offer, params, Offer.class, super.... | [
"public",
"void",
"delete",
"(",
"Offer",
"offer",
",",
"boolean",
"removeWithSubscriptions",
")",
"{",
"ParameterMap",
"<",
"String",
",",
"String",
">",
"params",
"=",
"new",
"ParameterMap",
"<",
"String",
",",
"String",
">",
"(",
")",
";",
"params",
"."... | Remove an offer.
@param offer the {@link Offer}.
@param removeWithSubscriptions if true, the plan and all subscriptions associated with it will be deleted. If
false, only the plan will be deleted. | [
"Remove",
"an",
"offer",
"."
] | 17281a0d4376c76f1711af9f09bfc138c90ba65a | https://github.com/paymill/paymill-java/blob/17281a0d4376c76f1711af9f09bfc138c90ba65a/src/main/java/com/paymill/services/OfferService.java#L193-L197 | train |
apptik/JustJson | json-schema/src/main/java/io/apptik/json/schema/Schema.java | Schema.setId | public <O extends Schema> O setId(String schemaId) {
getJson().put("id", schemaId);
return (O)this;
} | java | public <O extends Schema> O setId(String schemaId) {
getJson().put("id", schemaId);
return (O)this;
} | [
"public",
"<",
"O",
"extends",
"Schema",
">",
"O",
"setId",
"(",
"String",
"schemaId",
")",
"{",
"getJson",
"(",
")",
".",
"put",
"(",
"\"id\"",
",",
"schemaId",
")",
";",
"return",
"(",
"O",
")",
"this",
";",
"}"
] | Should be URI
@param schemaId
@param <O>
@return | [
"Should",
"be",
"URI"
] | c90f0dd7f84df26da4749be8cd9b026fff499a79 | https://github.com/apptik/JustJson/blob/c90f0dd7f84df26da4749be8cd9b026fff499a79/json-schema/src/main/java/io/apptik/json/schema/Schema.java#L245-L248 | train |
apptik/JustJson | json-schema/src/main/java/io/apptik/json/schema/validation/CommonMatchers.java | CommonMatchers.withCharsLessOrEqualTo | public static Matcher<JsonElement> withCharsLessOrEqualTo(final int value) {
return new TypeSafeDiagnosingMatcher<JsonElement>() {
@Override
protected boolean matchesSafely(JsonElement item, Description mismatchDescription) {
//we do not care for the properties if parent... | java | public static Matcher<JsonElement> withCharsLessOrEqualTo(final int value) {
return new TypeSafeDiagnosingMatcher<JsonElement>() {
@Override
protected boolean matchesSafely(JsonElement item, Description mismatchDescription) {
//we do not care for the properties if parent... | [
"public",
"static",
"Matcher",
"<",
"JsonElement",
">",
"withCharsLessOrEqualTo",
"(",
"final",
"int",
"value",
")",
"{",
"return",
"new",
"TypeSafeDiagnosingMatcher",
"<",
"JsonElement",
">",
"(",
")",
"{",
"@",
"Override",
"protected",
"boolean",
"matchesSafely"... | ==> STRING ==> | [
"==",
">",
"STRING",
"==",
">"
] | c90f0dd7f84df26da4749be8cd9b026fff499a79 | https://github.com/apptik/JustJson/blob/c90f0dd7f84df26da4749be8cd9b026fff499a79/json-schema/src/main/java/io/apptik/json/schema/validation/CommonMatchers.java#L40-L59 | train |
apptik/JustJson | json-schema/src/main/java/io/apptik/json/schema/validation/CommonMatchers.java | CommonMatchers.isOfType | public static Matcher<JsonElement> isOfType(final String type) {
return new TypeSafeDiagnosingMatcher<JsonElement>() {
@Override
protected boolean matchesSafely(JsonElement item, Description mismatchDescription) {
if (type.equals(item.getJsonType()))
r... | java | public static Matcher<JsonElement> isOfType(final String type) {
return new TypeSafeDiagnosingMatcher<JsonElement>() {
@Override
protected boolean matchesSafely(JsonElement item, Description mismatchDescription) {
if (type.equals(item.getJsonType()))
r... | [
"public",
"static",
"Matcher",
"<",
"JsonElement",
">",
"isOfType",
"(",
"final",
"String",
"type",
")",
"{",
"return",
"new",
"TypeSafeDiagnosingMatcher",
"<",
"JsonElement",
">",
"(",
")",
"{",
"@",
"Override",
"protected",
"boolean",
"matchesSafely",
"(",
"... | ==> COMMON ==> | [
"==",
">",
"COMMON",
"==",
">"
] | c90f0dd7f84df26da4749be8cd9b026fff499a79 | https://github.com/apptik/JustJson/blob/c90f0dd7f84df26da4749be8cd9b026fff499a79/json-schema/src/main/java/io/apptik/json/schema/validation/CommonMatchers.java#L220-L237 | train |
apptik/JustJson | json-schema/src/main/java/io/apptik/json/schema/validation/CommonMatchers.java | CommonMatchers.areItemsValid | public static Matcher<JsonElement> areItemsValid(final Validator validator) {
return new TypeSafeDiagnosingMatcher<JsonElement>() {
@Override
protected boolean matchesSafely(JsonElement item, Description mismatchDescription) {
//we do not care for the properties if parent... | java | public static Matcher<JsonElement> areItemsValid(final Validator validator) {
return new TypeSafeDiagnosingMatcher<JsonElement>() {
@Override
protected boolean matchesSafely(JsonElement item, Description mismatchDescription) {
//we do not care for the properties if parent... | [
"public",
"static",
"Matcher",
"<",
"JsonElement",
">",
"areItemsValid",
"(",
"final",
"Validator",
"validator",
")",
"{",
"return",
"new",
"TypeSafeDiagnosingMatcher",
"<",
"JsonElement",
">",
"(",
")",
"{",
"@",
"Override",
"protected",
"boolean",
"matchesSafely... | ==> ARRAY ==> | [
"==",
">",
"ARRAY",
"==",
">"
] | c90f0dd7f84df26da4749be8cd9b026fff499a79 | https://github.com/apptik/JustJson/blob/c90f0dd7f84df26da4749be8cd9b026fff499a79/json-schema/src/main/java/io/apptik/json/schema/validation/CommonMatchers.java#L282-L306 | train |
apptik/JustJson | json-schema/src/main/java/io/apptik/json/schema/validation/CommonMatchers.java | CommonMatchers.maxProperties | public static Matcher<JsonElement> maxProperties(final int maxProperties) {
return new TypeSafeDiagnosingMatcher<JsonElement>() {
@Override
protected boolean matchesSafely(JsonElement item, Description mismatchDescription) {
//we do not care for the properties if parent i... | java | public static Matcher<JsonElement> maxProperties(final int maxProperties) {
return new TypeSafeDiagnosingMatcher<JsonElement>() {
@Override
protected boolean matchesSafely(JsonElement item, Description mismatchDescription) {
//we do not care for the properties if parent i... | [
"public",
"static",
"Matcher",
"<",
"JsonElement",
">",
"maxProperties",
"(",
"final",
"int",
"maxProperties",
")",
"{",
"return",
"new",
"TypeSafeDiagnosingMatcher",
"<",
"JsonElement",
">",
"(",
")",
"{",
"@",
"Override",
"protected",
"boolean",
"matchesSafely",... | ==> OBJECT ==> | [
"==",
">",
"OBJECT",
"==",
">"
] | c90f0dd7f84df26da4749be8cd9b026fff499a79 | https://github.com/apptik/JustJson/blob/c90f0dd7f84df26da4749be8cd9b026fff499a79/json-schema/src/main/java/io/apptik/json/schema/validation/CommonMatchers.java#L426-L447 | train |
apptik/JustJson | json-core/src/main/java/io/apptik/json/JsonElement.java | JsonElement.wrap | public static JsonElement wrap(Object o) throws JsonException {
if (o == null) {
//null value means not specified i.e.-> no valued will be mapped
//Json.null is specific value
return null;
}
if (o instanceof JsonElement) {
return (JsonElement) o;
... | java | public static JsonElement wrap(Object o) throws JsonException {
if (o == null) {
//null value means not specified i.e.-> no valued will be mapped
//Json.null is specific value
return null;
}
if (o instanceof JsonElement) {
return (JsonElement) o;
... | [
"public",
"static",
"JsonElement",
"wrap",
"(",
"Object",
"o",
")",
"throws",
"JsonException",
"{",
"if",
"(",
"o",
"==",
"null",
")",
"{",
"//null value means not specified i.e.-> no valued will be mapped",
"//Json.null is specific value",
"return",
"null",
";",
"}",
... | Wraps the given object if to JsonXXX object. | [
"Wraps",
"the",
"given",
"object",
"if",
"to",
"JsonXXX",
"object",
"."
] | c90f0dd7f84df26da4749be8cd9b026fff499a79 | https://github.com/apptik/JustJson/blob/c90f0dd7f84df26da4749be8cd9b026fff499a79/json-core/src/main/java/io/apptik/json/JsonElement.java#L129-L166 | train |
apptik/JustJson | json-schema/src/main/java/io/apptik/json/schema/fetch/SchemaUriFetcher.java | SchemaUriFetcher.fetch | @Override
public Schema fetch(URI targetUri, URI srcOrigUri, URI srcId) {
Schema res = null;
URI schemaUri = convertUri(resolveUri(targetUri, srcOrigUri, srcId));
if(!schemaUri.isAbsolute()) throw new RuntimeException("Json Schema Fetcher works only with absolute URIs");
try {
... | java | @Override
public Schema fetch(URI targetUri, URI srcOrigUri, URI srcId) {
Schema res = null;
URI schemaUri = convertUri(resolveUri(targetUri, srcOrigUri, srcId));
if(!schemaUri.isAbsolute()) throw new RuntimeException("Json Schema Fetcher works only with absolute URIs");
try {
... | [
"@",
"Override",
"public",
"Schema",
"fetch",
"(",
"URI",
"targetUri",
",",
"URI",
"srcOrigUri",
",",
"URI",
"srcId",
")",
"{",
"Schema",
"res",
"=",
"null",
";",
"URI",
"schemaUri",
"=",
"convertUri",
"(",
"resolveUri",
"(",
"targetUri",
",",
"srcOrigUri"... | accepts only absolute URI or converted absolute URI | [
"accepts",
"only",
"absolute",
"URI",
"or",
"converted",
"absolute",
"URI"
] | c90f0dd7f84df26da4749be8cd9b026fff499a79 | https://github.com/apptik/JustJson/blob/c90f0dd7f84df26da4749be8cd9b026fff499a79/json-schema/src/main/java/io/apptik/json/schema/fetch/SchemaUriFetcher.java#L88-L120 | train |
apptik/JustJson | json-wrapper/src/main/java/io/apptik/json/wrapper/JsonElementWrapper.java | JsonElementWrapper.tryFetchMetaInfo | private MetaInfo tryFetchMetaInfo(URI jsonSchemaUri) {
if (jsonSchemaUri == null) return null;
try {
metaInfo = doFetchMetaInfo(jsonSchemaUri);
Validator validator = metaInfo.getDefaultValidator();
if (validator != null) {
getValidators().add(validator... | java | private MetaInfo tryFetchMetaInfo(URI jsonSchemaUri) {
if (jsonSchemaUri == null) return null;
try {
metaInfo = doFetchMetaInfo(jsonSchemaUri);
Validator validator = metaInfo.getDefaultValidator();
if (validator != null) {
getValidators().add(validator... | [
"private",
"MetaInfo",
"tryFetchMetaInfo",
"(",
"URI",
"jsonSchemaUri",
")",
"{",
"if",
"(",
"jsonSchemaUri",
"==",
"null",
")",
"return",
"null",
";",
"try",
"{",
"metaInfo",
"=",
"doFetchMetaInfo",
"(",
"jsonSchemaUri",
")",
";",
"Validator",
"validator",
"=... | Tries to fetch a schema and add the default Schema validator for it
@param jsonSchemaUri
@return | [
"Tries",
"to",
"fetch",
"a",
"schema",
"and",
"add",
"the",
"default",
"Schema",
"validator",
"for",
"it"
] | c90f0dd7f84df26da4749be8cd9b026fff499a79 | https://github.com/apptik/JustJson/blob/c90f0dd7f84df26da4749be8cd9b026fff499a79/json-wrapper/src/main/java/io/apptik/json/wrapper/JsonElementWrapper.java#L109-L122 | train |
apptik/JustJson | json-core/src/main/java/io/apptik/json/util/Util.java | Util.numberToString | public static String numberToString(Number number) throws JsonException {
if (number == null) {
throw new JsonException("Number must be non-null");
}
double doubleValue = number.doubleValue();
// the original returns "-0" instead of "-0.0" for negative zero
if (numb... | java | public static String numberToString(Number number) throws JsonException {
if (number == null) {
throw new JsonException("Number must be non-null");
}
double doubleValue = number.doubleValue();
// the original returns "-0" instead of "-0.0" for negative zero
if (numb... | [
"public",
"static",
"String",
"numberToString",
"(",
"Number",
"number",
")",
"throws",
"JsonException",
"{",
"if",
"(",
"number",
"==",
"null",
")",
"{",
"throw",
"new",
"JsonException",
"(",
"\"Number must be non-null\"",
")",
";",
"}",
"double",
"doubleValue"... | Encodes the number as a Json string.
@param number a finite value. May not be {@link Double#isNaN() NaNs} or
{@link Double#isInfinite() infinities}. | [
"Encodes",
"the",
"number",
"as",
"a",
"Json",
"string",
"."
] | c90f0dd7f84df26da4749be8cd9b026fff499a79 | https://github.com/apptik/JustJson/blob/c90f0dd7f84df26da4749be8cd9b026fff499a79/json-core/src/main/java/io/apptik/json/util/Util.java#L137-L155 | train |
apptik/JustJson | json-core/src/main/java/io/apptik/json/JsonObject.java | JsonObject.merge | public JsonObject merge(JsonObject another) {
for (Map.Entry<String, JsonElement> anotherEntry : another) {
JsonElement curr = this.opt(anotherEntry.getKey());
if (curr == null) {
try {
this.put(anotherEntry.getKey(), anotherEntry.getValue());
... | java | public JsonObject merge(JsonObject another) {
for (Map.Entry<String, JsonElement> anotherEntry : another) {
JsonElement curr = this.opt(anotherEntry.getKey());
if (curr == null) {
try {
this.put(anotherEntry.getKey(), anotherEntry.getValue());
... | [
"public",
"JsonObject",
"merge",
"(",
"JsonObject",
"another",
")",
"{",
"for",
"(",
"Map",
".",
"Entry",
"<",
"String",
",",
"JsonElement",
">",
"anotherEntry",
":",
"another",
")",
"{",
"JsonElement",
"curr",
"=",
"this",
".",
"opt",
"(",
"anotherEntry",... | Merge Json Object with another Json Object.
It does not change element of another with the same name exists.
However if the element is Json Object then it will go down and merge that object.
@param another
@return | [
"Merge",
"Json",
"Object",
"with",
"another",
"Json",
"Object",
".",
"It",
"does",
"not",
"change",
"element",
"of",
"another",
"with",
"the",
"same",
"name",
"exists",
".",
"However",
"if",
"the",
"element",
"is",
"Json",
"Object",
"then",
"it",
"will",
... | c90f0dd7f84df26da4749be8cd9b026fff499a79 | https://github.com/apptik/JustJson/blob/c90f0dd7f84df26da4749be8cd9b026fff499a79/json-core/src/main/java/io/apptik/json/JsonObject.java#L783-L797 | train |
marklogic/marklogic-sesame | marklogic-sesame/src/main/java/com/marklogic/semantics/sesame/client/MarkLogicClient.java | MarkLogicClient.sync | public void sync() throws MarkLogicSesameException {
if(WRITE_CACHE_ENABLED && timerWriteCache != null)
timerWriteCache.forceRun();
if(DELETE_CACHE_ENABLED && timerDeleteCache != null)
timerDeleteCache.forceRun();
} | java | public void sync() throws MarkLogicSesameException {
if(WRITE_CACHE_ENABLED && timerWriteCache != null)
timerWriteCache.forceRun();
if(DELETE_CACHE_ENABLED && timerDeleteCache != null)
timerDeleteCache.forceRun();
} | [
"public",
"void",
"sync",
"(",
")",
"throws",
"MarkLogicSesameException",
"{",
"if",
"(",
"WRITE_CACHE_ENABLED",
"&&",
"timerWriteCache",
"!=",
"null",
")",
"timerWriteCache",
".",
"forceRun",
"(",
")",
";",
"if",
"(",
"DELETE_CACHE_ENABLED",
"&&",
"timerDeleteCac... | forces write cache to flush triples
@throws MarkLogicSesameException | [
"forces",
"write",
"cache",
"to",
"flush",
"triples"
] | d5b668ed2b3d5e90c9f1d5096012813c272062a2 | https://github.com/marklogic/marklogic-sesame/blob/d5b668ed2b3d5e90c9f1d5096012813c272062a2/marklogic-sesame/src/main/java/com/marklogic/semantics/sesame/client/MarkLogicClient.java#L171-L176 | train |
marklogic/marklogic-sesame | marklogic-sesame/src/main/java/com/marklogic/semantics/sesame/client/MarkLogicClient.java | MarkLogicClient.sendAdd | public void sendAdd(File file, String baseURI, RDFFormat dataFormat, Resource... contexts) throws RDFParseException {
getClient().performAdd(file, baseURI, dataFormat, this.tx, contexts);
} | java | public void sendAdd(File file, String baseURI, RDFFormat dataFormat, Resource... contexts) throws RDFParseException {
getClient().performAdd(file, baseURI, dataFormat, this.tx, contexts);
} | [
"public",
"void",
"sendAdd",
"(",
"File",
"file",
",",
"String",
"baseURI",
",",
"RDFFormat",
"dataFormat",
",",
"Resource",
"...",
"contexts",
")",
"throws",
"RDFParseException",
"{",
"getClient",
"(",
")",
".",
"performAdd",
"(",
"file",
",",
"baseURI",
",... | add triples from file
@param file
@param baseURI
@param dataFormat
@param contexts
@throws RDFParseException | [
"add",
"triples",
"from",
"file"
] | d5b668ed2b3d5e90c9f1d5096012813c272062a2 | https://github.com/marklogic/marklogic-sesame/blob/d5b668ed2b3d5e90c9f1d5096012813c272062a2/marklogic-sesame/src/main/java/com/marklogic/semantics/sesame/client/MarkLogicClient.java#L302-L304 | train |
marklogic/marklogic-sesame | marklogic-sesame/src/main/java/com/marklogic/semantics/sesame/client/MarkLogicClient.java | MarkLogicClient.sendAdd | public void sendAdd(InputStream in, String baseURI, RDFFormat dataFormat, Resource... contexts) throws RDFParseException, MarkLogicSesameException {
getClient().performAdd(in, baseURI, dataFormat, this.tx, contexts);
} | java | public void sendAdd(InputStream in, String baseURI, RDFFormat dataFormat, Resource... contexts) throws RDFParseException, MarkLogicSesameException {
getClient().performAdd(in, baseURI, dataFormat, this.tx, contexts);
} | [
"public",
"void",
"sendAdd",
"(",
"InputStream",
"in",
",",
"String",
"baseURI",
",",
"RDFFormat",
"dataFormat",
",",
"Resource",
"...",
"contexts",
")",
"throws",
"RDFParseException",
",",
"MarkLogicSesameException",
"{",
"getClient",
"(",
")",
".",
"performAdd",... | add triples from InputStream
@param in
@param baseURI
@param dataFormat
@param contexts | [
"add",
"triples",
"from",
"InputStream"
] | d5b668ed2b3d5e90c9f1d5096012813c272062a2 | https://github.com/marklogic/marklogic-sesame/blob/d5b668ed2b3d5e90c9f1d5096012813c272062a2/marklogic-sesame/src/main/java/com/marklogic/semantics/sesame/client/MarkLogicClient.java#L314-L316 | train |
marklogic/marklogic-sesame | marklogic-sesame/src/main/java/com/marklogic/semantics/sesame/client/MarkLogicClient.java | MarkLogicClient.sendAdd | public void sendAdd(String baseURI, Resource subject, URI predicate, Value object, Resource... contexts) throws MarkLogicSesameException {
if (WRITE_CACHE_ENABLED) {
timerWriteCache.add(subject, predicate, object, contexts);
} else {
getClient().performAdd(baseURI, (Resource) skolemize(subject), (URI) skolemi... | java | public void sendAdd(String baseURI, Resource subject, URI predicate, Value object, Resource... contexts) throws MarkLogicSesameException {
if (WRITE_CACHE_ENABLED) {
timerWriteCache.add(subject, predicate, object, contexts);
} else {
getClient().performAdd(baseURI, (Resource) skolemize(subject), (URI) skolemi... | [
"public",
"void",
"sendAdd",
"(",
"String",
"baseURI",
",",
"Resource",
"subject",
",",
"URI",
"predicate",
",",
"Value",
"object",
",",
"Resource",
"...",
"contexts",
")",
"throws",
"MarkLogicSesameException",
"{",
"if",
"(",
"WRITE_CACHE_ENABLED",
")",
"{",
... | add single triple, if cache is enabled will add triple to cache model
@param baseURI
@param subject
@param predicate
@param object
@param contexts | [
"add",
"single",
"triple",
"if",
"cache",
"is",
"enabled",
"will",
"add",
"triple",
"to",
"cache",
"model"
] | d5b668ed2b3d5e90c9f1d5096012813c272062a2 | https://github.com/marklogic/marklogic-sesame/blob/d5b668ed2b3d5e90c9f1d5096012813c272062a2/marklogic-sesame/src/main/java/com/marklogic/semantics/sesame/client/MarkLogicClient.java#L340-L346 | train |
marklogic/marklogic-sesame | marklogic-sesame/src/main/java/com/marklogic/semantics/sesame/client/MarkLogicClient.java | MarkLogicClient.sendRemove | public void sendRemove(String baseURI, Resource subject,URI predicate, Value object, Resource... contexts) throws MarkLogicSesameException {
if (DELETE_CACHE_ENABLED) {
timerDeleteCache.add(subject, predicate, object, contexts);
} else {
if (WRITE_CACHE_ENABLED)
sync();
getClient().performRemove(baseUR... | java | public void sendRemove(String baseURI, Resource subject,URI predicate, Value object, Resource... contexts) throws MarkLogicSesameException {
if (DELETE_CACHE_ENABLED) {
timerDeleteCache.add(subject, predicate, object, contexts);
} else {
if (WRITE_CACHE_ENABLED)
sync();
getClient().performRemove(baseUR... | [
"public",
"void",
"sendRemove",
"(",
"String",
"baseURI",
",",
"Resource",
"subject",
",",
"URI",
"predicate",
",",
"Value",
"object",
",",
"Resource",
"...",
"contexts",
")",
"throws",
"MarkLogicSesameException",
"{",
"if",
"(",
"DELETE_CACHE_ENABLED",
")",
"{"... | remove single triple
@param baseURI
@param subject
@param predicate
@param object
@param contexts | [
"remove",
"single",
"triple"
] | d5b668ed2b3d5e90c9f1d5096012813c272062a2 | https://github.com/marklogic/marklogic-sesame/blob/d5b668ed2b3d5e90c9f1d5096012813c272062a2/marklogic-sesame/src/main/java/com/marklogic/semantics/sesame/client/MarkLogicClient.java#L357-L365 | train |
marklogic/marklogic-sesame | marklogic-sesame/src/main/java/com/marklogic/semantics/sesame/client/MarkLogicClient.java | MarkLogicClient.commitTransaction | public void commitTransaction() throws MarkLogicTransactionException {
if (isActiveTransaction()) {
try {
sync();
this.tx.commit();
this.tx=null;
} catch (MarkLogicSesameException e) {
logger.error(e.getLocalizedMessage());
throw new MarkLogicTransactionException(e);
}
}else{
throw n... | java | public void commitTransaction() throws MarkLogicTransactionException {
if (isActiveTransaction()) {
try {
sync();
this.tx.commit();
this.tx=null;
} catch (MarkLogicSesameException e) {
logger.error(e.getLocalizedMessage());
throw new MarkLogicTransactionException(e);
}
}else{
throw n... | [
"public",
"void",
"commitTransaction",
"(",
")",
"throws",
"MarkLogicTransactionException",
"{",
"if",
"(",
"isActiveTransaction",
"(",
")",
")",
"{",
"try",
"{",
"sync",
"(",
")",
";",
"this",
".",
"tx",
".",
"commit",
"(",
")",
";",
"this",
".",
"tx",
... | commits a transaction
@throws MarkLogicTransactionException | [
"commits",
"a",
"transaction"
] | d5b668ed2b3d5e90c9f1d5096012813c272062a2 | https://github.com/marklogic/marklogic-sesame/blob/d5b668ed2b3d5e90c9f1d5096012813c272062a2/marklogic-sesame/src/main/java/com/marklogic/semantics/sesame/client/MarkLogicClient.java#L402-L415 | train |
marklogic/marklogic-sesame | marklogic-sesame/src/main/java/com/marklogic/semantics/sesame/client/MarkLogicClient.java | MarkLogicClient.setGraphPerms | public void setGraphPerms(GraphPermissions graphPerms){
if (graphPerms != null) {
getClient().setGraphPerms(graphPerms);
}else {
getClient().setGraphPerms(getClient().getDatabaseClient().newGraphManager().newGraphPermissions());
}
} | java | public void setGraphPerms(GraphPermissions graphPerms){
if (graphPerms != null) {
getClient().setGraphPerms(graphPerms);
}else {
getClient().setGraphPerms(getClient().getDatabaseClient().newGraphManager().newGraphPermissions());
}
} | [
"public",
"void",
"setGraphPerms",
"(",
"GraphPermissions",
"graphPerms",
")",
"{",
"if",
"(",
"graphPerms",
"!=",
"null",
")",
"{",
"getClient",
"(",
")",
".",
"setGraphPerms",
"(",
"graphPerms",
")",
";",
"}",
"else",
"{",
"getClient",
"(",
")",
".",
"... | setter for GraphPermissions
@param graphPerms | [
"setter",
"for",
"GraphPermissions"
] | d5b668ed2b3d5e90c9f1d5096012813c272062a2 | https://github.com/marklogic/marklogic-sesame/blob/d5b668ed2b3d5e90c9f1d5096012813c272062a2/marklogic-sesame/src/main/java/com/marklogic/semantics/sesame/client/MarkLogicClient.java#L517-L524 | train |
marklogic/marklogic-sesame | marklogic-sesame/src/main/java/com/marklogic/semantics/sesame/MarkLogicRepository.java | MarkLogicRepository.getMarkLogicClient | @Override
public synchronized MarkLogicClient getMarkLogicClient() {
if(null != databaseClient){
this.client = new MarkLogicClient(databaseClient);
}else{
this.client = new MarkLogicClient(host, port, user, password, auth);
}
return this.client;
} | java | @Override
public synchronized MarkLogicClient getMarkLogicClient() {
if(null != databaseClient){
this.client = new MarkLogicClient(databaseClient);
}else{
this.client = new MarkLogicClient(host, port, user, password, auth);
}
return this.client;
} | [
"@",
"Override",
"public",
"synchronized",
"MarkLogicClient",
"getMarkLogicClient",
"(",
")",
"{",
"if",
"(",
"null",
"!=",
"databaseClient",
")",
"{",
"this",
".",
"client",
"=",
"new",
"MarkLogicClient",
"(",
"databaseClient",
")",
";",
"}",
"else",
"{",
"... | returns MarkLogicClient object which manages communication to ML server via Java api client
@return MarkLogicClient | [
"returns",
"MarkLogicClient",
"object",
"which",
"manages",
"communication",
"to",
"ML",
"server",
"via",
"Java",
"api",
"client"
] | d5b668ed2b3d5e90c9f1d5096012813c272062a2 | https://github.com/marklogic/marklogic-sesame/blob/d5b668ed2b3d5e90c9f1d5096012813c272062a2/marklogic-sesame/src/main/java/com/marklogic/semantics/sesame/MarkLogicRepository.java#L231-L239 | train |
marklogic/marklogic-sesame | marklogic-sesame/src/main/java/com/marklogic/semantics/sesame/client/MarkLogicClientImpl.java | MarkLogicClientImpl.setDatabaseClient | private void setDatabaseClient(DatabaseClient databaseClient) {
this.databaseClient = databaseClient;
this.sparqlManager = getDatabaseClient().newSPARQLQueryManager();
this.graphManager = getDatabaseClient().newGraphManager();
} | java | private void setDatabaseClient(DatabaseClient databaseClient) {
this.databaseClient = databaseClient;
this.sparqlManager = getDatabaseClient().newSPARQLQueryManager();
this.graphManager = getDatabaseClient().newGraphManager();
} | [
"private",
"void",
"setDatabaseClient",
"(",
"DatabaseClient",
"databaseClient",
")",
"{",
"this",
".",
"databaseClient",
"=",
"databaseClient",
";",
"this",
".",
"sparqlManager",
"=",
"getDatabaseClient",
"(",
")",
".",
"newSPARQLQueryManager",
"(",
")",
";",
"th... | set databaseclient and instantate related managers
@param databaseClient | [
"set",
"databaseclient",
"and",
"instantate",
"related",
"managers"
] | d5b668ed2b3d5e90c9f1d5096012813c272062a2 | https://github.com/marklogic/marklogic-sesame/blob/d5b668ed2b3d5e90c9f1d5096012813c272062a2/marklogic-sesame/src/main/java/com/marklogic/semantics/sesame/client/MarkLogicClientImpl.java#L107-L111 | train |
marklogic/marklogic-sesame | marklogic-sesame/src/main/java/com/marklogic/semantics/sesame/client/MarkLogicClientImpl.java | MarkLogicClientImpl.performAdd | public void performAdd(File file, String baseURI, RDFFormat dataFormat, Transaction tx, Resource... contexts) throws RDFParseException {
try {
graphManager.setDefaultMimetype(dataFormat.getDefaultMIMEType());
if (dataFormat.equals(RDFFormat.NQUADS) || dataFormat.equals(RDFFormat.TRIG)) {... | java | public void performAdd(File file, String baseURI, RDFFormat dataFormat, Transaction tx, Resource... contexts) throws RDFParseException {
try {
graphManager.setDefaultMimetype(dataFormat.getDefaultMIMEType());
if (dataFormat.equals(RDFFormat.NQUADS) || dataFormat.equals(RDFFormat.TRIG)) {... | [
"public",
"void",
"performAdd",
"(",
"File",
"file",
",",
"String",
"baseURI",
",",
"RDFFormat",
"dataFormat",
",",
"Transaction",
"tx",
",",
"Resource",
"...",
"contexts",
")",
"throws",
"RDFParseException",
"{",
"try",
"{",
"graphManager",
".",
"setDefaultMime... | as we use mergeGraphs, baseURI is always file.toURI | [
"as",
"we",
"use",
"mergeGraphs",
"baseURI",
"is",
"always",
"file",
".",
"toURI"
] | d5b668ed2b3d5e90c9f1d5096012813c272062a2 | https://github.com/marklogic/marklogic-sesame/blob/d5b668ed2b3d5e90c9f1d5096012813c272062a2/marklogic-sesame/src/main/java/com/marklogic/semantics/sesame/client/MarkLogicClientImpl.java#L275-L297 | train |
marklogic/marklogic-sesame | marklogic-sesame/src/main/java/com/marklogic/semantics/sesame/client/MarkLogicClientImpl.java | MarkLogicClientImpl.performAdd | public void performAdd(InputStream in, String baseURI, RDFFormat dataFormat, Transaction tx, Resource... contexts) throws RDFParseException, MarkLogicSesameException {
try {
graphManager.setDefaultMimetype(dataFormat.getDefaultMIMEType());
if (dataFormat.equals(RDFFormat.NQUADS) || dataF... | java | public void performAdd(InputStream in, String baseURI, RDFFormat dataFormat, Transaction tx, Resource... contexts) throws RDFParseException, MarkLogicSesameException {
try {
graphManager.setDefaultMimetype(dataFormat.getDefaultMIMEType());
if (dataFormat.equals(RDFFormat.NQUADS) || dataF... | [
"public",
"void",
"performAdd",
"(",
"InputStream",
"in",
",",
"String",
"baseURI",
",",
"RDFFormat",
"dataFormat",
",",
"Transaction",
"tx",
",",
"Resource",
"...",
"contexts",
")",
"throws",
"RDFParseException",
",",
"MarkLogicSesameException",
"{",
"try",
"{",
... | executes merge of triples from InputStream
@param in
@param baseURI
@param dataFormat
@param tx
@param contexts
@throws RDFParseException | [
"executes",
"merge",
"of",
"triples",
"from",
"InputStream"
] | d5b668ed2b3d5e90c9f1d5096012813c272062a2 | https://github.com/marklogic/marklogic-sesame/blob/d5b668ed2b3d5e90c9f1d5096012813c272062a2/marklogic-sesame/src/main/java/com/marklogic/semantics/sesame/client/MarkLogicClientImpl.java#L309-L335 | train |
marklogic/marklogic-sesame | marklogic-sesame/src/main/java/com/marklogic/semantics/sesame/client/MarkLogicClientImpl.java | MarkLogicClientImpl.performAdd | public void performAdd(String baseURI, Resource subject, URI predicate, Value object, Transaction tx, Resource... contexts) throws MarkLogicSesameException {
StringBuilder sb = new StringBuilder();
if(notNull(contexts) && contexts.length>0) {
if (notNull(baseURI)) sb.append("BASE <" + baseUR... | java | public void performAdd(String baseURI, Resource subject, URI predicate, Value object, Transaction tx, Resource... contexts) throws MarkLogicSesameException {
StringBuilder sb = new StringBuilder();
if(notNull(contexts) && contexts.length>0) {
if (notNull(baseURI)) sb.append("BASE <" + baseUR... | [
"public",
"void",
"performAdd",
"(",
"String",
"baseURI",
",",
"Resource",
"subject",
",",
"URI",
"predicate",
",",
"Value",
"object",
",",
"Transaction",
"tx",
",",
"Resource",
"...",
"contexts",
")",
"throws",
"MarkLogicSesameException",
"{",
"StringBuilder",
... | executes INSERT of single triple
@param baseURI
@param subject
@param predicate
@param object
@param tx
@param contexts
@throws MarkLogicSesameException | [
"executes",
"INSERT",
"of",
"single",
"triple"
] | d5b668ed2b3d5e90c9f1d5096012813c272062a2 | https://github.com/marklogic/marklogic-sesame/blob/d5b668ed2b3d5e90c9f1d5096012813c272062a2/marklogic-sesame/src/main/java/com/marklogic/semantics/sesame/client/MarkLogicClientImpl.java#L348-L373 | train |
marklogic/marklogic-sesame | marklogic-sesame/src/main/java/com/marklogic/semantics/sesame/client/MarkLogicClientImpl.java | MarkLogicClientImpl.performClear | public void performClear(Transaction tx, Resource... contexts) {
if(notNull(contexts)) {
for (int i = 0; i < contexts.length; i++) {
if (notNull(contexts[i])) {
graphManager.delete(contexts[i].stringValue(), tx);
} else {
graphM... | java | public void performClear(Transaction tx, Resource... contexts) {
if(notNull(contexts)) {
for (int i = 0; i < contexts.length; i++) {
if (notNull(contexts[i])) {
graphManager.delete(contexts[i].stringValue(), tx);
} else {
graphM... | [
"public",
"void",
"performClear",
"(",
"Transaction",
"tx",
",",
"Resource",
"...",
"contexts",
")",
"{",
"if",
"(",
"notNull",
"(",
"contexts",
")",
")",
"{",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"contexts",
".",
"length",
";",
"i",
"+... | clears triples from named graph
@param tx
@param contexts | [
"clears",
"triples",
"from",
"named",
"graph"
] | d5b668ed2b3d5e90c9f1d5096012813c272062a2 | https://github.com/marklogic/marklogic-sesame/blob/d5b668ed2b3d5e90c9f1d5096012813c272062a2/marklogic-sesame/src/main/java/com/marklogic/semantics/sesame/client/MarkLogicClientImpl.java#L417-L429 | train |
marklogic/marklogic-sesame | marklogic-sesame/src/main/java/com/marklogic/semantics/sesame/client/MarkLogicClientImpl.java | MarkLogicClientImpl.setRulesets | public void setRulesets(SPARQLRuleset ... rulesets) {
if(notNull(rulesets)) {
List<SPARQLRuleset> list = new ArrayList<>();
for(Object r : rulesets) {
if(r != null && rulesets.length > 0) {
list.add((SPARQLRuleset)r);
}
}
... | java | public void setRulesets(SPARQLRuleset ... rulesets) {
if(notNull(rulesets)) {
List<SPARQLRuleset> list = new ArrayList<>();
for(Object r : rulesets) {
if(r != null && rulesets.length > 0) {
list.add((SPARQLRuleset)r);
}
}
... | [
"public",
"void",
"setRulesets",
"(",
"SPARQLRuleset",
"...",
"rulesets",
")",
"{",
"if",
"(",
"notNull",
"(",
"rulesets",
")",
")",
"{",
"List",
"<",
"SPARQLRuleset",
">",
"list",
"=",
"new",
"ArrayList",
"<>",
"(",
")",
";",
"for",
"(",
"Object",
"r"... | setter for rulesets, filters out nulls
@param rulesets | [
"setter",
"for",
"rulesets",
"filters",
"out",
"nulls"
] | d5b668ed2b3d5e90c9f1d5096012813c272062a2 | https://github.com/marklogic/marklogic-sesame/blob/d5b668ed2b3d5e90c9f1d5096012813c272062a2/marklogic-sesame/src/main/java/com/marklogic/semantics/sesame/client/MarkLogicClientImpl.java#L454-L466 | train |
marklogic/marklogic-sesame | marklogic-sesame/src/main/java/com/marklogic/semantics/sesame/client/MarkLogicClientImpl.java | MarkLogicClientImpl.getSPARQLBindings | protected SPARQLBindings getSPARQLBindings(SPARQLQueryBindingSet bindings) {
SPARQLBindings sps = new SPARQLBindingsImpl();
for (Binding binding : bindings) {
sps.bind(binding.getName(), binding.getValue().stringValue());
}
return sps;
} | java | protected SPARQLBindings getSPARQLBindings(SPARQLQueryBindingSet bindings) {
SPARQLBindings sps = new SPARQLBindingsImpl();
for (Binding binding : bindings) {
sps.bind(binding.getName(), binding.getValue().stringValue());
}
return sps;
} | [
"protected",
"SPARQLBindings",
"getSPARQLBindings",
"(",
"SPARQLQueryBindingSet",
"bindings",
")",
"{",
"SPARQLBindings",
"sps",
"=",
"new",
"SPARQLBindingsImpl",
"(",
")",
";",
"for",
"(",
"Binding",
"binding",
":",
"bindings",
")",
"{",
"sps",
".",
"bind",
"("... | converts Sesame BindingSet to java api client SPARQLBindings
@param bindings
@return | [
"converts",
"Sesame",
"BindingSet",
"to",
"java",
"api",
"client",
"SPARQLBindings"
] | d5b668ed2b3d5e90c9f1d5096012813c272062a2 | https://github.com/marklogic/marklogic-sesame/blob/d5b668ed2b3d5e90c9f1d5096012813c272062a2/marklogic-sesame/src/main/java/com/marklogic/semantics/sesame/client/MarkLogicClientImpl.java#L530-L536 | train |
marklogic/marklogic-sesame | marklogic-sesame/src/main/java/com/marklogic/semantics/sesame/client/TripleCache.java | TripleCache.run | @Override
public synchronized void run(){
Date now = new Date();
if ( !cache.isEmpty() &&
((cache.size() > cacheSize - 1) || (now.getTime() - lastCacheAccess.getTime() > cacheMillis))) {
try {
flush();
} catch (RepositoryException e) {
... | java | @Override
public synchronized void run(){
Date now = new Date();
if ( !cache.isEmpty() &&
((cache.size() > cacheSize - 1) || (now.getTime() - lastCacheAccess.getTime() > cacheMillis))) {
try {
flush();
} catch (RepositoryException e) {
... | [
"@",
"Override",
"public",
"synchronized",
"void",
"run",
"(",
")",
"{",
"Date",
"now",
"=",
"new",
"Date",
"(",
")",
";",
"if",
"(",
"!",
"cache",
".",
"isEmpty",
"(",
")",
"&&",
"(",
"(",
"cache",
".",
"size",
"(",
")",
">",
"cacheSize",
"-",
... | tests to see if we should flush cache | [
"tests",
"to",
"see",
"if",
"we",
"should",
"flush",
"cache"
] | d5b668ed2b3d5e90c9f1d5096012813c272062a2 | https://github.com/marklogic/marklogic-sesame/blob/d5b668ed2b3d5e90c9f1d5096012813c272062a2/marklogic-sesame/src/main/java/com/marklogic/semantics/sesame/client/TripleCache.java#L130-L151 | train |
marklogic/marklogic-sesame | marklogic-sesame/src/main/java/com/marklogic/semantics/sesame/client/TripleCache.java | TripleCache.forceRun | public synchronized void forceRun() throws MarkLogicSesameException {
log.debug(String.valueOf(cache.size()));
if( !cache.isEmpty()) {
try {
flush();
} catch (RepositoryException e) {
throw new MarkLogicSesameException("Could not flush write cache,... | java | public synchronized void forceRun() throws MarkLogicSesameException {
log.debug(String.valueOf(cache.size()));
if( !cache.isEmpty()) {
try {
flush();
} catch (RepositoryException e) {
throw new MarkLogicSesameException("Could not flush write cache,... | [
"public",
"synchronized",
"void",
"forceRun",
"(",
")",
"throws",
"MarkLogicSesameException",
"{",
"log",
".",
"debug",
"(",
"String",
".",
"valueOf",
"(",
"cache",
".",
"size",
"(",
")",
")",
")",
";",
"if",
"(",
"!",
"cache",
".",
"isEmpty",
"(",
")"... | min
forces the cache to flush if there is anything in it
@throws MarkLogicSesameException | [
"min",
"forces",
"the",
"cache",
"to",
"flush",
"if",
"there",
"is",
"anything",
"in",
"it"
] | d5b668ed2b3d5e90c9f1d5096012813c272062a2 | https://github.com/marklogic/marklogic-sesame/blob/d5b668ed2b3d5e90c9f1d5096012813c272062a2/marklogic-sesame/src/main/java/com/marklogic/semantics/sesame/client/TripleCache.java#L160-L175 | train |
marklogic/marklogic-sesame | marklogic-sesame/src/main/java/com/marklogic/semantics/sesame/client/TripleCache.java | TripleCache.add | public synchronized void add(Resource subject, URI predicate, Value object, Resource... contexts) throws MarkLogicSesameException {
cache.add(subject,predicate,object,contexts);
if( cache.size() > cacheSize - 1){
forceRun();
}
} | java | public synchronized void add(Resource subject, URI predicate, Value object, Resource... contexts) throws MarkLogicSesameException {
cache.add(subject,predicate,object,contexts);
if( cache.size() > cacheSize - 1){
forceRun();
}
} | [
"public",
"synchronized",
"void",
"add",
"(",
"Resource",
"subject",
",",
"URI",
"predicate",
",",
"Value",
"object",
",",
"Resource",
"...",
"contexts",
")",
"throws",
"MarkLogicSesameException",
"{",
"cache",
".",
"add",
"(",
"subject",
",",
"predicate",
","... | add triple to cache Model
@param subject
@param predicate
@param object
@param contexts | [
"add",
"triple",
"to",
"cache",
"Model"
] | d5b668ed2b3d5e90c9f1d5096012813c272062a2 | https://github.com/marklogic/marklogic-sesame/blob/d5b668ed2b3d5e90c9f1d5096012813c272062a2/marklogic-sesame/src/main/java/com/marklogic/semantics/sesame/client/TripleCache.java#L185-L190 | train |
marklogic/marklogic-sesame | marklogic-sesame/src/main/java/com/marklogic/semantics/sesame/MarkLogicRepositoryConnection.java | MarkLogicRepositoryConnection.prepareQuery | @Override
public Query prepareQuery(String queryString, String baseURI) throws RepositoryException, MalformedQueryException {
return prepareQuery(QueryLanguage.SPARQL, queryString, baseURI);
} | java | @Override
public Query prepareQuery(String queryString, String baseURI) throws RepositoryException, MalformedQueryException {
return prepareQuery(QueryLanguage.SPARQL, queryString, baseURI);
} | [
"@",
"Override",
"public",
"Query",
"prepareQuery",
"(",
"String",
"queryString",
",",
"String",
"baseURI",
")",
"throws",
"RepositoryException",
",",
"MalformedQueryException",
"{",
"return",
"prepareQuery",
"(",
"QueryLanguage",
".",
"SPARQL",
",",
"queryString",
... | overload for prepareQuery
@param queryString
@param baseURI
@return MarkLogicQuery
@throws RepositoryException
@throws MalformedQueryException | [
"overload",
"for",
"prepareQuery"
] | d5b668ed2b3d5e90c9f1d5096012813c272062a2 | https://github.com/marklogic/marklogic-sesame/blob/d5b668ed2b3d5e90c9f1d5096012813c272062a2/marklogic-sesame/src/main/java/com/marklogic/semantics/sesame/MarkLogicRepositoryConnection.java#L164-L167 | train |
marklogic/marklogic-sesame | marklogic-sesame/src/main/java/com/marklogic/semantics/sesame/MarkLogicRepositoryConnection.java | MarkLogicRepositoryConnection.prepareQuery | @Override
public MarkLogicQuery prepareQuery(QueryLanguage queryLanguage, String queryString, String baseURI)
throws RepositoryException, MalformedQueryException
{
// function routing based on query form
if (SPARQL.equals(queryLanguage)) {
String queryStringWithoutProlog ... | java | @Override
public MarkLogicQuery prepareQuery(QueryLanguage queryLanguage, String queryString, String baseURI)
throws RepositoryException, MalformedQueryException
{
// function routing based on query form
if (SPARQL.equals(queryLanguage)) {
String queryStringWithoutProlog ... | [
"@",
"Override",
"public",
"MarkLogicQuery",
"prepareQuery",
"(",
"QueryLanguage",
"queryLanguage",
",",
"String",
"queryString",
",",
"String",
"baseURI",
")",
"throws",
"RepositoryException",
",",
"MalformedQueryException",
"{",
"// function routing based on query form",
... | base method for prepareQuery
routes to all other query forms (prepareTupleQuery,prepareBooleanQuery,prepareGraphQuery)
@param queryLanguage
@param queryString
@param baseURI
@return MarkLogicQuery
@throws RepositoryException
@throws MalformedQueryException | [
"base",
"method",
"for",
"prepareQuery"
] | d5b668ed2b3d5e90c9f1d5096012813c272062a2 | https://github.com/marklogic/marklogic-sesame/blob/d5b668ed2b3d5e90c9f1d5096012813c272062a2/marklogic-sesame/src/main/java/com/marklogic/semantics/sesame/MarkLogicRepositoryConnection.java#L195-L213 | train |
marklogic/marklogic-sesame | marklogic-sesame/src/main/java/com/marklogic/semantics/sesame/MarkLogicRepositoryConnection.java | MarkLogicRepositoryConnection.prepareGraphQuery | @Override
public MarkLogicGraphQuery prepareGraphQuery(String queryString,String baseURI) throws RepositoryException, MalformedQueryException {
return prepareGraphQuery(QueryLanguage.SPARQL, queryString, baseURI);
} | java | @Override
public MarkLogicGraphQuery prepareGraphQuery(String queryString,String baseURI) throws RepositoryException, MalformedQueryException {
return prepareGraphQuery(QueryLanguage.SPARQL, queryString, baseURI);
} | [
"@",
"Override",
"public",
"MarkLogicGraphQuery",
"prepareGraphQuery",
"(",
"String",
"queryString",
",",
"String",
"baseURI",
")",
"throws",
"RepositoryException",
",",
"MalformedQueryException",
"{",
"return",
"prepareGraphQuery",
"(",
"QueryLanguage",
".",
"SPARQL",
... | overload for prepareGraphQuery
@param queryString
@param baseURI
@return MarkLogicGraphQuery
@throws RepositoryException
@throws MalformedQueryException | [
"overload",
"for",
"prepareGraphQuery"
] | d5b668ed2b3d5e90c9f1d5096012813c272062a2 | https://github.com/marklogic/marklogic-sesame/blob/d5b668ed2b3d5e90c9f1d5096012813c272062a2/marklogic-sesame/src/main/java/com/marklogic/semantics/sesame/MarkLogicRepositoryConnection.java#L296-L299 | train |
marklogic/marklogic-sesame | marklogic-sesame/src/main/java/com/marklogic/semantics/sesame/MarkLogicRepositoryConnection.java | MarkLogicRepositoryConnection.prepareBooleanQuery | @Override
public MarkLogicBooleanQuery prepareBooleanQuery(String queryString) throws RepositoryException, MalformedQueryException {
return prepareBooleanQuery(QueryLanguage.SPARQL, queryString, null);
} | java | @Override
public MarkLogicBooleanQuery prepareBooleanQuery(String queryString) throws RepositoryException, MalformedQueryException {
return prepareBooleanQuery(QueryLanguage.SPARQL, queryString, null);
} | [
"@",
"Override",
"public",
"MarkLogicBooleanQuery",
"prepareBooleanQuery",
"(",
"String",
"queryString",
")",
"throws",
"RepositoryException",
",",
"MalformedQueryException",
"{",
"return",
"prepareBooleanQuery",
"(",
"QueryLanguage",
".",
"SPARQL",
",",
"queryString",
",... | overload for prepareBooleanQuery
@param queryString
@return MarkLogicBooleanQuery
@throws RepositoryException
@throws MalformedQueryException | [
"overload",
"for",
"prepareBooleanQuery"
] | d5b668ed2b3d5e90c9f1d5096012813c272062a2 | https://github.com/marklogic/marklogic-sesame/blob/d5b668ed2b3d5e90c9f1d5096012813c272062a2/marklogic-sesame/src/main/java/com/marklogic/semantics/sesame/MarkLogicRepositoryConnection.java#L343-L346 | train |
marklogic/marklogic-sesame | marklogic-sesame/src/main/java/com/marklogic/semantics/sesame/MarkLogicRepositoryConnection.java | MarkLogicRepositoryConnection.prepareUpdate | @Override
public MarkLogicUpdateQuery prepareUpdate(String queryString,String baseURI) throws RepositoryException, MalformedQueryException {
return prepareUpdate(QueryLanguage.SPARQL, queryString, baseURI);
} | java | @Override
public MarkLogicUpdateQuery prepareUpdate(String queryString,String baseURI) throws RepositoryException, MalformedQueryException {
return prepareUpdate(QueryLanguage.SPARQL, queryString, baseURI);
} | [
"@",
"Override",
"public",
"MarkLogicUpdateQuery",
"prepareUpdate",
"(",
"String",
"queryString",
",",
"String",
"baseURI",
")",
"throws",
"RepositoryException",
",",
"MalformedQueryException",
"{",
"return",
"prepareUpdate",
"(",
"QueryLanguage",
".",
"SPARQL",
",",
... | overload for prepareUpdate
@param queryString
@param baseURI
@return MarkLogicUpdateQuery
@throws RepositoryException
@throws MalformedQueryException | [
"overload",
"for",
"prepareUpdate"
] | d5b668ed2b3d5e90c9f1d5096012813c272062a2 | https://github.com/marklogic/marklogic-sesame/blob/d5b668ed2b3d5e90c9f1d5096012813c272062a2/marklogic-sesame/src/main/java/com/marklogic/semantics/sesame/MarkLogicRepositoryConnection.java#L416-L419 | train |
marklogic/marklogic-sesame | marklogic-sesame/src/main/java/com/marklogic/semantics/sesame/MarkLogicRepositoryConnection.java | MarkLogicRepositoryConnection.prepareUpdate | @Override
public MarkLogicUpdateQuery prepareUpdate(QueryLanguage queryLanguage, String queryString, String baseURI) throws RepositoryException, MalformedQueryException {
if (QueryLanguage.SPARQL.equals(queryLanguage)) {
return new MarkLogicUpdateQuery(this.client, new SPARQLQueryBindingSet(), b... | java | @Override
public MarkLogicUpdateQuery prepareUpdate(QueryLanguage queryLanguage, String queryString, String baseURI) throws RepositoryException, MalformedQueryException {
if (QueryLanguage.SPARQL.equals(queryLanguage)) {
return new MarkLogicUpdateQuery(this.client, new SPARQLQueryBindingSet(), b... | [
"@",
"Override",
"public",
"MarkLogicUpdateQuery",
"prepareUpdate",
"(",
"QueryLanguage",
"queryLanguage",
",",
"String",
"queryString",
",",
"String",
"baseURI",
")",
"throws",
"RepositoryException",
",",
"MalformedQueryException",
"{",
"if",
"(",
"QueryLanguage",
".",... | base method for prepareUpdate
@param queryLanguage
@param queryString
@param baseURI
@return MarkLogicUpdateQuery
@throws RepositoryException
@throws MalformedQueryException | [
"base",
"method",
"for",
"prepareUpdate"
] | d5b668ed2b3d5e90c9f1d5096012813c272062a2 | https://github.com/marklogic/marklogic-sesame/blob/d5b668ed2b3d5e90c9f1d5096012813c272062a2/marklogic-sesame/src/main/java/com/marklogic/semantics/sesame/MarkLogicRepositoryConnection.java#L445-L451 | train |
marklogic/marklogic-sesame | marklogic-sesame/src/main/java/com/marklogic/semantics/sesame/MarkLogicRepositoryConnection.java | MarkLogicRepositoryConnection.getContextIDs | @Override
public RepositoryResult<Resource> getContextIDs() throws RepositoryException {
try{
TupleQuery tupleQuery = prepareTupleQuery(QueryLanguage.SPARQL, ALL_GRAPH_URIS);
TupleQueryResult result = tupleQuery.evaluate();
return
new RepositoryResult<... | java | @Override
public RepositoryResult<Resource> getContextIDs() throws RepositoryException {
try{
TupleQuery tupleQuery = prepareTupleQuery(QueryLanguage.SPARQL, ALL_GRAPH_URIS);
TupleQueryResult result = tupleQuery.evaluate();
return
new RepositoryResult<... | [
"@",
"Override",
"public",
"RepositoryResult",
"<",
"Resource",
">",
"getContextIDs",
"(",
")",
"throws",
"RepositoryException",
"{",
"try",
"{",
"TupleQuery",
"tupleQuery",
"=",
"prepareTupleQuery",
"(",
"QueryLanguage",
".",
"SPARQL",
",",
"ALL_GRAPH_URIS",
")",
... | returns list of graph names as Resource
@throws RepositoryException | [
"returns",
"list",
"of",
"graph",
"names",
"as",
"Resource"
] | d5b668ed2b3d5e90c9f1d5096012813c272062a2 | https://github.com/marklogic/marklogic-sesame/blob/d5b668ed2b3d5e90c9f1d5096012813c272062a2/marklogic-sesame/src/main/java/com/marklogic/semantics/sesame/MarkLogicRepositoryConnection.java#L458-L486 | train |
marklogic/marklogic-sesame | marklogic-sesame/src/main/java/com/marklogic/semantics/sesame/MarkLogicRepositoryConnection.java | MarkLogicRepositoryConnection.getStatements | public RepositoryResult<Statement> getStatements(Resource subj, URI pred, Value obj, boolean includeInferred) throws RepositoryException {
try {
if (isQuadMode()) {
TupleQuery tupleQuery = prepareTupleQuery(GET_STATEMENTS);
setBindings(tupleQuery, subj, pred, obj);
... | java | public RepositoryResult<Statement> getStatements(Resource subj, URI pred, Value obj, boolean includeInferred) throws RepositoryException {
try {
if (isQuadMode()) {
TupleQuery tupleQuery = prepareTupleQuery(GET_STATEMENTS);
setBindings(tupleQuery, subj, pred, obj);
... | [
"public",
"RepositoryResult",
"<",
"Statement",
">",
"getStatements",
"(",
"Resource",
"subj",
",",
"URI",
"pred",
",",
"Value",
"obj",
",",
"boolean",
"includeInferred",
")",
"throws",
"RepositoryException",
"{",
"try",
"{",
"if",
"(",
"isQuadMode",
"(",
")",... | returns all statements
@param subj
@param pred
@param obj
@param includeInferred
@throws RepositoryException | [
"returns",
"all",
"statements"
] | d5b668ed2b3d5e90c9f1d5096012813c272062a2 | https://github.com/marklogic/marklogic-sesame/blob/d5b668ed2b3d5e90c9f1d5096012813c272062a2/marklogic-sesame/src/main/java/com/marklogic/semantics/sesame/MarkLogicRepositoryConnection.java#L497-L537 | train |
marklogic/marklogic-sesame | marklogic-sesame/src/main/java/com/marklogic/semantics/sesame/MarkLogicRepositoryConnection.java | MarkLogicRepositoryConnection.getStatements | @Override
public RepositoryResult<Statement> getStatements(Resource subj, URI pred, Value obj, boolean includeInferred, Resource... contexts) throws RepositoryException {
if (contexts == null) {
contexts = new Resource[] { null };
}
try {
if (isQuadMode()) {
... | java | @Override
public RepositoryResult<Statement> getStatements(Resource subj, URI pred, Value obj, boolean includeInferred, Resource... contexts) throws RepositoryException {
if (contexts == null) {
contexts = new Resource[] { null };
}
try {
if (isQuadMode()) {
... | [
"@",
"Override",
"public",
"RepositoryResult",
"<",
"Statement",
">",
"getStatements",
"(",
"Resource",
"subj",
",",
"URI",
"pred",
",",
"Value",
"obj",
",",
"boolean",
"includeInferred",
",",
"Resource",
"...",
"contexts",
")",
"throws",
"RepositoryException",
... | returns statements from supplied context
TBD - should share code path with above getStatements
@param subj
@param pred
@param obj
@param includeInferred
@param contexts
@throws RepositoryException | [
"returns",
"statements",
"from",
"supplied",
"context"
] | d5b668ed2b3d5e90c9f1d5096012813c272062a2 | https://github.com/marklogic/marklogic-sesame/blob/d5b668ed2b3d5e90c9f1d5096012813c272062a2/marklogic-sesame/src/main/java/com/marklogic/semantics/sesame/MarkLogicRepositoryConnection.java#L551-L614 | train |
marklogic/marklogic-sesame | marklogic-sesame/src/main/java/com/marklogic/semantics/sesame/MarkLogicRepositoryConnection.java | MarkLogicRepositoryConnection.size | @Override
public long size() throws RepositoryException{
try {
MarkLogicTupleQuery tupleQuery = prepareTupleQuery(COUNT_EVERYTHING);
tupleQuery.setIncludeInferred(false);
tupleQuery.setRulesets((SPARQLRuleset)null);
tupleQuery.setConstrainingQueryDefinition((Q... | java | @Override
public long size() throws RepositoryException{
try {
MarkLogicTupleQuery tupleQuery = prepareTupleQuery(COUNT_EVERYTHING);
tupleQuery.setIncludeInferred(false);
tupleQuery.setRulesets((SPARQLRuleset)null);
tupleQuery.setConstrainingQueryDefinition((Q... | [
"@",
"Override",
"public",
"long",
"size",
"(",
")",
"throws",
"RepositoryException",
"{",
"try",
"{",
"MarkLogicTupleQuery",
"tupleQuery",
"=",
"prepareTupleQuery",
"(",
"COUNT_EVERYTHING",
")",
";",
"tupleQuery",
".",
"setIncludeInferred",
"(",
"false",
")",
";"... | returns number of triples in the entire triple store
@return long
@throws RepositoryException | [
"returns",
"number",
"of",
"triples",
"in",
"the",
"entire",
"triple",
"store"
] | d5b668ed2b3d5e90c9f1d5096012813c272062a2 | https://github.com/marklogic/marklogic-sesame/blob/d5b668ed2b3d5e90c9f1d5096012813c272062a2/marklogic-sesame/src/main/java/com/marklogic/semantics/sesame/MarkLogicRepositoryConnection.java#L781-L796 | train |
marklogic/marklogic-sesame | marklogic-sesame/src/main/java/com/marklogic/semantics/sesame/MarkLogicRepositoryConnection.java | MarkLogicRepositoryConnection.size | @Override
public long size(Resource... contexts) throws RepositoryException {
if (contexts == null) {
contexts = new Resource[] { null };
}
try {
StringBuilder sb = new StringBuilder();
sb.append("SELECT (count(?s) as ?ct) where { GRAPH ?g { ?s ?p ?o }");
... | java | @Override
public long size(Resource... contexts) throws RepositoryException {
if (contexts == null) {
contexts = new Resource[] { null };
}
try {
StringBuilder sb = new StringBuilder();
sb.append("SELECT (count(?s) as ?ct) where { GRAPH ?g { ?s ?p ?o }");
... | [
"@",
"Override",
"public",
"long",
"size",
"(",
"Resource",
"...",
"contexts",
")",
"throws",
"RepositoryException",
"{",
"if",
"(",
"contexts",
"==",
"null",
")",
"{",
"contexts",
"=",
"new",
"Resource",
"[",
"]",
"{",
"null",
"}",
";",
"}",
"try",
"{... | returns number of triples in supplied context
@param contexts
@return long
@throws RepositoryException | [
"returns",
"number",
"of",
"triples",
"in",
"supplied",
"context"
] | d5b668ed2b3d5e90c9f1d5096012813c272062a2 | https://github.com/marklogic/marklogic-sesame/blob/d5b668ed2b3d5e90c9f1d5096012813c272062a2/marklogic-sesame/src/main/java/com/marklogic/semantics/sesame/MarkLogicRepositoryConnection.java#L805-L849 | train |
marklogic/marklogic-sesame | marklogic-sesame/src/main/java/com/marklogic/semantics/sesame/MarkLogicRepositoryConnection.java | MarkLogicRepositoryConnection.add | @Override
public void add(InputStream in, String baseURI, RDFFormat dataFormat, Resource... contexts) throws IOException, RDFParseException, RepositoryException {
getClient().sendAdd(in, baseURI, dataFormat, contexts);
} | java | @Override
public void add(InputStream in, String baseURI, RDFFormat dataFormat, Resource... contexts) throws IOException, RDFParseException, RepositoryException {
getClient().sendAdd(in, baseURI, dataFormat, contexts);
} | [
"@",
"Override",
"public",
"void",
"add",
"(",
"InputStream",
"in",
",",
"String",
"baseURI",
",",
"RDFFormat",
"dataFormat",
",",
"Resource",
"...",
"contexts",
")",
"throws",
"IOException",
",",
"RDFParseException",
",",
"RepositoryException",
"{",
"getClient",
... | add triples via inputstream
@param in
@param baseURI
@param dataFormat
@param contexts
@throws IOException
@throws RDFParseException
@throws RepositoryException | [
"add",
"triples",
"via",
"inputstream"
] | d5b668ed2b3d5e90c9f1d5096012813c272062a2 | https://github.com/marklogic/marklogic-sesame/blob/d5b668ed2b3d5e90c9f1d5096012813c272062a2/marklogic-sesame/src/main/java/com/marklogic/semantics/sesame/MarkLogicRepositoryConnection.java#L978-L981 | train |
marklogic/marklogic-sesame | marklogic-sesame/src/main/java/com/marklogic/semantics/sesame/MarkLogicRepositoryConnection.java | MarkLogicRepositoryConnection.add | @Override
public void add(File file, String baseURI, RDFFormat dataFormat, Resource... contexts) throws IOException, RDFParseException, RepositoryException {
if(notNull(baseURI)) {
getClient().sendAdd(file, baseURI, dataFormat, contexts);
}else{
getClient().sendAdd(file, file... | java | @Override
public void add(File file, String baseURI, RDFFormat dataFormat, Resource... contexts) throws IOException, RDFParseException, RepositoryException {
if(notNull(baseURI)) {
getClient().sendAdd(file, baseURI, dataFormat, contexts);
}else{
getClient().sendAdd(file, file... | [
"@",
"Override",
"public",
"void",
"add",
"(",
"File",
"file",
",",
"String",
"baseURI",
",",
"RDFFormat",
"dataFormat",
",",
"Resource",
"...",
"contexts",
")",
"throws",
"IOException",
",",
"RDFParseException",
",",
"RepositoryException",
"{",
"if",
"(",
"no... | add triples via File
will use file uri as base URI if none supplied
@param file
@param baseURI
@param dataFormat
@param contexts
@throws IOException
@throws RDFParseException
@throws RepositoryException | [
"add",
"triples",
"via",
"File"
] | d5b668ed2b3d5e90c9f1d5096012813c272062a2 | https://github.com/marklogic/marklogic-sesame/blob/d5b668ed2b3d5e90c9f1d5096012813c272062a2/marklogic-sesame/src/main/java/com/marklogic/semantics/sesame/MarkLogicRepositoryConnection.java#L996-L1003 | train |
marklogic/marklogic-sesame | marklogic-sesame/src/main/java/com/marklogic/semantics/sesame/MarkLogicRepositoryConnection.java | MarkLogicRepositoryConnection.add | @Override
public void add(Reader reader, String baseURI, RDFFormat dataFormat, Resource... contexts) throws IOException, RDFParseException, RepositoryException {
getClient().sendAdd(reader, baseURI, dataFormat, contexts);
} | java | @Override
public void add(Reader reader, String baseURI, RDFFormat dataFormat, Resource... contexts) throws IOException, RDFParseException, RepositoryException {
getClient().sendAdd(reader, baseURI, dataFormat, contexts);
} | [
"@",
"Override",
"public",
"void",
"add",
"(",
"Reader",
"reader",
",",
"String",
"baseURI",
",",
"RDFFormat",
"dataFormat",
",",
"Resource",
"...",
"contexts",
")",
"throws",
"IOException",
",",
"RDFParseException",
",",
"RepositoryException",
"{",
"getClient",
... | add triples via Reader
@param reader
@param baseURI
@param dataFormat
@param contexts
@throws IOException
@throws RDFParseException
@throws RepositoryException | [
"add",
"triples",
"via",
"Reader"
] | d5b668ed2b3d5e90c9f1d5096012813c272062a2 | https://github.com/marklogic/marklogic-sesame/blob/d5b668ed2b3d5e90c9f1d5096012813c272062a2/marklogic-sesame/src/main/java/com/marklogic/semantics/sesame/MarkLogicRepositoryConnection.java#L1016-L1019 | train |
marklogic/marklogic-sesame | marklogic-sesame/src/main/java/com/marklogic/semantics/sesame/MarkLogicRepositoryConnection.java | MarkLogicRepositoryConnection.add | @Override
public void add(URL url, String baseURI, RDFFormat dataFormat, Resource... contexts) throws IOException, RDFParseException, RepositoryException {
if(notNull(baseURI)) {
getClient().sendAdd(new URL(url.toString()).openStream(), baseURI, dataFormat, contexts);
}else{
... | java | @Override
public void add(URL url, String baseURI, RDFFormat dataFormat, Resource... contexts) throws IOException, RDFParseException, RepositoryException {
if(notNull(baseURI)) {
getClient().sendAdd(new URL(url.toString()).openStream(), baseURI, dataFormat, contexts);
}else{
... | [
"@",
"Override",
"public",
"void",
"add",
"(",
"URL",
"url",
",",
"String",
"baseURI",
",",
"RDFFormat",
"dataFormat",
",",
"Resource",
"...",
"contexts",
")",
"throws",
"IOException",
",",
"RDFParseException",
",",
"RepositoryException",
"{",
"if",
"(",
"notN... | add triples via URL
sets base URI to url if none is supplied
@param url
@param baseURI
@param dataFormat
@param contexts
@throws IOException
@throws RDFParseException
@throws RepositoryException | [
"add",
"triples",
"via",
"URL"
] | d5b668ed2b3d5e90c9f1d5096012813c272062a2 | https://github.com/marklogic/marklogic-sesame/blob/d5b668ed2b3d5e90c9f1d5096012813c272062a2/marklogic-sesame/src/main/java/com/marklogic/semantics/sesame/MarkLogicRepositoryConnection.java#L1034-L1041 | train |
marklogic/marklogic-sesame | marklogic-sesame/src/main/java/com/marklogic/semantics/sesame/MarkLogicRepositoryConnection.java | MarkLogicRepositoryConnection.addWithoutCommit | @Override
protected void addWithoutCommit(Resource subject, URI predicate, Value object, Resource... contexts) throws RepositoryException {
add(subject, predicate, object, contexts);
} | java | @Override
protected void addWithoutCommit(Resource subject, URI predicate, Value object, Resource... contexts) throws RepositoryException {
add(subject, predicate, object, contexts);
} | [
"@",
"Override",
"protected",
"void",
"addWithoutCommit",
"(",
"Resource",
"subject",
",",
"URI",
"predicate",
",",
"Value",
"object",
",",
"Resource",
"...",
"contexts",
")",
"throws",
"RepositoryException",
"{",
"add",
"(",
"subject",
",",
"predicate",
",",
... | add without commit
note- supplied to honor interface
@param subject
@param predicate
@param object
@param contexts
@throws RepositoryException | [
"add",
"without",
"commit"
] | d5b668ed2b3d5e90c9f1d5096012813c272062a2 | https://github.com/marklogic/marklogic-sesame/blob/d5b668ed2b3d5e90c9f1d5096012813c272062a2/marklogic-sesame/src/main/java/com/marklogic/semantics/sesame/MarkLogicRepositoryConnection.java#L1204-L1207 | train |
marklogic/marklogic-sesame | marklogic-sesame/src/main/java/com/marklogic/semantics/sesame/MarkLogicRepositoryConnection.java | MarkLogicRepositoryConnection.removeWithoutCommit | @Override
protected void removeWithoutCommit(Resource subject, URI predicate, Value object, Resource... contexts) throws RepositoryException {
remove(subject, predicate, object, contexts);
} | java | @Override
protected void removeWithoutCommit(Resource subject, URI predicate, Value object, Resource... contexts) throws RepositoryException {
remove(subject, predicate, object, contexts);
} | [
"@",
"Override",
"protected",
"void",
"removeWithoutCommit",
"(",
"Resource",
"subject",
",",
"URI",
"predicate",
",",
"Value",
"object",
",",
"Resource",
"...",
"contexts",
")",
"throws",
"RepositoryException",
"{",
"remove",
"(",
"subject",
",",
"predicate",
"... | remove without commit
supplied to honor interface
@param subject
@param predicate
@param object
@param contexts
@throws RepositoryException | [
"remove",
"without",
"commit"
] | d5b668ed2b3d5e90c9f1d5096012813c272062a2 | https://github.com/marklogic/marklogic-sesame/blob/d5b668ed2b3d5e90c9f1d5096012813c272062a2/marklogic-sesame/src/main/java/com/marklogic/semantics/sesame/MarkLogicRepositoryConnection.java#L1220-L1223 | train |
marklogic/marklogic-sesame | marklogic-sesame/src/main/java/com/marklogic/semantics/sesame/MarkLogicRepositoryConnection.java | MarkLogicRepositoryConnection.setDefaultGraphPerms | @Override
public void setDefaultGraphPerms(GraphPermissions graphPerms) {
if(notNull(graphPerms)) {
this.defaultGraphPerms = graphPerms;
}else{
this.defaultGraphPerms = client.emptyGraphPerms();
}
} | java | @Override
public void setDefaultGraphPerms(GraphPermissions graphPerms) {
if(notNull(graphPerms)) {
this.defaultGraphPerms = graphPerms;
}else{
this.defaultGraphPerms = client.emptyGraphPerms();
}
} | [
"@",
"Override",
"public",
"void",
"setDefaultGraphPerms",
"(",
"GraphPermissions",
"graphPerms",
")",
"{",
"if",
"(",
"notNull",
"(",
"graphPerms",
")",
")",
"{",
"this",
".",
"defaultGraphPerms",
"=",
"graphPerms",
";",
"}",
"else",
"{",
"this",
".",
"defa... | sets default graph permissions to be used by all queries
@param graphPerms | [
"sets",
"default",
"graph",
"permissions",
"to",
"be",
"used",
"by",
"all",
"queries"
] | d5b668ed2b3d5e90c9f1d5096012813c272062a2 | https://github.com/marklogic/marklogic-sesame/blob/d5b668ed2b3d5e90c9f1d5096012813c272062a2/marklogic-sesame/src/main/java/com/marklogic/semantics/sesame/MarkLogicRepositoryConnection.java#L1294-L1301 | train |
marklogic/marklogic-sesame | marklogic-sesame/src/main/java/com/marklogic/semantics/sesame/MarkLogicRepositoryConnection.java | MarkLogicRepositoryConnection.configureWriteCache | @Override
public void configureWriteCache(long initDelay, long delayCache, long cacheSize){
client.initTimer(initDelay, delayCache,cacheSize);
} | java | @Override
public void configureWriteCache(long initDelay, long delayCache, long cacheSize){
client.initTimer(initDelay, delayCache,cacheSize);
} | [
"@",
"Override",
"public",
"void",
"configureWriteCache",
"(",
"long",
"initDelay",
",",
"long",
"delayCache",
",",
"long",
"cacheSize",
")",
"{",
"client",
".",
"initTimer",
"(",
"initDelay",
",",
"delayCache",
",",
"cacheSize",
")",
";",
"}"
] | customise write cache interval and cache size.
@param initDelay - initial interval before write cache is checked
@param delayCache - interval (ms) to check write cache
@param cacheSize - size (# triples) of write cache | [
"customise",
"write",
"cache",
"interval",
"and",
"cache",
"size",
"."
] | d5b668ed2b3d5e90c9f1d5096012813c272062a2 | https://github.com/marklogic/marklogic-sesame/blob/d5b668ed2b3d5e90c9f1d5096012813c272062a2/marklogic-sesame/src/main/java/com/marklogic/semantics/sesame/MarkLogicRepositoryConnection.java#L1374-L1377 | train |
marklogic/marklogic-sesame | marklogic-sesame/src/main/java/com/marklogic/semantics/sesame/MarkLogicRepositoryConnection.java | MarkLogicRepositoryConnection.mergeResource | private static Resource[] mergeResource(Resource o, Resource... arr) {
if(o != null) {
Resource[] newArray = new Resource[arr.length + 1];
newArray[0] = o;
System.arraycopy(arr, 0, newArray, 1, arr.length);
return newArray;
}else{
return arr;
... | java | private static Resource[] mergeResource(Resource o, Resource... arr) {
if(o != null) {
Resource[] newArray = new Resource[arr.length + 1];
newArray[0] = o;
System.arraycopy(arr, 0, newArray, 1, arr.length);
return newArray;
}else{
return arr;
... | [
"private",
"static",
"Resource",
"[",
"]",
"mergeResource",
"(",
"Resource",
"o",
",",
"Resource",
"...",
"arr",
")",
"{",
"if",
"(",
"o",
"!=",
"null",
")",
"{",
"Resource",
"[",
"]",
"newArray",
"=",
"new",
"Resource",
"[",
"arr",
".",
"length",
"+... | private utility for merging Resource varargs
@param o
@param arr
@return | [
"private",
"utility",
"for",
"merging",
"Resource",
"varargs"
] | d5b668ed2b3d5e90c9f1d5096012813c272062a2 | https://github.com/marklogic/marklogic-sesame/blob/d5b668ed2b3d5e90c9f1d5096012813c272062a2/marklogic-sesame/src/main/java/com/marklogic/semantics/sesame/MarkLogicRepositoryConnection.java#L1450-L1460 | train |
marklogic/marklogic-sesame | marklogic-sesame/src/main/java/com/marklogic/semantics/sesame/client/TripleDeleteCache.java | TripleDeleteCache.flush | protected synchronized void flush() throws RepositoryException, MalformedQueryException, UpdateExecutionException, IOException {
if (cache.isEmpty()) { return; }
StringBuffer entireQuery = new StringBuffer();
SPARQLQueryBindingSet bindingSet = new SPARQLQueryBindingSet();
for (Namespace... | java | protected synchronized void flush() throws RepositoryException, MalformedQueryException, UpdateExecutionException, IOException {
if (cache.isEmpty()) { return; }
StringBuffer entireQuery = new StringBuffer();
SPARQLQueryBindingSet bindingSet = new SPARQLQueryBindingSet();
for (Namespace... | [
"protected",
"synchronized",
"void",
"flush",
"(",
")",
"throws",
"RepositoryException",
",",
"MalformedQueryException",
",",
"UpdateExecutionException",
",",
"IOException",
"{",
"if",
"(",
"cache",
".",
"isEmpty",
"(",
")",
")",
"{",
"return",
";",
"}",
"String... | flushes the cache, writing triples as graph
@throws MarkLogicSesameException | [
"flushes",
"the",
"cache",
"writing",
"triples",
"as",
"graph"
] | d5b668ed2b3d5e90c9f1d5096012813c272062a2 | https://github.com/marklogic/marklogic-sesame/blob/d5b668ed2b3d5e90c9f1d5096012813c272062a2/marklogic-sesame/src/main/java/com/marklogic/semantics/sesame/client/TripleDeleteCache.java#L54-L104 | train |
marklogic/marklogic-sesame | marklogic-sesame/src/main/java/com/marklogic/semantics/sesame/query/MarkLogicBooleanQuery.java | MarkLogicBooleanQuery.evaluate | @Override
public boolean evaluate() throws QueryEvaluationException {
try {
sync();
return getMarkLogicClient().sendBooleanQuery(getQueryString(), getBindings(), getIncludeInferred(),getBaseURI());
}catch (RepositoryException e) {
throw new QueryEvaluationExceptio... | java | @Override
public boolean evaluate() throws QueryEvaluationException {
try {
sync();
return getMarkLogicClient().sendBooleanQuery(getQueryString(), getBindings(), getIncludeInferred(),getBaseURI());
}catch (RepositoryException e) {
throw new QueryEvaluationExceptio... | [
"@",
"Override",
"public",
"boolean",
"evaluate",
"(",
")",
"throws",
"QueryEvaluationException",
"{",
"try",
"{",
"sync",
"(",
")",
";",
"return",
"getMarkLogicClient",
"(",
")",
".",
"sendBooleanQuery",
"(",
"getQueryString",
"(",
")",
",",
"getBindings",
"(... | evaluate boolean query
@return boolean
@throws QueryEvaluationException | [
"evaluate",
"boolean",
"query"
] | d5b668ed2b3d5e90c9f1d5096012813c272062a2 | https://github.com/marklogic/marklogic-sesame/blob/d5b668ed2b3d5e90c9f1d5096012813c272062a2/marklogic-sesame/src/main/java/com/marklogic/semantics/sesame/query/MarkLogicBooleanQuery.java#L65-L79 | train |
marklogic/marklogic-sesame | marklogic-sesame/src/main/java/com/marklogic/semantics/sesame/client/MarkLogicBackgroundGraphResult.java | MarkLogicBackgroundGraphResult.handleClose | @Override
protected void handleClose() throws QueryEvaluationException {
try {
super.handleClose();
}catch(Exception e){
logger.error("MarkLogicBackgroundGraphResult handleClose() stream closed exception",e);
throw new QueryEvaluationException(e);
}
} | java | @Override
protected void handleClose() throws QueryEvaluationException {
try {
super.handleClose();
}catch(Exception e){
logger.error("MarkLogicBackgroundGraphResult handleClose() stream closed exception",e);
throw new QueryEvaluationException(e);
}
} | [
"@",
"Override",
"protected",
"void",
"handleClose",
"(",
")",
"throws",
"QueryEvaluationException",
"{",
"try",
"{",
"super",
".",
"handleClose",
"(",
")",
";",
"}",
"catch",
"(",
"Exception",
"e",
")",
"{",
"logger",
".",
"error",
"(",
"\"MarkLogicBackgrou... | wrap exception, debug log | [
"wrap",
"exception",
"debug",
"log"
] | d5b668ed2b3d5e90c9f1d5096012813c272062a2 | https://github.com/marklogic/marklogic-sesame/blob/d5b668ed2b3d5e90c9f1d5096012813c272062a2/marklogic-sesame/src/main/java/com/marklogic/semantics/sesame/client/MarkLogicBackgroundGraphResult.java#L86-L94 | train |
marklogic/marklogic-sesame | marklogic-sesame/src/main/java/com/marklogic/semantics/sesame/query/MarkLogicGraphQuery.java | MarkLogicGraphQuery.evaluate | @Override
public GraphQueryResult evaluate()
throws QueryEvaluationException {
try {
sync();
return getMarkLogicClient().sendGraphQuery(getQueryString(),getBindings(),getIncludeInferred(),getBaseURI());
} catch (IOException e) {
throw new QueryEvaluati... | java | @Override
public GraphQueryResult evaluate()
throws QueryEvaluationException {
try {
sync();
return getMarkLogicClient().sendGraphQuery(getQueryString(),getBindings(),getIncludeInferred(),getBaseURI());
} catch (IOException e) {
throw new QueryEvaluati... | [
"@",
"Override",
"public",
"GraphQueryResult",
"evaluate",
"(",
")",
"throws",
"QueryEvaluationException",
"{",
"try",
"{",
"sync",
"(",
")",
";",
"return",
"getMarkLogicClient",
"(",
")",
".",
"sendGraphQuery",
"(",
"getQueryString",
"(",
")",
",",
"getBindings... | evaluate graph query
@return GraphQueryResult
@throws QueryEvaluationException | [
"evaluate",
"graph",
"query"
] | d5b668ed2b3d5e90c9f1d5096012813c272062a2 | https://github.com/marklogic/marklogic-sesame/blob/d5b668ed2b3d5e90c9f1d5096012813c272062a2/marklogic-sesame/src/main/java/com/marklogic/semantics/sesame/query/MarkLogicGraphQuery.java#L66-L77 | train |
marklogic/marklogic-sesame | marklogic-sesame/src/main/java/com/marklogic/semantics/sesame/query/MarkLogicQuery.java | MarkLogicQuery.setBinding | public void setBinding(String name, String stringValue) {
bindingSet.addBinding(name, ValueFactoryImpl.getInstance().createURI(stringValue));
} | java | public void setBinding(String name, String stringValue) {
bindingSet.addBinding(name, ValueFactoryImpl.getInstance().createURI(stringValue));
} | [
"public",
"void",
"setBinding",
"(",
"String",
"name",
",",
"String",
"stringValue",
")",
"{",
"bindingSet",
".",
"addBinding",
"(",
"name",
",",
"ValueFactoryImpl",
".",
"getInstance",
"(",
")",
".",
"createURI",
"(",
"stringValue",
")",
")",
";",
"}"
] | set individual binding
@param name
@param stringValue | [
"set",
"individual",
"binding"
] | d5b668ed2b3d5e90c9f1d5096012813c272062a2 | https://github.com/marklogic/marklogic-sesame/blob/d5b668ed2b3d5e90c9f1d5096012813c272062a2/marklogic-sesame/src/main/java/com/marklogic/semantics/sesame/query/MarkLogicQuery.java#L140-L142 | train |
marklogic/marklogic-sesame | marklogic-sesame/src/main/java/com/marklogic/semantics/sesame/query/MarkLogicQuery.java | MarkLogicQuery.setBinding | @Override
public void setBinding(String name, Value value) {
bindingSet.addBinding(name, value);
} | java | @Override
public void setBinding(String name, Value value) {
bindingSet.addBinding(name, value);
} | [
"@",
"Override",
"public",
"void",
"setBinding",
"(",
"String",
"name",
",",
"Value",
"value",
")",
"{",
"bindingSet",
".",
"addBinding",
"(",
"name",
",",
"value",
")",
";",
"}"
] | set individual binding and value
@param name
@param value | [
"set",
"individual",
"binding",
"and",
"value"
] | d5b668ed2b3d5e90c9f1d5096012813c272062a2 | https://github.com/marklogic/marklogic-sesame/blob/d5b668ed2b3d5e90c9f1d5096012813c272062a2/marklogic-sesame/src/main/java/com/marklogic/semantics/sesame/query/MarkLogicQuery.java#L149-L152 | train |
marklogic/marklogic-sesame | marklogic-sesame/src/main/java/com/marklogic/semantics/sesame/query/MarkLogicTupleQuery.java | MarkLogicTupleQuery.evaluate | public TupleQueryResult evaluate(long start, long pageLength)
throws QueryEvaluationException {
try {
sync();
return getMarkLogicClient().sendTupleQuery(getQueryString(), getBindings(), start, pageLength, getIncludeInferred(), getBaseURI());
}catch (RepositoryExceptio... | java | public TupleQueryResult evaluate(long start, long pageLength)
throws QueryEvaluationException {
try {
sync();
return getMarkLogicClient().sendTupleQuery(getQueryString(), getBindings(), start, pageLength, getIncludeInferred(), getBaseURI());
}catch (RepositoryExceptio... | [
"public",
"TupleQueryResult",
"evaluate",
"(",
"long",
"start",
",",
"long",
"pageLength",
")",
"throws",
"QueryEvaluationException",
"{",
"try",
"{",
"sync",
"(",
")",
";",
"return",
"getMarkLogicClient",
"(",
")",
".",
"sendTupleQuery",
"(",
"getQueryString",
... | evaluate tuple query with pagination
@param start
@param pageLength
@return TupleQueryResult
@throws QueryEvaluationException | [
"evaluate",
"tuple",
"query",
"with",
"pagination"
] | d5b668ed2b3d5e90c9f1d5096012813c272062a2 | https://github.com/marklogic/marklogic-sesame/blob/d5b668ed2b3d5e90c9f1d5096012813c272062a2/marklogic-sesame/src/main/java/com/marklogic/semantics/sesame/query/MarkLogicTupleQuery.java#L79-L91 | train |
marklogic/marklogic-sesame | marklogic-sesame/src/main/java/com/marklogic/semantics/sesame/query/MarkLogicUpdateQuery.java | MarkLogicUpdateQuery.execute | @Override
public void execute() throws UpdateExecutionException {
try {
sync();
getMarkLogicClient().sendUpdateQuery(getQueryString(), getBindings(), getIncludeInferred(), getBaseURI());
}catch(ForbiddenUserException | FailedRequestException e){
throw new UpdateEx... | java | @Override
public void execute() throws UpdateExecutionException {
try {
sync();
getMarkLogicClient().sendUpdateQuery(getQueryString(), getBindings(), getIncludeInferred(), getBaseURI());
}catch(ForbiddenUserException | FailedRequestException e){
throw new UpdateEx... | [
"@",
"Override",
"public",
"void",
"execute",
"(",
")",
"throws",
"UpdateExecutionException",
"{",
"try",
"{",
"sync",
"(",
")",
";",
"getMarkLogicClient",
"(",
")",
".",
"sendUpdateQuery",
"(",
"getQueryString",
"(",
")",
",",
"getBindings",
"(",
")",
",",
... | execute update query
@throws UpdateExecutionException | [
"execute",
"update",
"query"
] | d5b668ed2b3d5e90c9f1d5096012813c272062a2 | https://github.com/marklogic/marklogic-sesame/blob/d5b668ed2b3d5e90c9f1d5096012813c272062a2/marklogic-sesame/src/main/java/com/marklogic/semantics/sesame/query/MarkLogicUpdateQuery.java#L65-L79 | train |
jponge/lzma-java | src/main/java/lzma/sdk/lz/InWindow.java | InWindow.getMatchLen | public int getMatchLen(int index, int distance, int limit)
{
if (_streamEndWasReached)
{
if ((_pos + index) + limit > _streamPos)
{
limit = _streamPos - (_pos + index);
}
}
distance++;
// Byte *pby = _buffer + (siz... | java | public int getMatchLen(int index, int distance, int limit)
{
if (_streamEndWasReached)
{
if ((_pos + index) + limit > _streamPos)
{
limit = _streamPos - (_pos + index);
}
}
distance++;
// Byte *pby = _buffer + (siz... | [
"public",
"int",
"getMatchLen",
"(",
"int",
"index",
",",
"int",
"distance",
",",
"int",
"limit",
")",
"{",
"if",
"(",
"_streamEndWasReached",
")",
"{",
"if",
"(",
"(",
"_pos",
"+",
"index",
")",
"+",
"limit",
">",
"_streamPos",
")",
"{",
"limit",
"=... | index + limit have not to exceed _keepSizeAfter; | [
"index",
"+",
"limit",
"have",
"not",
"to",
"exceed",
"_keepSizeAfter",
";"
] | 763aeed49d92ca607c5c1e09fce7af611d59f2aa | https://github.com/jponge/lzma-java/blob/763aeed49d92ca607c5c1e09fce7af611d59f2aa/src/main/java/lzma/sdk/lz/InWindow.java#L159-L177 | train |
zalando-stups/spring-boot-etcd | zalando-boot-etcd/src/main/java/org/zalando/boot/etcd/EtcdClient.java | EtcdClient.get | public EtcdResponse get(String key) throws EtcdException {
UriComponentsBuilder builder = UriComponentsBuilder.fromUriString(KEYSPACE);
builder.pathSegment(key);
return execute(builder, HttpMethod.GET, null, EtcdResponse.class);
} | java | public EtcdResponse get(String key) throws EtcdException {
UriComponentsBuilder builder = UriComponentsBuilder.fromUriString(KEYSPACE);
builder.pathSegment(key);
return execute(builder, HttpMethod.GET, null, EtcdResponse.class);
} | [
"public",
"EtcdResponse",
"get",
"(",
"String",
"key",
")",
"throws",
"EtcdException",
"{",
"UriComponentsBuilder",
"builder",
"=",
"UriComponentsBuilder",
".",
"fromUriString",
"(",
"KEYSPACE",
")",
";",
"builder",
".",
"pathSegment",
"(",
"key",
")",
";",
"ret... | Returns the node with the given key from etcd.
@param key
the node's key
@return the response from etcd with the node
@throws EtcdException
in case etcd returned an error | [
"Returns",
"the",
"node",
"with",
"the",
"given",
"key",
"from",
"etcd",
"."
] | 6b4f48663d424777326c38b1e7da75c8b68a3841 | https://github.com/zalando-stups/spring-boot-etcd/blob/6b4f48663d424777326c38b1e7da75c8b68a3841/zalando-boot-etcd/src/main/java/org/zalando/boot/etcd/EtcdClient.java#L211-L216 | train |
zalando-stups/spring-boot-etcd | zalando-boot-etcd/src/main/java/org/zalando/boot/etcd/EtcdClient.java | EtcdClient.put | public EtcdResponse put(final String key, final String value) throws EtcdException {
UriComponentsBuilder builder = UriComponentsBuilder.fromUriString(KEYSPACE);
builder.pathSegment(key);
MultiValueMap<String, String> payload = new LinkedMultiValueMap<>(1);
payload.set("value", value);
return execute(builde... | java | public EtcdResponse put(final String key, final String value) throws EtcdException {
UriComponentsBuilder builder = UriComponentsBuilder.fromUriString(KEYSPACE);
builder.pathSegment(key);
MultiValueMap<String, String> payload = new LinkedMultiValueMap<>(1);
payload.set("value", value);
return execute(builde... | [
"public",
"EtcdResponse",
"put",
"(",
"final",
"String",
"key",
",",
"final",
"String",
"value",
")",
"throws",
"EtcdException",
"{",
"UriComponentsBuilder",
"builder",
"=",
"UriComponentsBuilder",
".",
"fromUriString",
"(",
"KEYSPACE",
")",
";",
"builder",
".",
... | Sets the value of the node with the given key in etcd. Any previously
existing key-value pair is returned as prevNode in the etcd response.
@param key
the node's key
@param value
the node's value
@return the response from etcd with the node
@throws EtcdException
in case etcd returned an error | [
"Sets",
"the",
"value",
"of",
"the",
"node",
"with",
"the",
"given",
"key",
"in",
"etcd",
".",
"Any",
"previously",
"existing",
"key",
"-",
"value",
"pair",
"is",
"returned",
"as",
"prevNode",
"in",
"the",
"etcd",
"response",
"."
] | 6b4f48663d424777326c38b1e7da75c8b68a3841 | https://github.com/zalando-stups/spring-boot-etcd/blob/6b4f48663d424777326c38b1e7da75c8b68a3841/zalando-boot-etcd/src/main/java/org/zalando/boot/etcd/EtcdClient.java#L250-L258 | train |
zalando-stups/spring-boot-etcd | zalando-boot-etcd/src/main/java/org/zalando/boot/etcd/EtcdClient.java | EtcdClient.delete | public EtcdResponse delete(final String key) throws EtcdException {
UriComponentsBuilder builder = UriComponentsBuilder.fromUriString(KEYSPACE);
builder.pathSegment(key);
return execute(builder, HttpMethod.DELETE, null, EtcdResponse.class);
} | java | public EtcdResponse delete(final String key) throws EtcdException {
UriComponentsBuilder builder = UriComponentsBuilder.fromUriString(KEYSPACE);
builder.pathSegment(key);
return execute(builder, HttpMethod.DELETE, null, EtcdResponse.class);
} | [
"public",
"EtcdResponse",
"delete",
"(",
"final",
"String",
"key",
")",
"throws",
"EtcdException",
"{",
"UriComponentsBuilder",
"builder",
"=",
"UriComponentsBuilder",
".",
"fromUriString",
"(",
"KEYSPACE",
")",
";",
"builder",
".",
"pathSegment",
"(",
"key",
")",... | Deletes the node with the given key from etcd.
@param key
the node's key
@return the response from etcd with the node
@throws EtcdException
in case etcd returned an error | [
"Deletes",
"the",
"node",
"with",
"the",
"given",
"key",
"from",
"etcd",
"."
] | 6b4f48663d424777326c38b1e7da75c8b68a3841 | https://github.com/zalando-stups/spring-boot-etcd/blob/6b4f48663d424777326c38b1e7da75c8b68a3841/zalando-boot-etcd/src/main/java/org/zalando/boot/etcd/EtcdClient.java#L294-L299 | train |
zalando-stups/spring-boot-etcd | zalando-boot-etcd/src/main/java/org/zalando/boot/etcd/EtcdClient.java | EtcdClient.listMembers | public EtcdMemberResponse listMembers() throws EtcdException {
UriComponentsBuilder builder = UriComponentsBuilder.fromUriString(MEMBERSPACE);
return execute(builder, HttpMethod.GET, null, EtcdMemberResponse.class);
} | java | public EtcdMemberResponse listMembers() throws EtcdException {
UriComponentsBuilder builder = UriComponentsBuilder.fromUriString(MEMBERSPACE);
return execute(builder, HttpMethod.GET, null, EtcdMemberResponse.class);
} | [
"public",
"EtcdMemberResponse",
"listMembers",
"(",
")",
"throws",
"EtcdException",
"{",
"UriComponentsBuilder",
"builder",
"=",
"UriComponentsBuilder",
".",
"fromUriString",
"(",
"MEMBERSPACE",
")",
";",
"return",
"execute",
"(",
"builder",
",",
"HttpMethod",
".",
... | Returns a representation of all members in the etcd cluster.
@return the members
@throws EtcdException
in case etcd returned an error | [
"Returns",
"a",
"representation",
"of",
"all",
"members",
"in",
"the",
"etcd",
"cluster",
"."
] | 6b4f48663d424777326c38b1e7da75c8b68a3841 | https://github.com/zalando-stups/spring-boot-etcd/blob/6b4f48663d424777326c38b1e7da75c8b68a3841/zalando-boot-etcd/src/main/java/org/zalando/boot/etcd/EtcdClient.java#L581-L584 | train |
zalando-stups/spring-boot-etcd | zalando-boot-etcd/src/main/java/org/zalando/boot/etcd/EtcdClient.java | EtcdClient.updateMembers | private void updateMembers() {
try {
List<String> locations = new ArrayList<String>();
EtcdMemberResponse response = listMembers();
EtcdMember[] members = response.getMembers();
for (EtcdMember member : members) {
String[] clientUrls = member.getClientURLs();
if (clientUrls != null) {
for (... | java | private void updateMembers() {
try {
List<String> locations = new ArrayList<String>();
EtcdMemberResponse response = listMembers();
EtcdMember[] members = response.getMembers();
for (EtcdMember member : members) {
String[] clientUrls = member.getClientURLs();
if (clientUrls != null) {
for (... | [
"private",
"void",
"updateMembers",
"(",
")",
"{",
"try",
"{",
"List",
"<",
"String",
">",
"locations",
"=",
"new",
"ArrayList",
"<",
"String",
">",
"(",
")",
";",
"EtcdMemberResponse",
"response",
"=",
"listMembers",
"(",
")",
";",
"EtcdMember",
"[",
"]... | Updates the locations of the etcd cluster members. | [
"Updates",
"the",
"locations",
"of",
"the",
"etcd",
"cluster",
"members",
"."
] | 6b4f48663d424777326c38b1e7da75c8b68a3841 | https://github.com/zalando-stups/spring-boot-etcd/blob/6b4f48663d424777326c38b1e7da75c8b68a3841/zalando-boot-etcd/src/main/java/org/zalando/boot/etcd/EtcdClient.java#L627-L658 | train |
zalando-stups/spring-boot-etcd | zalando-boot-etcd/src/main/java/org/zalando/boot/etcd/EtcdClient.java | EtcdClient.execute | private <T> T execute(UriComponentsBuilder uriTemplate, HttpMethod method,
MultiValueMap<String, String> requestData, Class<T> responseType) throws EtcdException {
long startTimeMillis = System.currentTimeMillis();
int retry = -1;
ResourceAccessException lastException = null;
do {
lastException = null;
... | java | private <T> T execute(UriComponentsBuilder uriTemplate, HttpMethod method,
MultiValueMap<String, String> requestData, Class<T> responseType) throws EtcdException {
long startTimeMillis = System.currentTimeMillis();
int retry = -1;
ResourceAccessException lastException = null;
do {
lastException = null;
... | [
"private",
"<",
"T",
">",
"T",
"execute",
"(",
"UriComponentsBuilder",
"uriTemplate",
",",
"HttpMethod",
"method",
",",
"MultiValueMap",
"<",
"String",
",",
"String",
">",
"requestData",
",",
"Class",
"<",
"T",
">",
"responseType",
")",
"throws",
"EtcdExceptio... | Executes the given method on the given location using the given request
data.
@param uri
the location
@param method
the HTTP method
@param requestData
the request data
@return the etcd response
@throws EtcdException
in case etcd returned an error | [
"Executes",
"the",
"given",
"method",
"on",
"the",
"given",
"location",
"using",
"the",
"given",
"request",
"data",
"."
] | 6b4f48663d424777326c38b1e7da75c8b68a3841 | https://github.com/zalando-stups/spring-boot-etcd/blob/6b4f48663d424777326c38b1e7da75c8b68a3841/zalando-boot-etcd/src/main/java/org/zalando/boot/etcd/EtcdClient.java#L674-L717 | train |
metamx/java-util | src/main/java/com/metamx/common/collect/MoreIterators.java | MoreIterators.before | public static <X> Iterator<X> before(final Iterator<X> iterator, final Runnable f)
{
return new Iterator<X>()
{
private final Runnable fOnlyOnce = new RunOnlyOnce(f);
@Override
public boolean hasNext()
{
fOnlyOnce.run();
return iterator.hasNext();
}
@Overr... | java | public static <X> Iterator<X> before(final Iterator<X> iterator, final Runnable f)
{
return new Iterator<X>()
{
private final Runnable fOnlyOnce = new RunOnlyOnce(f);
@Override
public boolean hasNext()
{
fOnlyOnce.run();
return iterator.hasNext();
}
@Overr... | [
"public",
"static",
"<",
"X",
">",
"Iterator",
"<",
"X",
">",
"before",
"(",
"final",
"Iterator",
"<",
"X",
">",
"iterator",
",",
"final",
"Runnable",
"f",
")",
"{",
"return",
"new",
"Iterator",
"<",
"X",
">",
"(",
")",
"{",
"private",
"final",
"Ru... | Run f immediately before the first element of iterator is generated.
Exceptions raised by f will prevent the requested behavior on the
underlying iterator, and can be handled by the caller. | [
"Run",
"f",
"immediately",
"before",
"the",
"first",
"element",
"of",
"iterator",
"is",
"generated",
".",
"Exceptions",
"raised",
"by",
"f",
"will",
"prevent",
"the",
"requested",
"behavior",
"on",
"the",
"underlying",
"iterator",
"and",
"can",
"be",
"handled"... | 9d204043da1136e94fb2e2d63e3543a29bf54b4d | https://github.com/metamx/java-util/blob/9d204043da1136e94fb2e2d63e3543a29bf54b4d/src/main/java/com/metamx/common/collect/MoreIterators.java#L34-L61 | train |
metamx/java-util | src/main/java/com/metamx/common/collect/MoreIterators.java | MoreIterators.after | public static <X> Iterator<X> after(final Iterator<X> iterator, final Runnable f)
{
return new Iterator<X>()
{
private final Runnable fOnlyOnce = new RunOnlyOnce(f);
@Override
public boolean hasNext()
{
final boolean hasNext = iterator.hasNext();
if (!hasNext) {
... | java | public static <X> Iterator<X> after(final Iterator<X> iterator, final Runnable f)
{
return new Iterator<X>()
{
private final Runnable fOnlyOnce = new RunOnlyOnce(f);
@Override
public boolean hasNext()
{
final boolean hasNext = iterator.hasNext();
if (!hasNext) {
... | [
"public",
"static",
"<",
"X",
">",
"Iterator",
"<",
"X",
">",
"after",
"(",
"final",
"Iterator",
"<",
"X",
">",
"iterator",
",",
"final",
"Runnable",
"f",
")",
"{",
"return",
"new",
"Iterator",
"<",
"X",
">",
"(",
")",
"{",
"private",
"final",
"Run... | Run f immediately after the last element of iterator is generated.
Exceptions must not be raised by f. | [
"Run",
"f",
"immediately",
"after",
"the",
"last",
"element",
"of",
"iterator",
"is",
"generated",
".",
"Exceptions",
"must",
"not",
"be",
"raised",
"by",
"f",
"."
] | 9d204043da1136e94fb2e2d63e3543a29bf54b4d | https://github.com/metamx/java-util/blob/9d204043da1136e94fb2e2d63e3543a29bf54b4d/src/main/java/com/metamx/common/collect/MoreIterators.java#L67-L101 | train |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.