forked from opensearch-project/OpenSearch
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fixed various serialization issues relating to silent ehcache put() a…
…nd get() failures
- Loading branch information
Peter Alfonsi
committed
Oct 13, 2023
1 parent
66915b6
commit f985e63
Showing
4 changed files
with
107 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
50 changes: 50 additions & 0 deletions
50
server/src/main/java/org/opensearch/indices/DummySerializableKey.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
/* | ||
* SPDX-License-Identifier: Apache-2.0 | ||
* | ||
* The OpenSearch Contributors require contributions made to | ||
* this file be licensed under the Apache-2.0 license or a | ||
* compatible open source license. | ||
*/ | ||
|
||
package org.opensearch.indices; | ||
|
||
import java.io.Serializable; | ||
import java.util.Objects; | ||
|
||
public class DummySerializableKey implements Serializable { | ||
private Integer i; | ||
private String s; | ||
public DummySerializableKey(Integer i, String s) { | ||
this.i = i; | ||
this.s = s; | ||
} | ||
|
||
public int getI() { | ||
return i; | ||
} | ||
public String getS() { | ||
return s; | ||
} | ||
@Override | ||
public boolean equals(Object o) { | ||
if (o == this) { | ||
return true; | ||
} | ||
if (!(o instanceof DummySerializableKey)) { | ||
return false; | ||
} | ||
DummySerializableKey other = (DummySerializableKey) o; | ||
return Objects.equals(this.i, other.i) && this.s.equals(other.s); | ||
} | ||
@Override | ||
public final int hashCode() { | ||
int result = 11; | ||
if (i != null) { | ||
result = 31 * result + i.hashCode(); | ||
} | ||
if (s != null) { | ||
result = 31 * result + s.hashCode(); | ||
} | ||
return result; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters