Package org.apache.helix.controller.serializer

Examples of org.apache.helix.controller.serializer.StringSerializer


   * @param context instantiated context
   */
  public ControllerContextHolder(ControllerContext context) {
    super(context.getId().toString());
    _context = context;
    StringSerializer serializer = instantiateSerializerFromContext(_context);
    if (_context != null && serializer != null) {
      _record.setSimpleField(Fields.SERIALIZER_CLASS.toString(), _context.getSerializerClass()
          .getName());
      _record.setSimpleField(Fields.CONTEXT_CLASS.toString(), _context.getClass().getName());
      _record.setSimpleField(Fields.CONTEXT.toString(), serializer.serialize(_context));
    }
  }
View Full Code Here


   * Instantiate from a record
   * @param record populated ZNRecord
   */
  public ControllerContextHolder(ZNRecord record) {
    super(record);
    StringSerializer serializer =
        instantiateSerializerFromName(_record.getSimpleField(Fields.SERIALIZER_CLASS.toString()));
    _context =
        loadContext(serializer, _record.getSimpleField(Fields.CONTEXT_CLASS.toString()),
            _record.getSimpleField(Fields.CONTEXT.toString()));
  }
View Full Code Here

TOP

Related Classes of org.apache.helix.controller.serializer.StringSerializer

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.