Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Y
YCSB
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Adnan Ahmad
YCSB
Commits
6eb53b80
Unverified
Commit
6eb53b80
authored
9 years ago
by
Jason Tedor
Browse files
Options
Downloads
Patches
Plain Diff
[elasticsearch] Simplify cluster.name setting
parent
a70aa676
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
elasticsearch/README.md
+1
-1
1 addition, 1 deletion
elasticsearch/README.md
elasticsearch/src/main/java/com/yahoo/ycsb/db/ElasticsearchClient.java
+4
-4
4 additions, 4 deletions
.../src/main/java/com/yahoo/ycsb/db/ElasticsearchClient.java
with
5 additions
and
5 deletions
elasticsearch/README.md
+
1
−
1
View file @
6eb53b80
...
@@ -42,7 +42,7 @@ For further configuration see below:
...
@@ -42,7 +42,7 @@ For further configuration see below:
### Defaults Configuration
### Defaults Configuration
The default setting for the Elasticsearch node that is created is as follows:
The default setting for the Elasticsearch node that is created is as follows:
es.
cluster.name=es.ycsb.cluster
cluster.name=es.ycsb.cluster
es.index.key=es.ycsb
es.index.key=es.ycsb
es.number_of_shards=1
es.number_of_shards=1
es.number_of_replicas=0
es.number_of_replicas=0
...
...
This diff is collapsed.
Click to expand it.
elasticsearch/src/main/java/com/yahoo/ycsb/db/ElasticsearchClient.java
+
4
−
4
View file @
6eb53b80
...
@@ -57,7 +57,7 @@ import java.util.Vector;
...
@@ -57,7 +57,7 @@ import java.util.Vector;
* Default properties to set:
* Default properties to set:
* </p>
* </p>
* <ul>
* <ul>
* <li>
es.
cluster.name = es.ycsb.cluster
* <li>cluster.name = es.ycsb.cluster
* <li>es.index.key = es.ycsb
* <li>es.index.key = es.ycsb
* <li>es.number_of_shards = 1
* <li>es.number_of_shards = 1
* <li>es.number_of_replicas = 0
* <li>es.number_of_replicas = 0
...
@@ -83,7 +83,6 @@ public class ElasticsearchClient extends DB {
...
@@ -83,7 +83,6 @@ public class ElasticsearchClient extends DB {
public
void
init
()
throws
DBException
{
public
void
init
()
throws
DBException
{
Properties
props
=
getProperties
();
Properties
props
=
getProperties
();
this
.
indexKey
=
props
.
getProperty
(
"es.index.key"
,
DEFAULT_INDEX_KEY
);
this
.
indexKey
=
props
.
getProperty
(
"es.index.key"
,
DEFAULT_INDEX_KEY
);
String
clusterName
=
props
.
getProperty
(
"es.cluster.name"
,
DEFAULT_CLUSTER_NAME
);
int
numberOfShards
=
parseIntegerProperty
(
props
,
"es.number_of_shards"
,
NUMBER_OF_SHARDS
);
int
numberOfShards
=
parseIntegerProperty
(
props
,
"es.number_of_shards"
,
NUMBER_OF_SHARDS
);
int
numberOfReplicas
=
parseIntegerProperty
(
props
,
"es.number_of_replicas"
,
NUMBER_OF_REPLICAS
);
int
numberOfReplicas
=
parseIntegerProperty
(
props
,
"es.number_of_replicas"
,
NUMBER_OF_REPLICAS
);
...
@@ -93,14 +92,15 @@ public class ElasticsearchClient extends DB {
...
@@ -93,14 +92,15 @@ public class ElasticsearchClient extends DB {
remoteMode
=
Boolean
.
parseBoolean
(
props
.
getProperty
(
"es.remote"
,
"false"
));
remoteMode
=
Boolean
.
parseBoolean
(
props
.
getProperty
(
"es.remote"
,
"false"
));
Boolean
newdb
=
Boolean
.
parseBoolean
(
props
.
getProperty
(
"es.newdb"
,
"false"
));
Boolean
newdb
=
Boolean
.
parseBoolean
(
props
.
getProperty
(
"es.newdb"
,
"false"
));
Builder
settings
=
Settings
.
settingsBuilder
()
Builder
settings
=
Settings
.
settingsBuilder
()
.
put
(
"cluster.name"
,
clusterName
)
.
put
(
"cluster.name"
,
DEFAULT_CLUSTER_NAME
)
.
put
(
"node.local"
,
Boolean
.
toString
(!
remoteMode
))
.
put
(
"node.local"
,
Boolean
.
toString
(!
remoteMode
))
.
put
(
"path.home"
,
System
.
getProperty
(
"java.io.tmpdir"
));
.
put
(
"path.home"
,
System
.
getProperty
(
"java.io.tmpdir"
));
// if properties file contains elasticsearch user defined properties
// if properties file contains elasticsearch user defined properties
// add it to the settings file (will overwrite the defaults).
// add it to the settings file (will overwrite the defaults).
settings
.
put
(
props
);
settings
.
put
(
props
);
System
.
out
.
println
(
"Elasticsearch starting node = "
+
settings
.
get
(
"cluster.name"
));
final
String
clusterName
=
settings
.
get
(
"cluster.name"
);
System
.
out
.
println
(
"Elasticsearch starting node = "
+
clusterName
);
System
.
out
.
println
(
"Elasticsearch node path.home = "
+
settings
.
get
(
"path.home"
));
System
.
out
.
println
(
"Elasticsearch node path.home = "
+
settings
.
get
(
"path.home"
));
System
.
out
.
println
(
"Elasticsearch Remote Mode = "
+
remoteMode
);
System
.
out
.
println
(
"Elasticsearch Remote Mode = "
+
remoteMode
);
// Remote mode support for connecting to remote elasticsearch cluster
// Remote mode support for connecting to remote elasticsearch cluster
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment