forked from oracle/coherence-operator
-
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.
Showing
16 changed files
with
1,043 additions
and
55 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
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
101 changes: 101 additions & 0 deletions
101
java/operator-test/src/main/java/com/oracle/coherence/idrs/ChannelPosition.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,101 @@ | ||
package com.oracle.coherence.idrs; | ||
|
||
import java.io.DataInput; | ||
import java.io.DataOutput; | ||
import java.io.IOException; | ||
import java.util.Arrays; | ||
import java.util.Objects; | ||
|
||
import com.tangosol.internal.net.topic.impl.paged.model.PagedPosition; | ||
import com.tangosol.internal.net.topic.impl.paged.model.SubscriberId; | ||
import com.tangosol.io.ExternalizableLite; | ||
import com.tangosol.util.ExternalizableHelper; | ||
|
||
public class ChannelPosition | ||
implements ExternalizableLite | ||
{ | ||
public ChannelPosition() | ||
{ | ||
} | ||
|
||
public ChannelPosition(int nChannel, PagedPosition position, SubscriberId subscriberId, int[] anChannel) | ||
{ | ||
m_nChannel = nChannel; | ||
m_position = position; | ||
m_subscriberId = subscriberId; | ||
m_anChannel = anChannel; | ||
} | ||
|
||
public int getChannel() | ||
{ | ||
return m_nChannel; | ||
} | ||
|
||
public PagedPosition getPosition() | ||
{ | ||
return m_position; | ||
} | ||
|
||
@Override | ||
public void readExternal(DataInput in) throws IOException | ||
{ | ||
m_nChannel = in.readInt(); | ||
m_position = ExternalizableHelper.readObject(in); | ||
m_subscriberId = ExternalizableHelper.readObject(in); | ||
int c = in.readInt(); | ||
m_anChannel = new int[c]; | ||
for (int i = 0; i < c; i++) | ||
{ | ||
m_anChannel[i] = in.readInt(); | ||
} | ||
} | ||
|
||
@Override | ||
public void writeExternal(DataOutput out) throws IOException | ||
{ | ||
out.writeInt(m_nChannel); | ||
ExternalizableHelper.writeObject(out, m_position); | ||
ExternalizableHelper.writeObject(out, m_subscriberId); | ||
out.writeInt(m_anChannel.length); | ||
for (int i : m_anChannel) | ||
{ | ||
out.writeInt(i); | ||
} | ||
} | ||
|
||
@Override | ||
public boolean equals(Object o) | ||
{ | ||
if (this == o) return true; | ||
if (o == null || getClass() != o.getClass()) return false; | ||
ChannelPosition that = (ChannelPosition) o; | ||
return m_nChannel == that.m_nChannel && Objects.equals(m_position, that.m_position); | ||
} | ||
|
||
@Override | ||
public int hashCode() | ||
{ | ||
return Objects.hash(m_nChannel, m_position); | ||
} | ||
|
||
@Override | ||
public String toString() | ||
{ | ||
return "ChannelPosition{" + | ||
"channel=" + m_nChannel + | ||
", position=" + m_position + | ||
", subscriber=" + m_subscriberId + | ||
", channels=" + Arrays.toString(m_anChannel) + | ||
'}'; | ||
} | ||
|
||
// ----- data members --------------------------------------------------- | ||
|
||
private int m_nChannel; | ||
|
||
private PagedPosition m_position; | ||
|
||
private SubscriberId m_subscriberId; | ||
|
||
private int[] m_anChannel; | ||
} |
32 changes: 32 additions & 0 deletions
32
java/operator-test/src/main/java/com/oracle/coherence/idrs/Constants.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,32 @@ | ||
package com.oracle.coherence.idrs; | ||
|
||
public interface Constants | ||
{ | ||
String PROP_TOPIC = "coherence.test.topic"; | ||
|
||
String PROP_GROUP = "coherence.test.group"; | ||
|
||
String PROP_STATE_TOPIC = "coherence.test.state.topic"; | ||
|
||
String PROP_STATE_GROUP = "coherence.test.state.group"; | ||
|
||
String PROP_PUBLISH_DELAY = "coherence.test.publish.delay"; | ||
|
||
String PROP_SUBSCRIBER_MIN_TTL = "coherence.test.subscriber.min.ttl"; | ||
|
||
String PROP_SUBSCRIBER_EXTRA_TTL = "coherence.test.subscriber.extra.ttl"; | ||
|
||
String DEFAULT_TOPIC = "test"; | ||
|
||
String DEFAULT_GROUP = "test-group"; | ||
|
||
String DEFAULT_STATE_TOPIC = "test-state"; | ||
|
||
String DEFAULT_STATE_GROUP= "test-state-group"; | ||
|
||
long DEFAULT_PUBLISH_DELAY = 10L; | ||
|
||
int DEFAULT_SUBSCRIBER_MIN_TTL = 60; | ||
|
||
int DEFAULT_SUBSCRIBER_EXTRA_TTL = 60; | ||
} |
Oops, something went wrong.