本文整理汇总了Java中org.apache.calcite.util.Util.throwIfUnchecked方法的典型用法代码示例。如果您正苦于以下问题:Java Util.throwIfUnchecked方法的具体用法?Java Util.throwIfUnchecked怎么用?Java Util.throwIfUnchecked使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.calcite.util.Util
的用法示例。
在下文中一共展示了Util.throwIfUnchecked方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: invoke
import org.apache.calcite.util.Util; //导入方法依赖的package包/类
public Object invoke(Object proxy, Method method, Object[] args)
throws Throwable {
for (Metadata metadata : metadataList) {
try {
final Object o = method.invoke(metadata, args);
if (o != null) {
return o;
}
} catch (InvocationTargetException e) {
if (e.getCause() instanceof CyclicMetadataException) {
continue;
}
Util.throwIfUnchecked(e.getCause());
throw new RuntimeException(e.getCause());
}
}
return null;
}
示例2: close
import org.apache.calcite.util.Util; //导入方法依赖的package包/类
public void close() {
final Throwable e = throwableHolder.get();
if (e != null) {
throwableHolder.set(null);
Util.throwIfUnchecked(e);
throw new RuntimeException(e);
}
}
示例3: cardinality
import org.apache.calcite.util.Util; //导入方法依赖的package包/类
public double cardinality(List<Lattice.Column> columns) {
final List<Double> counts = new ArrayList<>();
for (Lattice.Column column : columns) {
try {
counts.add(cache.get(column));
} catch (UncheckedExecutionException | ExecutionException e) {
Util.throwIfUnchecked(e.getCause());
throw new RuntimeException(e.getCause());
}
}
return (int) Lattice.getRowCount(lattice.getFactRowCount(), counts);
}
示例4: query
import org.apache.calcite.util.Util; //导入方法依赖的package包/类
public <M extends Metadata> M query(RelNode rel, RelMetadataQuery mq,
Class<M> metadataClazz) {
try {
//noinspection unchecked
final Pair<Class<RelNode>, Class<Metadata>> key =
(Pair) Pair.of(rel.getClass(), metadataClazz);
final Metadata apply = cache.get(key).bind(rel, mq);
return metadataClazz.cast(apply);
} catch (UncheckedExecutionException | ExecutionException e) {
Util.throwIfUnchecked(e.getCause());
throw new RuntimeException(e.getCause());
}
}
示例5: create
import org.apache.calcite.util.Util; //导入方法依赖的package包/类
synchronized <M extends Metadata, H extends MetadataHandler<M>> H create(
MetadataDef<M> def) {
try {
final Key key = new Key((MetadataDef) def, provider,
ImmutableList.copyOf(ALL_RELS));
//noinspection unchecked
return (H) HANDLERS.get(key);
} catch (UncheckedExecutionException | ExecutionException e) {
Util.throwIfUnchecked(e.getCause());
throw new RuntimeException(e.getCause());
}
}
示例6: set
import org.apache.calcite.util.Util; //导入方法依赖的package包/类
public void set(String name, String value) {
final Method method = setterMethods.get(name);
try {
method.invoke(o, value);
} catch (IllegalAccessException | InvocationTargetException e) {
Util.throwIfUnchecked(e.getCause());
throw new RuntimeException(e.getCause());
}
}
示例7: get
import org.apache.calcite.util.Util; //导入方法依赖的package包/类
public Object get(String name) {
final Method method = getterMethods.get(name);
try {
return method.invoke(o);
} catch (IllegalAccessException | InvocationTargetException e) {
Util.throwIfUnchecked(e.getCause());
throw new RuntimeException(e.getCause());
}
}