本文整理汇总了Java中org.apache.flink.api.common.typeutils.base.LongComparator类的典型用法代码示例。如果您正苦于以下问题:Java LongComparator类的具体用法?Java LongComparator怎么用?Java LongComparator使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
LongComparator类属于org.apache.flink.api.common.typeutils.base包,在下文中一共展示了LongComparator类的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createComparator
import org.apache.flink.api.common.typeutils.base.LongComparator; //导入依赖的package包/类
@Override
protected TupleComparator<Tuple3<Integer, Long, Double>> createComparator(boolean ascending) {
return new TupleComparator<Tuple3<Integer, Long, Double>>(
new int[]{0, 1},
new TypeComparator[]{
new IntComparator(ascending),
new LongComparator(ascending)
},
new TypeSerializer[]{ IntSerializer.INSTANCE, LongSerializer.INSTANCE });
}
示例2: createComparator
import org.apache.flink.api.common.typeutils.base.LongComparator; //导入依赖的package包/类
@SuppressWarnings("unchecked")
@Override
protected TupleComparator<Tuple3<Tuple2<String, Double>, Tuple2<Long, Long>, Tuple2<Integer, Long>>> createComparator(
boolean ascending) {
return new TupleComparator<Tuple3<Tuple2<String, Double>, Tuple2<Long, Long>, Tuple2<Integer, Long>>>(
new int[] { 0, 2 },
new TypeComparator[] {
new TupleComparator<Tuple2<String, Double>>(
new int[] { 0, 1 },
new TypeComparator[] {
new StringComparator(ascending),
new DoubleComparator(ascending) },
new TypeSerializer[] {
StringSerializer.INSTANCE,
DoubleSerializer.INSTANCE }),
new TupleComparator<Tuple2<Integer, Long>>(
new int[] { 0, 1 },
new TypeComparator[] {
new IntComparator(ascending),
new LongComparator(ascending) },
new TypeSerializer[] {
IntSerializer.INSTANCE,
LongSerializer.INSTANCE }) },
new TypeSerializer[] {
new TupleSerializer<Tuple2<String, Double>>(
(Class<Tuple2<String, Double>>) (Class<?>) Tuple2.class,
new TypeSerializer[] {
StringSerializer.INSTANCE,
DoubleSerializer.INSTANCE }),
new TupleSerializer<Tuple2<Long, Long>>(
(Class<Tuple2<Long, Long>>) (Class<?>) Tuple2.class,
new TypeSerializer[] {
LongSerializer.INSTANCE,
LongSerializer.INSTANCE }),
new TupleSerializer<Tuple2<Integer, Long>>(
(Class<Tuple2<Integer, Long>>) (Class<?>) Tuple2.class,
new TypeSerializer[] {
IntSerializer.INSTANCE,
LongSerializer.INSTANCE }) });
}
示例3: createComparator
import org.apache.flink.api.common.typeutils.base.LongComparator; //导入依赖的package包/类
@Override
protected TupleComparator<Tuple3<Integer, Long, Double>> createComparator(boolean ascending) {
return new TupleComparator<Tuple3<Integer, Long, Double>>(
new int[]{2, 0, 1},
new TypeComparator[]{
new DoubleComparator(ascending),
new IntComparator(ascending),
new LongComparator(ascending)
},
new TypeSerializer[]{ IntSerializer.INSTANCE, LongSerializer.INSTANCE, DoubleSerializer.INSTANCE });
}
示例4: createComparator
import org.apache.flink.api.common.typeutils.base.LongComparator; //导入依赖的package包/类
@Override
protected TupleComparator<Tuple3<Integer, Long, Double>> createComparator(boolean ascending) {
return new TupleComparator<Tuple3<Integer, Long, Double>>(
new int[]{1},
new TypeComparator[]{
new LongComparator(ascending)
},
new TypeSerializer[]{ IntSerializer.INSTANCE, LongSerializer.INSTANCE });
}
示例5: createComparator
import org.apache.flink.api.common.typeutils.base.LongComparator; //导入依赖的package包/类
@Override
protected TupleComparator<Tuple3<Integer, Long, Double>> createComparator(boolean ascending) {
return new TupleComparator<Tuple3<Integer, Long, Double>>(
new int[]{2, 1},
new TypeComparator[]{
new DoubleComparator(ascending),
new LongComparator(ascending)
},
new TypeSerializer[]{ IntSerializer.INSTANCE, DoubleSerializer.INSTANCE, LongSerializer.INSTANCE });
}
示例6: createComparator
import org.apache.flink.api.common.typeutils.base.LongComparator; //导入依赖的package包/类
@Override
protected TupleComparator<Tuple3<Integer, Long, Double>> createComparator(boolean ascending) {
return new TupleComparator<Tuple3<Integer, Long, Double>>(
new int[]{0, 1, 2},
new TypeComparator[]{
new IntComparator(ascending),
new LongComparator(ascending),
new DoubleComparator(ascending)
},
new TypeSerializer[]{ IntSerializer.INSTANCE, LongSerializer.INSTANCE, DoubleSerializer.INSTANCE });
}
示例7: HashTableTest
import org.apache.flink.api.common.typeutils.base.LongComparator; //导入依赖的package包/类
public HashTableTest() {
TypeSerializer<?>[] fieldSerializers = { LongSerializer.INSTANCE, BytePrimitiveArraySerializer.INSTANCE };
@SuppressWarnings("unchecked")
Class<Tuple2<Long, byte[]>> clazz = (Class<Tuple2<Long, byte[]>>) (Class<?>) Tuple2.class;
this.buildSerializer = new TupleSerializer<Tuple2<Long, byte[]>>(clazz, fieldSerializers);
this.probeSerializer = LongSerializer.INSTANCE;
TypeComparator<?>[] comparators = { new LongComparator(true) };
TypeSerializer<?>[] comparatorSerializers = { LongSerializer.INSTANCE };
this.buildComparator = new TupleComparator<Tuple2<Long, byte[]>>(new int[] {0}, comparators, comparatorSerializers);
this.probeComparator = new LongComparator(true);
this.pairComparator = new TypePairComparator<Long, Tuple2<Long, byte[]>>() {
private long ref;
@Override
public void setReference(Long reference) {
ref = reference;
}
@Override
public boolean equalToReference(Tuple2<Long, byte[]> candidate) {
//noinspection UnnecessaryUnboxing
return candidate.f0.longValue() == ref;
}
@Override
public int compareToReference(Tuple2<Long, byte[]> candidate) {
long x = ref;
long y = candidate.f0;
return (x < y) ? -1 : ((x == y) ? 0 : 1);
}
};
}
示例8: CompactingHashTableTest
import org.apache.flink.api.common.typeutils.base.LongComparator; //导入依赖的package包/类
public CompactingHashTableTest() {
this.probeComparator = new LongComparator(true);
this.pairComparator = new TypePairComparator<Long, Tuple2<Long, String>>() {
private long ref;
@Override
public void setReference(Long reference) {
ref = reference;
}
@Override
public boolean equalToReference(Tuple2<Long, String> candidate) {
//noinspection UnnecessaryUnboxing
return candidate.f0.longValue() == ref;
}
@Override
public int compareToReference(Tuple2<Long, String> candidate) {
long x = ref;
long y = candidate.f0;
return (x < y) ? -1 : ((x == y) ? 0 : 1);
}
};
}
示例9: InPlaceMutableHashTableTest
import org.apache.flink.api.common.typeutils.base.LongComparator; //导入依赖的package包/类
public InPlaceMutableHashTableTest() {
TypeSerializer<?>[] fieldSerializers = { LongSerializer.INSTANCE, StringSerializer.INSTANCE };
@SuppressWarnings("unchecked")
Class<Tuple2<Long, String>> clazz = (Class<Tuple2<Long, String>>) (Class<?>) Tuple2.class;
this.serializer = new TupleSerializer<Tuple2<Long, String>>(clazz, fieldSerializers);
TypeComparator<?>[] comparators = { new LongComparator(true) };
TypeSerializer<?>[] comparatorSerializers = { LongSerializer.INSTANCE };
this.comparator = new TupleComparator<Tuple2<Long, String>>(new int[] {0}, comparators, comparatorSerializers);
this.probeComparator = new LongComparator(true);
this.pairComparator = new TypePairComparator<Long, Tuple2<Long, String>>() {
private long ref;
@Override
public void setReference(Long reference) {
ref = reference;
}
@Override
public boolean equalToReference(Tuple2<Long, String> candidate) {
//noinspection UnnecessaryUnboxing
return candidate.f0.longValue() == ref;
}
@Override
public int compareToReference(Tuple2<Long, String> candidate) {
long x = ref;
long y = candidate.f0;
return (x < y) ? -1 : ((x == y) ? 0 : 1);
}
};
}
示例10: LongPrimitiveArrayComparator
import org.apache.flink.api.common.typeutils.base.LongComparator; //导入依赖的package包/类
public LongPrimitiveArrayComparator(boolean ascending) {
super(ascending, new LongComparator(ascending));
}
示例11: createComparator
import org.apache.flink.api.common.typeutils.base.LongComparator; //导入依赖的package包/类
@SuppressWarnings("unchecked")
@Override
protected TupleComparator<Tuple3<Tuple2<String, Double>, Tuple2<Long, Long>, Tuple2<Integer, Long>>> createComparator(
boolean ascending) {
return new TupleComparator<Tuple3<Tuple2<String, Double>, Tuple2<Long, Long>, Tuple2<Integer, Long>>>(
new int[] { 0, 1, 2 },
new TypeComparator[] {
new TupleComparator<Tuple2<String, Double>>(
new int[] { 0, 1 },
new TypeComparator[] {
new StringComparator(ascending),
new DoubleComparator(ascending) },
new TypeSerializer[] {
StringSerializer.INSTANCE,
DoubleSerializer.INSTANCE }),
new TupleComparator<Tuple2<Long, Long>>(
new int[] { 0, 1 },
new TypeComparator[] {
new LongComparator(ascending),
new LongComparator(ascending) },
new TypeSerializer[] {
LongSerializer.INSTANCE,
LongSerializer.INSTANCE }),
new TupleComparator<Tuple2<Integer, Long>>(
new int[] { 0, 1 },
new TypeComparator[] {
new IntComparator(ascending),
new LongComparator(ascending) },
new TypeSerializer[] {
IntSerializer.INSTANCE,
LongSerializer.INSTANCE }) },
new TypeSerializer[] {
new TupleSerializer<Tuple2<String, Double>>(
(Class<Tuple2<String, Double>>) (Class<?>) Tuple2.class,
new TypeSerializer[] {
StringSerializer.INSTANCE,
DoubleSerializer.INSTANCE }),
new TupleSerializer<Tuple2<Long, Long>>(
(Class<Tuple2<Long, Long>>) (Class<?>) Tuple2.class,
new TypeSerializer[] {
LongSerializer.INSTANCE,
LongSerializer.INSTANCE }),
new TupleSerializer<Tuple2<Integer, Long>>(
(Class<Tuple2<Integer, Long>>) (Class<?>) Tuple2.class,
new TypeSerializer[] {
IntSerializer.INSTANCE,
LongSerializer.INSTANCE }) });
}
示例12: createComparator
import org.apache.flink.api.common.typeutils.base.LongComparator; //导入依赖的package包/类
@Override
protected TypeComparator<Long> createComparator(boolean ascending) {
return new LongComparator(ascending);
}
示例13: createComparator
import org.apache.flink.api.common.typeutils.base.LongComparator; //导入依赖的package包/类
@SuppressWarnings("unchecked")
@Override
protected TupleComparator<Tuple3<Tuple2<String, Double>, Tuple2<Long, Long>, Tuple2<Integer, Long>>> createComparator(
boolean ascending) {
return new TupleComparator<Tuple3<Tuple2<String, Double>, Tuple2<Long, Long>, Tuple2<Integer, Long>>>(
new int[] { 0 },
new TypeComparator[] {
new TupleComparator<Tuple2<String, Double>>(
new int[] { 0, 1 },
new TypeComparator[] {
new StringComparator(ascending),
new DoubleComparator(ascending) },
new TypeSerializer[] {
StringSerializer.INSTANCE,
DoubleSerializer.INSTANCE }),
new TupleComparator<Tuple2<Long, Long>>(
new int[] { 0, 1 },
new TypeComparator[] {
new LongComparator(ascending),
new LongComparator(ascending) },
new TypeSerializer[] {
LongSerializer.INSTANCE,
LongSerializer.INSTANCE }),
new TupleComparator<Tuple2<Integer, Long>>(
new int[] { 0, 1 },
new TypeComparator[] {
new IntComparator(ascending),
new LongComparator(ascending) },
new TypeSerializer[] {
IntSerializer.INSTANCE,
LongSerializer.INSTANCE }) },
new TypeSerializer[] {
new TupleSerializer<Tuple2<String, Double>>(
(Class<Tuple2<String, Double>>) (Class<?>) Tuple2.class,
new TypeSerializer[] {
StringSerializer.INSTANCE,
DoubleSerializer.INSTANCE }),
new TupleSerializer<Tuple2<Long, Long>>(
(Class<Tuple2<Long, Long>>) (Class<?>) Tuple2.class,
new TypeSerializer[] {
LongSerializer.INSTANCE,
LongSerializer.INSTANCE }),
new TupleSerializer<Tuple2<Integer, Long>>(
(Class<Tuple2<Integer, Long>>) (Class<?>) Tuple2.class,
new TypeSerializer[] {
IntSerializer.INSTANCE,
LongSerializer.INSTANCE }) });
}
示例14: createComparator
import org.apache.flink.api.common.typeutils.base.LongComparator; //导入依赖的package包/类
@SuppressWarnings("unchecked")
@Override
protected TupleComparator<Tuple3<Tuple2<String, Double>, Tuple2<Long, Long>, Tuple2<Integer, Long>>> createComparator(
boolean ascending) {
return new TupleComparator<Tuple3<Tuple2<String, Double>, Tuple2<Long, Long>, Tuple2<Integer, Long>>>(
new int[] { 0, 2 },
new TypeComparator[] {
new TupleComparator<Tuple2<String, Double>>(
new int[] { 0, 1 },
new TypeComparator[] {
new StringComparator(ascending),
new DoubleComparator(ascending) },
new TypeSerializer[] {
StringSerializer.INSTANCE,
DoubleSerializer.INSTANCE }),
new TupleComparator<Tuple2<Long, Long>>(
new int[] { 0, 1 },
new TypeComparator[] {
new LongComparator(ascending),
new LongComparator(ascending) },
new TypeSerializer[] {
LongSerializer.INSTANCE,
LongSerializer.INSTANCE }),
new TupleComparator<Tuple2<Integer, Long>>(
new int[] { 0, 1 },
new TypeComparator[] {
new IntComparator(ascending),
new LongComparator(ascending) },
new TypeSerializer[] {
IntSerializer.INSTANCE,
LongSerializer.INSTANCE }) },
new TypeSerializer[] {
new TupleSerializer<Tuple2<String, Double>>(
(Class<Tuple2<String, Double>>) (Class<?>) Tuple2.class,
new TypeSerializer[] {
StringSerializer.INSTANCE,
DoubleSerializer.INSTANCE }),
new TupleSerializer<Tuple2<Long, Long>>(
(Class<Tuple2<Long, Long>>) (Class<?>) Tuple2.class,
new TypeSerializer[] {
LongSerializer.INSTANCE,
LongSerializer.INSTANCE }),
new TupleSerializer<Tuple2<Integer, Long>>(
(Class<Tuple2<Integer, Long>>) (Class<?>) Tuple2.class,
new TypeSerializer[] {
IntSerializer.INSTANCE,
LongSerializer.INSTANCE }) });
}