Search in sources :

Example 1 with IgfsServerManager

use of org.apache.ignite.internal.processors.igfs.IgfsServerManager 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);
}
Also used : Field(java.lang.reflect.Field) IgfsProcessorAdapter(org.apache.ignite.internal.processors.igfs.IgfsProcessorAdapter) IgfsServerManager(org.apache.ignite.internal.processors.igfs.IgfsServerManager) IgfsServerHandler(org.apache.ignite.internal.processors.igfs.IgfsServerHandler) IgfsContext(org.apache.ignite.internal.processors.igfs.IgfsContext) IgfsServer(org.apache.ignite.internal.processors.igfs.IgfsServer)

Aggregations

Field (java.lang.reflect.Field)1 IgfsContext (org.apache.ignite.internal.processors.igfs.IgfsContext)1 IgfsProcessorAdapter (org.apache.ignite.internal.processors.igfs.IgfsProcessorAdapter)1 IgfsServer (org.apache.ignite.internal.processors.igfs.IgfsServer)1 IgfsServerHandler (org.apache.ignite.internal.processors.igfs.IgfsServerHandler)1 IgfsServerManager (org.apache.ignite.internal.processors.igfs.IgfsServerManager)1