本文整理汇总了Java中org.apache.ignite.internal.util.typedef.internal.U.newInstance方法的典型用法代码示例。如果您正苦于以下问题:Java U.newInstance方法的具体用法?Java U.newInstance怎么用?Java U.newInstance使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.ignite.internal.util.typedef.internal.U
的用法示例。
在下文中一共展示了U.newInstance方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: readFileBlock
import org.apache.ignite.internal.util.typedef.internal.U; //导入方法依赖的package包/类
/**
* @param clsName Input split class name.
* @param in Input stream.
* @param hosts Optional hosts.
* @return File block or {@code null} if it is not a {@link FileSplit} instance.
* @throws IgniteCheckedException If failed.
*/
@Nullable public static HadoopFileBlock readFileBlock(String clsName, FSDataInputStream in,
@Nullable String[] hosts) throws IgniteCheckedException {
if (!FileSplit.class.getName().equals(clsName))
return null;
FileSplit split = U.newInstance(FileSplit.class);
try {
split.readFields(in);
}
catch (IOException e) {
throw new IgniteCheckedException(e);
}
if (hosts == null)
hosts = EMPTY_HOSTS;
return new HadoopFileBlock(hosts, split.getPath().toUri(), split.getStart(), split.getLength());
}
示例2: read
import org.apache.ignite.internal.util.typedef.internal.U; //导入方法依赖的package包/类
/** {@inheritDoc} */
@Override public Object read(DataInput in, @Nullable Object obj) throws IgniteCheckedException {
Writable w = obj == null ? U.newInstance(cls) : cls.cast(obj);
try {
w.readFields(in);
}
catch (IOException e) {
throw new IgniteCheckedException(e);
}
return w;
}
示例3: GridQueryProcessor
import org.apache.ignite.internal.util.typedef.internal.U; //导入方法依赖的package包/类
/**
* @param ctx Kernal context.
*/
public GridQueryProcessor(GridKernalContext ctx) throws IgniteCheckedException {
super(ctx);
if (idxCls != null) {
idx = U.newInstance(idxCls);
idxCls = null;
}
else
idx = INDEXING.inClassPath() ? U.<GridQueryIndexing>newInstance(INDEXING.className()) : null;
valCtx = new CacheQueryObjectValueContext(ctx);
ioLsnr = new GridMessageListener() {
@Override public void onMessage(UUID nodeId, Object msg, byte plc) {
if (msg instanceof SchemaOperationStatusMessage) {
SchemaOperationStatusMessage msg0 = (SchemaOperationStatusMessage)msg;
msg0.senderNodeId(nodeId);
processStatusMessage(msg0);
}
else
U.warn(log, "Unsupported IO message: " + msg);
}
};
}