/**
   * @return Expected hash code.
   * @param fullName Full name of type.
   */
  private int expectedHashCode(String fullName) {
    BinaryIdMapper idMapper = cfg.getBinaryConfiguration().getIdMapper();
    BinaryNameMapper nameMapper = cfg.getBinaryConfiguration().getNameMapper();

    if (idMapper == null) idMapper = BinaryContext.defaultIdMapper();

    if (nameMapper == null) nameMapper = BinaryContext.defaultNameMapper();

    return idMapper.typeId(nameMapper.typeName(fullName));
  }
  /**
   * @param fullClsName Class name.
   * @return Expected type name according to configuration.
   */
  private String expectedTypeName(String fullClsName) {
    BinaryNameMapper mapper = cfg.getBinaryConfiguration().getNameMapper();

    if (mapper == null) mapper = BinaryContext.defaultNameMapper();

    return mapper.typeName(fullClsName);
  }
示例#3
0
  /**
   * @param marsh Binary marshaller.
   * @param cfg Configuration.
   * @throws BinaryObjectException In case of error.
   */
  public void configure(BinaryMarshaller marsh, IgniteConfiguration cfg)
      throws BinaryObjectException {
    if (marsh == null) return;

    this.marsh = marsh;

    marshCtx = marsh.getContext();

    BinaryConfiguration binaryCfg = cfg.getBinaryConfiguration();

    if (binaryCfg == null) binaryCfg = new BinaryConfiguration();

    assert marshCtx != null;

    optmMarsh.setContext(marshCtx);

    configure(
        binaryCfg.getIdMapper(), binaryCfg.getSerializer(), binaryCfg.getTypeConfigurations());

    compactFooter = binaryCfg.isCompactFooter();
  }
示例#4
0
  /** @return Default serializer. */
  private BinarySerializer defaultSerializer() {
    BinaryConfiguration binCfg = igniteCfg.getBinaryConfiguration();

    return binCfg != null ? binCfg.getSerializer() : null;
  }