public class org.apache.kafkaesque.clients.producer.internals.StickyPartitionCache extends java.lang.Object
{
private final java.util.concurrent.ConcurrentMap indexCache;
public void <init>()
{
java.util.concurrent.ConcurrentHashMap v;
org.apache.kafkaesque.clients.producer.internals.StickyPartitionCache v;
v := @this: org.apache.kafkaesque.clients.producer.internals.StickyPartitionCache;
specialinvoke v.<java.lang.Object: void <init>()>();
v = new java.util.concurrent.ConcurrentHashMap;
specialinvoke v.<java.util.concurrent.ConcurrentHashMap: void <init>()>();
v.<org.apache.kafkaesque.clients.producer.internals.StickyPartitionCache: java.util.concurrent.ConcurrentMap indexCache> = v;
return;
}
public int partition(java.lang.String, org.apache.kafkaesque.common.Cluster)
{
org.apache.kafkaesque.common.Cluster v;
java.util.concurrent.ConcurrentMap v;
org.apache.kafkaesque.clients.producer.internals.StickyPartitionCache v;
int v, v, v;
java.lang.Object v;
java.lang.String v;
v := @this: org.apache.kafkaesque.clients.producer.internals.StickyPartitionCache;
v := @parameter: java.lang.String;
v := @parameter: org.apache.kafkaesque.common.Cluster;
v = v.<org.apache.kafkaesque.clients.producer.internals.StickyPartitionCache: java.util.concurrent.ConcurrentMap indexCache>;
v = interfaceinvoke v.<java.util.concurrent.ConcurrentMap: java.lang.Object get(java.lang.Object)>(v);
if v != null goto label;
v = (int) -1;
v = virtualinvoke v.<org.apache.kafkaesque.clients.producer.internals.StickyPartitionCache: int nextPartition(java.lang.String,org.apache.kafkaesque.common.Cluster,int)>(v, v, v);
return v;
label:
v = virtualinvoke v.<java.lang.Integer: int intValue()>();
return v;
}
public int nextPartition(java.lang.String, org.apache.kafkaesque.common.Cluster, int)
{
org.apache.kafkaesque.common.Cluster v;
java.lang.Integer v, v, v, v;
org.apache.kafkaesque.clients.producer.internals.StickyPartitionCache v;
boolean v;
java.util.List v, v;
java.util.concurrent.ConcurrentMap v, v, v, v, v;
java.util.concurrent.ThreadLocalRandom v, v;
int v, v, v, v, v, v, v, v, v, v, v, v, v, v, v, v, v, v;
java.lang.String v;
java.lang.Object v, v, v, v, v;
v := @this: org.apache.kafkaesque.clients.producer.internals.StickyPartitionCache;
v := @parameter: java.lang.String;
v := @parameter: org.apache.kafkaesque.common.Cluster;
v := @parameter: int;
v = virtualinvoke v.<org.apache.kafkaesque.common.Cluster: java.util.List partitionsForTopic(java.lang.String)>(v);
v = v.<org.apache.kafkaesque.clients.producer.internals.StickyPartitionCache: java.util.concurrent.ConcurrentMap indexCache>;
v = interfaceinvoke v.<java.util.concurrent.ConcurrentMap: java.lang.Object get(java.lang.Object)>(v);
v = v;
if v == null goto label;
v = virtualinvoke v.<java.lang.Integer: int intValue()>();
if v != v goto label;
label:
v = virtualinvoke v.<org.apache.kafkaesque.common.Cluster: java.util.List availablePartitionsForTopic(java.lang.String)>(v);
v = interfaceinvoke v.<java.util.List: int size()>();
if v >= 1 goto label;
v = staticinvoke <java.util.concurrent.ThreadLocalRandom: java.util.concurrent.ThreadLocalRandom current()>();
v = virtualinvoke v.<java.util.concurrent.ThreadLocalRandom: int nextInt()>();
v = staticinvoke <org.apache.kafkaesque.common.utils.Utils: int toPositive(int)>(v);
v = staticinvoke <java.lang.Integer: java.lang.Integer valueOf(int)>(v);
v = virtualinvoke v.<java.lang.Integer: int intValue()>();
v = interfaceinvoke v.<java.util.List: int size()>();
v = v % v;
v = staticinvoke <java.lang.Integer: java.lang.Integer valueOf(int)>(v);
goto label;
label:
v = interfaceinvoke v.<java.util.List: int size()>();
if v != 1 goto label;
v = interfaceinvoke v.<java.util.List: java.lang.Object get(int)>(0);
v = virtualinvoke v.<org.apache.kafkaesque.common.PartitionInfo: int partition()>();
v = staticinvoke <java.lang.Integer: java.lang.Integer valueOf(int)>(v);
goto label;
label:
if v == null goto label;
v = virtualinvoke v.<java.lang.Integer: boolean equals(java.lang.Object)>(v);
if v == 0 goto label;
label:
v = staticinvoke <java.util.concurrent.ThreadLocalRandom: java.util.concurrent.ThreadLocalRandom current()>();
v = virtualinvoke v.<java.util.concurrent.ThreadLocalRandom: int nextInt()>();
v = staticinvoke <org.apache.kafkaesque.common.utils.Utils: int toPositive(int)>(v);
v = staticinvoke <java.lang.Integer: java.lang.Integer valueOf(int)>(v);
v = virtualinvoke v.<java.lang.Integer: int intValue()>();
v = interfaceinvoke v.<java.util.List: int size()>();
v = v % v;
v = interfaceinvoke v.<java.util.List: java.lang.Object get(int)>(v);
v = virtualinvoke v.<org.apache.kafkaesque.common.PartitionInfo: int partition()>();
v = staticinvoke <java.lang.Integer: java.lang.Integer valueOf(int)>(v);
goto label;
label:
if v != null goto label;
v = v.<org.apache.kafkaesque.clients.producer.internals.StickyPartitionCache: java.util.concurrent.ConcurrentMap indexCache>;
interfaceinvoke v.<java.util.concurrent.ConcurrentMap: java.lang.Object putIfAbsent(java.lang.Object,java.lang.Object)>(v, v);
goto label;
label:
v = v.<org.apache.kafkaesque.clients.producer.internals.StickyPartitionCache: java.util.concurrent.ConcurrentMap indexCache>;
v = staticinvoke <java.lang.Integer: java.lang.Integer valueOf(int)>(v);
interfaceinvoke v.<java.util.concurrent.ConcurrentMap: boolean replace(java.lang.Object,java.lang.Object,java.lang.Object)>(v, v, v);
label:
v = v.<org.apache.kafkaesque.clients.producer.internals.StickyPartitionCache: java.util.concurrent.ConcurrentMap indexCache>;
v = interfaceinvoke v.<java.util.concurrent.ConcurrentMap: java.lang.Object get(java.lang.Object)>(v);
v = virtualinvoke v.<java.lang.Integer: int intValue()>();
return v;
label:
v = v.<org.apache.kafkaesque.clients.producer.internals.StickyPartitionCache: java.util.concurrent.ConcurrentMap indexCache>;
v = interfaceinvoke v.<java.util.concurrent.ConcurrentMap: java.lang.Object get(java.lang.Object)>(v);
v = virtualinvoke v.<java.lang.Integer: int intValue()>();
return v;
}
}