Skip to content

Commit

Permalink
IGNITE-5364 Remove contention on DataStructure creation or removing
Browse files Browse the repository at this point in the history
  • Loading branch information
mcherkasov authored and anton-vinogradov committed Jun 13, 2017
1 parent 2300ec4 commit 2101132
Show file tree
Hide file tree
Showing 3 changed files with 84 additions and 367 deletions.
Expand Up @@ -17,48 +17,40 @@


package org.apache.ignite.internal.processors.datastructures; package org.apache.ignite.internal.processors.datastructures;


import java.io.Externalizable; import java.io.Serializable;
import java.io.IOException;
import java.io.ObjectInput;
import java.io.ObjectOutput;
import org.apache.ignite.internal.processors.cache.GridCacheInternal;


/** /**
* Key used to store in utility cache information about all created data structures. * Key used to store in utility cache information about created data structures.
*/ */
public class CacheDataStructuresConfigurationKey implements GridCacheInternal, Externalizable { public class DataStructureInfoKey implements Serializable {
/** */ /** */
private static final long serialVersionUID = 0L; private static final long serialVersionUID = 0L;


/** Data structure name. */
private String name;

/** /**
* * @param name Data structure name.
*/ */
public CacheDataStructuresConfigurationKey() { public DataStructureInfoKey(String name) {
// No-op. this.name = name;
} }


/** {@inheritDoc} */ /** {@inheritDoc} */
@Override public int hashCode() { @Override public boolean equals(Object o) {
return getClass().getName().hashCode(); if (this == o)
} return true;


/** {@inheritDoc} */ if (o == null || getClass() != o.getClass())
@Override public boolean equals(Object obj) { return false;
return obj == this || (obj instanceof CacheDataStructuresConfigurationKey);
}


/** {@inheritDoc} */ DataStructureInfoKey key2 = (DataStructureInfoKey)o;
@Override public void writeExternal(ObjectOutput out) throws IOException {
// No-op.
}


/** {@inheritDoc} */ return name != null ? name.equals(key2.name) : key2.name == null;
@Override public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException {
// No-op.
} }


/** {@inheritDoc} */ /** {@inheritDoc} */
@Override public String toString() { @Override public int hashCode() {
return "CacheDataStructuresConfigurationKey []"; return name != null ? name.hashCode() : 0;
} }
} }
Expand Up @@ -17,48 +17,26 @@


package org.apache.ignite.internal.processors.datastructures; package org.apache.ignite.internal.processors.datastructures;


import java.io.Externalizable; import java.io.Serializable;
import java.io.IOException;
import java.io.ObjectInput;
import java.io.ObjectOutput;
import org.apache.ignite.internal.processors.cache.GridCacheInternal;


/** /**
* Internal key for data structures processor. * Internal key for data structures processor.
*/ */
public class CacheDataStructuresCacheKey implements GridCacheInternal, Externalizable { public class DataStructuresCacheKey implements Serializable {
/** */ /** */
private static final long serialVersionUID = 0L; private static final long serialVersionUID = 0L;


/**
*
*/
public CacheDataStructuresCacheKey() {
// No-op.
}

/** {@inheritDoc} */ /** {@inheritDoc} */
@Override public int hashCode() { @Override public int hashCode() {
return getClass().getName().hashCode(); return getClass().getName().hashCode();
} }


/** {@inheritDoc} */ /** {@inheritDoc} */
@Override public boolean equals(Object obj) { @Override public boolean equals(Object obj) {
return obj == this || (obj instanceof CacheDataStructuresCacheKey); return obj == this || (obj instanceof DataStructuresCacheKey);
}

/** {@inheritDoc} */
@Override public void writeExternal(ObjectOutput out) throws IOException {
// No-op.
} }


/** {@inheritDoc} */
@Override public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException {
// No-op.
}

/** {@inheritDoc} */
@Override public String toString() { @Override public String toString() {
return "CacheDataStructuresCacheKey []"; return "DataStructuresCacheKey []";
} }
} }

0 comments on commit 2101132

Please sign in to comment.