/** * @throws Exception If failed. */ @Test public void testSerialization() throws Exception { Map<String, IgfsMode> pathModes = new HashMap<>(); pathModes.put("path1", PRIMARY); pathModes.put("path2", PROXY); IgfsAttributes attrs = new IgfsAttributes("testIgfsName", 513000, 888, "meta", "data", DUAL_SYNC, pathModes, true); ByteArrayOutputStream bos = new ByteArrayOutputStream(); ObjectOutput os = new ObjectOutputStream(bos); os.writeObject(attrs); os.close(); IgfsAttributes deserializedAttrs = (IgfsAttributes)new ObjectInputStream( new ByteArrayInputStream(bos.toByteArray())).readObject(); assertTrue(eq(attrs, deserializedAttrs)); }
if (!F.eq(rmtAttr.igfsName(), locAttr.igfsName())) { if (F.eq(rmtAttr.metaCacheName(), locAttr.metaCacheName())) throw new IgniteCheckedException("Meta cache names should be different for different IGFS instances " + "configuration (fix configuration or set " + "-D" + IGNITE_SKIP_CONFIGURATION_CONSISTENCY_CHECK + "=true system " + "property) [metaCacheName=" + rmtAttr.metaCacheName() + ", locNodeId=" + ctx.localNodeId() + ", rmtNodeId=" + rmtNode.id() + ", locIgfsName=" + locAttr.igfsName() + ", rmtIgfsName=" + rmtAttr.igfsName() + ']'); if (F.eq(rmtAttr.dataCacheName(), locAttr.dataCacheName())) throw new IgniteCheckedException("Data cache names should be different for different IGFS instances " + "configuration (fix configuration or set " + "-D" + IGNITE_SKIP_CONFIGURATION_CONSISTENCY_CHECK + "=true system " + "property)[dataCacheName=" + rmtAttr.dataCacheName() + ", locNodeId=" + ctx.localNodeId() + ", rmtNodeId=" + rmtNode.id() + ", locIgfsName=" + locAttr.igfsName() + ", rmtIgfsName=" + rmtAttr.igfsName() + ']'); checkSame("Data block size", "BlockSize", rmtNode.id(), rmtAttr.blockSize(), locAttr.blockSize(), rmtAttr.igfsName()); checkSame("Affinity mapper group size", "GrpSize", rmtNode.id(), rmtAttr.groupSize(), locAttr.groupSize(), rmtAttr.igfsName()); checkSame("Meta cache name", "MetaCacheName", rmtNode.id(), rmtAttr.metaCacheName(), locAttr.metaCacheName(), rmtAttr.igfsName());
/** * Check whether provided node contains IGFS with the given name. * * @param node Node. * @param igfsName IGFS name. * @return {@code True} if it contains IGFS. */ public static boolean isIgfsNode(ClusterNode node, String igfsName) { assert node != null; IgfsAttributes[] igfs = node.attribute(ATTR_IGFS); if (igfs != null) for (IgfsAttributes attrs : igfs) if (F.eq(igfsName, attrs.igfsName())) return true; return false; }
/** * Check whether provided node contains IGFS with the given name. * * @param node Node. * @param igfsName IGFS name. * @return {@code True} if it contains IGFS. */ public static boolean isIgfsNode(ClusterNode node, String igfsName) { assert node != null; IgfsAttributes[] igfs = node.attribute(ATTR_IGFS); if (igfs != null) for (IgfsAttributes attrs : igfs) if (F.eq(igfsName, attrs.igfsName())) return true; return false; }
if (!F.eq(rmtAttr.igfsName(), locAttr.igfsName())) { if (F.eq(rmtAttr.metaCacheName(), locAttr.metaCacheName())) throw new IgniteCheckedException("Meta cache names should be different for different IGFS instances " + "configuration (fix configuration or set " + "-D" + IGNITE_SKIP_CONFIGURATION_CONSISTENCY_CHECK + "=true system " + "property) [metaCacheName=" + rmtAttr.metaCacheName() + ", locNodeId=" + ctx.localNodeId() + ", rmtNodeId=" + rmtNode.id() + ", locIgfsName=" + locAttr.igfsName() + ", rmtIgfsName=" + rmtAttr.igfsName() + ']'); if (F.eq(rmtAttr.dataCacheName(), locAttr.dataCacheName())) throw new IgniteCheckedException("Data cache names should be different for different IGFS instances " + "configuration (fix configuration or set " + "-D" + IGNITE_SKIP_CONFIGURATION_CONSISTENCY_CHECK + "=true system " + "property)[dataCacheName=" + rmtAttr.dataCacheName() + ", locNodeId=" + ctx.localNodeId() + ", rmtNodeId=" + rmtNode.id() + ", locIgfsName=" + locAttr.igfsName() + ", rmtIgfsName=" + rmtAttr.igfsName() + ']'); checkSame("Data block size", "BlockSize", rmtNode.id(), rmtAttr.blockSize(), locAttr.blockSize(), rmtAttr.igfsName()); checkSame("Affinity mapper group size", "GrpSize", rmtNode.id(), rmtAttr.groupSize(), locAttr.groupSize(), rmtAttr.igfsName()); checkSame("Meta cache name", "MetaCacheName", rmtNode.id(), rmtAttr.metaCacheName(), locAttr.metaCacheName(), rmtAttr.igfsName());
attrVals.add(new IgfsAttributes( igfsCfg.getName(), igfsCfg.getBlockSize(),
attrVals.add(new IgfsAttributes( igfsCfg.getName(), igfsCfg.getBlockSize(),