@@ -211,7 +211,7 @@ public void open(final String iUserName, final String iUserPassword, final Map<S
211211 "Error on loading cluster '" + clusters .get (i ).getName () + "' (" + i
212212 + "): file not found. It will be excluded from current database '" + getName () + "'." );
213213
214- clusterMap .remove (clusters .get (i ).getName ());
214+ clusterMap .remove (clusters .get (i ).getName (). toLowerCase () );
215215
216216 setCluster (i , null );
217217 }
@@ -537,7 +537,7 @@ public boolean dropCluster(final int iClusterId, final boolean iTruncate) {
537537 cluster .delete ();
538538
539539 dirtyFlag .makeDirty ();
540- clusterMap .remove (cluster .getName ());
540+ clusterMap .remove (cluster .getName (). toLowerCase () );
541541 clusters .set (iClusterId , null );
542542
543543 // UPDATE CONFIGURATION
@@ -995,35 +995,35 @@ public Set<String> getClusterNames() {
995995 return new HashSet <String >(clusterMap .keySet ());
996996 }
997997
998- public int getClusterIdByName (final String iClusterName ) {
998+ public int getClusterIdByName (final String сlusterName ) {
999999 checkOpeness ();
10001000
1001- if (iClusterName == null )
1001+ if (сlusterName == null )
10021002 throw new IllegalArgumentException ("Cluster name is null" );
10031003
1004- if (iClusterName .length () == 0 )
1004+ if (сlusterName .length () == 0 )
10051005 throw new IllegalArgumentException ("Cluster name is empty" );
10061006
1007- if (Character .isDigit (iClusterName .charAt (0 )))
1008- return Integer .parseInt (iClusterName );
1007+ if (Character .isDigit (сlusterName .charAt (0 )))
1008+ return Integer .parseInt (сlusterName );
10091009
10101010 // SEARCH IT BETWEEN PHYSICAL CLUSTERS
10111011
1012- final OCluster segment = clusterMap .get (iClusterName .toLowerCase ());
1012+ final OCluster segment = clusterMap .get (сlusterName .toLowerCase ());
10131013 if (segment != null )
10141014 return segment .getId ();
10151015
10161016 return -1 ;
10171017 }
10181018
1019- public String getClusterTypeByName (final String iClusterName ) {
1019+ public String getClusterTypeByName (final String сlusterName ) {
10201020 checkOpeness ();
10211021
1022- if (iClusterName == null )
1022+ if (сlusterName == null )
10231023 throw new IllegalArgumentException ("Cluster name is null" );
10241024
10251025 // SEARCH IT BETWEEN PHYSICAL CLUSTERS
1026- final OCluster segment = clusterMap .get (iClusterName .toLowerCase ());
1026+ final OCluster segment = clusterMap .get (сlusterName .toLowerCase ());
10271027 if (segment != null )
10281028 return segment .getType ();
10291029
@@ -1185,11 +1185,11 @@ public OCluster getClusterById(int iClusterId) {
11851185 }
11861186
11871187 @ 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 ());
11901190
11911191 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 + "'" );
11931193 return cluster ;
11941194 }
11951195
@@ -1245,8 +1245,8 @@ public Set<OCluster> getClusterInstances() {
12451245 * Method that completes the cluster rename operation. <strong>IT WILL NOT RENAME A CLUSTER, IT JUST CHANGES THE NAME IN THE
12461246 * INTERNAL MAPPING</strong>
12471247 */
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 ()));
12501250 }
12511251
12521252 @ Override
@@ -2074,16 +2074,16 @@ private void checkClusterSegmentIndexRange(final int iClusterId) {
20742074 throw new IllegalArgumentException ("Cluster segment #" + iClusterId + " does not exist in database '" + name + "'" );
20752075 }
20762076
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 ());
20792079
20802080 if (cluster != null ) {
2081- cluster .configure (this , iConfig );
2081+ cluster .configure (this , сonfig );
20822082 return -1 ;
20832083 }
20842084
20852085 cluster = OPaginatedClusterFactory .INSTANCE .createCluster (configuration .version );
2086- cluster .configure (this , iConfig );
2086+ cluster .configure (this , сonfig );
20872087
20882088 return registerCluster (cluster );
20892089 }
@@ -2101,11 +2101,11 @@ private int registerCluster(final OCluster cluster) throws IOException {
21012101
21022102 if (cluster != null ) {
21032103 // CHECK FOR DUPLICATION OF NAMES
2104- if (clusterMap .containsKey (cluster .getName ()))
2104+ if (clusterMap .containsKey (cluster .getName (). toLowerCase () ))
21052105 throw new OConfigurationException ("Cannot add segment '" + cluster .getName ()
21062106 + "' because it is already registered in database '" + name + "'" );
21072107 // CREATE AND ADD THE NEW REF SEGMENT
2108- clusterMap .put (cluster .getName (), cluster );
2108+ clusterMap .put (cluster .getName (). toLowerCase () , cluster );
21092109 id = cluster .getId ();
21102110 } else {
21112111 id = clusters .size ();
0 commit comments