use of org.apache.ignite.internal.processors.igfs.IgfsServer in project ignite by apache.
the class IgniteHadoopFileSystemClientSelfTest method switchHandlerErrorFlag.
/**
* Set IGFS REST handler error flag to the given state.
*
* @param flag Flag state.
* @throws Exception If failed.
*/
@SuppressWarnings("ConstantConditions")
private void switchHandlerErrorFlag(boolean flag) throws Exception {
IgfsProcessorAdapter igfsProc = ((IgniteKernal) grid(0)).context().igfs();
Map<String, IgfsContext> igfsMap = getField(igfsProc, "igfsCache");
IgfsServerManager srvMgr = F.first(igfsMap.values()).server();
Collection<IgfsServer> srvrs = getField(srvMgr, "srvrs");
IgfsServerHandler igfsHnd = getField(F.first(srvrs), "hnd");
Field field = igfsHnd.getClass().getDeclaredField("errWrite");
field.setAccessible(true);
field.set(null, flag);
}
Aggregations