Skip to content

Commit

Permalink
HPPC-145: Removed any Open infix from all classes.
Browse files Browse the repository at this point in the history
  • Loading branch information
dweiss committed Apr 24, 2015
1 parent e3cc684 commit 3fe735b
Show file tree
Hide file tree
Showing 27 changed files with 456 additions and 492 deletions.
6 changes: 6 additions & 0 deletions CHANGES.txt
Expand Up @@ -94,9 +94,15 @@ HPPC-117: A summary of API changes resulting from other issues.

* (HPPC-144): Several less-frequently used classes have been moved to
a separate JAR file. See full description of HPPC-144 below.

* (HPPC-145): Removed any "Open" infix from all classes:
KTypeOpenHashSet -> KTypeHashSet
KTypeVTypeOpenHashMap -> KTypeVTypeHashMap

This comment has been minimized.

Copy link
@aldenquimby

aldenquimby Dec 8, 2015

@dweiss any chance you could put out a maven release where the Open infixes still exist and are deprecated?

@Deprecated
public class IntIntOpenHashMap extends IntIntHashMap {}

This breaking API change is causing some dependency issues for me because I use both elasticsearch and languagetool in the same project, which both depend on hppc.

I can make a fork and use a custom version of hppc, but I'd like to stay on maven central if possible, and it seems reasonable to me that hppc might have a release where both old and new names exist to make upgrading easier on users, so I thought I'd ask.

Thanks!

This comment has been minimized.

Copy link
@dweiss

dweiss Dec 8, 2015

Author Member

Unfortunately this isn't as straightforward as it sounds as certain classes changed incompatibly within their API code -- it's not just having multiple classes. You can try to make a fork for your needs, but I think you just fell victim to the jar hell issue; there's no easy way out (without resorting to even more complex/ ugly solutions like classloader separation, OSGi containers, etc.).

Doesn't ES 2.1 implement plugin isolation? If so, perhaps you could upgrade ES and utilize that?

This comment has been minimized.

Copy link
@aldenquimby

aldenquimby Dec 8, 2015

Thanks for the quick response. Java dependencies get pretty fun with large projects haha. In the short term, I'll make a fork that has the classes I need. Medium term I'm hoping to get languagetool upgraded to morfologik 2.0.x, which would also solve things for me.

ES does have plugin isolation now, but I think the ES core uses hppc so the isolation doesn't help here

This comment has been minimized.

Copy link
@aldenquimby

This comment has been minimized.

Copy link
@dweiss

dweiss Dec 8, 2015

Author Member

Thanks for contributing this to LT, Alden! Yeah, Java's modularity system really sucks big time. And Java9 is going to make things even more complicated with jigsaw!


** New features

HPPC-145: Removed any "Open" infix from all classes.

HPPC-144: Moved certain esoteric key/value containers to a separate JAR. This
JAR has an identical dependency as main HPPC jar, but is declared with
an "esoteric" classifier. The following containers are included
Expand Down
@@ -1,13 +1,13 @@
package com.carrotsearch.hppc.benchmarks.implementations;

import com.carrotsearch.hppc.IntOpenHashSet;
import com.carrotsearch.hppc.IntHashSet;
import com.carrotsearch.hppc.benchmarks.IntSetOps;

public class HppcIntSetOps implements IntSetOps {
private final IntOpenHashSet delegate;
private final IntHashSet delegate;

public HppcIntSetOps(int expectedElements, double loadFactor) {
this.delegate = new IntOpenHashSet(expectedElements, loadFactor);
this.delegate = new IntHashSet(expectedElements, loadFactor);
}

@Override
Expand Down
Expand Up @@ -6,27 +6,25 @@
/**
* A reference-equality (identity) hash set.
*/
public class ObjectOpenIdentityHashSet<KType>
extends ObjectOpenHashSet<KType> {

public class ObjectIdentityHashSet<KType> extends ObjectHashSet<KType> {
/**
* New instance with sane defaults.
*/
public ObjectOpenIdentityHashSet() {
public ObjectIdentityHashSet() {
this(DEFAULT_EXPECTED_ELEMENTS, DEFAULT_LOAD_FACTOR);
}

/**
* New instance with sane defaults.
*/
public ObjectOpenIdentityHashSet(int expectedElements) {
public ObjectIdentityHashSet(int expectedElements) {
this(expectedElements, DEFAULT_LOAD_FACTOR);
}

/**
* New instance with sane defaults.
*/
public ObjectOpenIdentityHashSet(int expectedElements, double loadFactor) {
public ObjectIdentityHashSet(int expectedElements, double loadFactor) {
this(expectedElements, loadFactor, HashOrderMixing.randomized());
}

Expand All @@ -43,7 +41,7 @@ public ObjectOpenIdentityHashSet(int expectedElements, double loadFactor) {
* implementations. Use constant mixers only if you understand the potential
* consequences.
*/
public ObjectOpenIdentityHashSet(int expectedElements, double loadFactor, HashOrderMixingStrategy orderMixer) {
public ObjectIdentityHashSet(int expectedElements, double loadFactor, HashOrderMixingStrategy orderMixer) {
this.orderMixer = orderMixer;
this.loadFactor = verifyLoadFactor(loadFactor);
ensureCapacity(expectedElements);
Expand All @@ -52,7 +50,7 @@ public ObjectOpenIdentityHashSet(int expectedElements, double loadFactor, HashOr
/**
* New instance copying elements from another {@link ObjectContainer}.
*/
public ObjectOpenIdentityHashSet(ObjectContainer<? extends KType> container) {
public ObjectIdentityHashSet(ObjectContainer<? extends KType> container) {
this(container.size());
addAll(container);
}
Expand All @@ -74,8 +72,8 @@ protected boolean equals(Object v1, Object v2) {
* internal buffer.
*/
@SafeVarargs
public static <KType> ObjectOpenIdentityHashSet<KType> from(KType... elements) {
final ObjectOpenIdentityHashSet<KType> set = new ObjectOpenIdentityHashSet<KType>(elements.length);
public static <KType> ObjectIdentityHashSet<KType> from(KType... elements) {
final ObjectIdentityHashSet<KType> set = new ObjectIdentityHashSet<KType>(elements.length);
set.addAll(elements);
return set;
}
Expand Down
Binary file not shown.
Binary file not shown.

0 comments on commit 3fe735b

Please sign in to comment.