@@ -211,7 +211,7 @@ public void open(final String iUserName, final String iUserPassword, final Map<S
211
211
"Error on loading cluster '" + clusters .get (i ).getName () + "' (" + i
212
212
+ "): file not found. It will be excluded from current database '" + getName () + "'." );
213
213
214
- clusterMap .remove (clusters .get (i ).getName ());
214
+ clusterMap .remove (clusters .get (i ).getName (). toLowerCase () );
215
215
216
216
setCluster (i , null );
217
217
}
@@ -537,7 +537,7 @@ public boolean dropCluster(final int iClusterId, final boolean iTruncate) {
537
537
cluster .delete ();
538
538
539
539
dirtyFlag .makeDirty ();
540
- clusterMap .remove (cluster .getName ());
540
+ clusterMap .remove (cluster .getName (). toLowerCase () );
541
541
clusters .set (iClusterId , null );
542
542
543
543
// UPDATE CONFIGURATION
@@ -995,35 +995,35 @@ public Set<String> getClusterNames() {
995
995
return new HashSet <String >(clusterMap .keySet ());
996
996
}
997
997
998
- public int getClusterIdByName (final String iClusterName ) {
998
+ public int getClusterIdByName (final String сlusterName ) {
999
999
checkOpeness ();
1000
1000
1001
- if (iClusterName == null )
1001
+ if (сlusterName == null )
1002
1002
throw new IllegalArgumentException ("Cluster name is null" );
1003
1003
1004
- if (iClusterName .length () == 0 )
1004
+ if (сlusterName .length () == 0 )
1005
1005
throw new IllegalArgumentException ("Cluster name is empty" );
1006
1006
1007
- if (Character .isDigit (iClusterName .charAt (0 )))
1008
- return Integer .parseInt (iClusterName );
1007
+ if (Character .isDigit (сlusterName .charAt (0 )))
1008
+ return Integer .parseInt (сlusterName );
1009
1009
1010
1010
// SEARCH IT BETWEEN PHYSICAL CLUSTERS
1011
1011
1012
- final OCluster segment = clusterMap .get (iClusterName .toLowerCase ());
1012
+ final OCluster segment = clusterMap .get (сlusterName .toLowerCase ());
1013
1013
if (segment != null )
1014
1014
return segment .getId ();
1015
1015
1016
1016
return -1 ;
1017
1017
}
1018
1018
1019
- public String getClusterTypeByName (final String iClusterName ) {
1019
+ public String getClusterTypeByName (final String сlusterName ) {
1020
1020
checkOpeness ();
1021
1021
1022
- if (iClusterName == null )
1022
+ if (сlusterName == null )
1023
1023
throw new IllegalArgumentException ("Cluster name is null" );
1024
1024
1025
1025
// SEARCH IT BETWEEN PHYSICAL CLUSTERS
1026
- final OCluster segment = clusterMap .get (iClusterName .toLowerCase ());
1026
+ final OCluster segment = clusterMap .get (сlusterName .toLowerCase ());
1027
1027
if (segment != null )
1028
1028
return segment .getType ();
1029
1029
@@ -1185,11 +1185,11 @@ public OCluster getClusterById(int iClusterId) {
1185
1185
}
1186
1186
1187
1187
@ Override
1188
- public OCluster getClusterByName (final String iClusterName ) {
1189
- final OCluster cluster = clusterMap .get (iClusterName .toLowerCase ());
1188
+ public OCluster getClusterByName (final String сlusterName ) {
1189
+ final OCluster cluster = clusterMap .get (сlusterName .toLowerCase ());
1190
1190
1191
1191
if (cluster == null )
1192
- throw new IllegalArgumentException ("Cluster " + iClusterName + " does not exist in database '" + name + "'" );
1192
+ throw new IllegalArgumentException ("Cluster " + сlusterName + " does not exist in database '" + name + "'" );
1193
1193
return cluster ;
1194
1194
}
1195
1195
@@ -1245,8 +1245,8 @@ public Set<OCluster> getClusterInstances() {
1245
1245
* Method that completes the cluster rename operation. <strong>IT WILL NOT RENAME A CLUSTER, IT JUST CHANGES THE NAME IN THE
1246
1246
* INTERNAL MAPPING</strong>
1247
1247
*/
1248
- public void renameCluster (final String iOldName , final String iNewName ) {
1249
- clusterMap .put (iNewName .toLowerCase (), clusterMap .remove (iOldName .toLowerCase ()));
1248
+ public void renameCluster (final String oldName , final String newName ) {
1249
+ clusterMap .put (newName .toLowerCase (), clusterMap .remove (oldName .toLowerCase ()));
1250
1250
}
1251
1251
1252
1252
@ Override
@@ -2074,16 +2074,16 @@ private void checkClusterSegmentIndexRange(final int iClusterId) {
2074
2074
throw new IllegalArgumentException ("Cluster segment #" + iClusterId + " does not exist in database '" + name + "'" );
2075
2075
}
2076
2076
2077
- private int createClusterFromConfig (final OStorageClusterConfiguration iConfig ) throws IOException {
2078
- OCluster cluster = clusterMap .get (iConfig .getName ().toLowerCase ());
2077
+ private int createClusterFromConfig (final OStorageClusterConfiguration сonfig ) throws IOException {
2078
+ OCluster cluster = clusterMap .get (сonfig .getName ().toLowerCase ());
2079
2079
2080
2080
if (cluster != null ) {
2081
- cluster .configure (this , iConfig );
2081
+ cluster .configure (this , сonfig );
2082
2082
return -1 ;
2083
2083
}
2084
2084
2085
2085
cluster = OPaginatedClusterFactory .INSTANCE .createCluster (configuration .version );
2086
- cluster .configure (this , iConfig );
2086
+ cluster .configure (this , сonfig );
2087
2087
2088
2088
return registerCluster (cluster );
2089
2089
}
@@ -2101,11 +2101,11 @@ private int registerCluster(final OCluster cluster) throws IOException {
2101
2101
2102
2102
if (cluster != null ) {
2103
2103
// CHECK FOR DUPLICATION OF NAMES
2104
- if (clusterMap .containsKey (cluster .getName ()))
2104
+ if (clusterMap .containsKey (cluster .getName (). toLowerCase () ))
2105
2105
throw new OConfigurationException ("Cannot add segment '" + cluster .getName ()
2106
2106
+ "' because it is already registered in database '" + name + "'" );
2107
2107
// CREATE AND ADD THE NEW REF SEGMENT
2108
- clusterMap .put (cluster .getName (), cluster );
2108
+ clusterMap .put (cluster .getName (). toLowerCase () , cluster );
2109
2109
id = cluster .getId ();
2110
2110
} else {
2111
2111
id = clusters .size ();
0 commit comments