private void restoreLogicalAndSelector(final LocalPhysicalGraph lpg, final SnapShotDescripter snapShot,
                                           final SnapShotFileManager fileManager) throws RestoreException {

        Iterator<LocalVertex> iter = lpg.iteratorOfVertex();
        while (iter.hasNext()) {
            final LocalVertex localVertex = iter.next();

            if (localVertex instanceof LocalPhysicalVertex) {
                final LocalPhysicalVertex lpv = (LocalPhysicalVertex) localVertex;
                final Vertex v = lpv.getVertex();

                if (v instanceof LogicalVertex) {
                    ModuleBase instance;
                    if (ReflectionUtil.isImplemented(v.getModuleClass(), SnapShottable.class)) {
                        // The vertex must be serialized.
                        try {
                            instance = instanceManager.restore(lpv, fileManager.getVertexFile(snapShot, lpv));
                        } catch (ClassNotFoundException | IOException e) {
                            throw new RestoreException(e);
                        }
                    } else {
                        instance = instanceManager.createNewInstance(v);
                    }

                    final LogicalVertex logicalVertex = (LogicalVertex) v;
                    LocalThread localThread = resourceManager.assignCPUResource(job, logicalVertex.getCpuUsage(),
                                                                                busyLoopMode);
                    lpv.setLocalThread(localThread);
                    lpv.setInstance(instance);
                }
            } else if (localVertex instanceof LocalSelectorVertex) {
                final LocalSelectorVertex lsv = (LocalSelectorVertex) localVertex;
                final LocalThread localThread = resourceManager.assignCPUResource(job, 1, busyLoopMode);
                lsv.setBindAddress(signature.getAddress());
                lsv.setLocalThread(localThread);
            }
        }
    }