<commit_before>/*
 * Copyright 2015 the original author or authors.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package net.kuujo.copycat.raft.log.entry;

import net.kuujo.copycat.cluster.MemberInfo;
import net.kuujo.copycat.io.serializer.SerializeWith;
import net.kuujo.copycat.io.util.ReferenceManager;

/**
 * Register client entry.
 *
 * @author <a href="http://github.com/kuujo"><NAME></a>
 */
@SerializeWith(id=1006)
public class RegisterEntry extends TimestampedEntry<RegisterEntry> {
  private MemberInfo member;

  public RegisterEntry() {
  }

  public RegisterEntry(ReferenceManager<Entry<?>> referenceManager) {
    super(referenceManager);
  }

  /**
   * Returns the member info.
   *
   * @return The member info.
   */
  public MemberInfo getMember() {
    return member;
  }

  /**
   * Sets the member info.
   *
   * @param info The member info.
   * @return The register entry.
   */
  public RegisterEntry setMember(MemberInfo info) {
    this.member = info;
    return this;
  }

  @Override
  public String toString() {
    return String.format("%s[index=%d, member=%s, timestamp=%d]", getClass().getSimpleName(), getIndex(), member, getTimestamp());
  }

}
<commit_msg>Handle serialization of member info in register entries.<commit_after>/*
 * Copyright 2015 the original author or authors.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package net.kuujo.copycat.raft.log.entry;

import net.kuujo.copycat.cluster.MemberInfo;
import net.kuujo.copycat.io.Buffer;
import net.kuujo.copycat.io.serializer.SerializeWith;
import net.kuujo.copycat.io.serializer.Serializer;
import net.kuujo.copycat.io.util.ReferenceManager;

/**
 * Register client entry.
 *
 * @author <a href="http://github.com/kuujo"><NAME></a>
 */
@SerializeWith(id=1006)
public class RegisterEntry extends TimestampedEntry<RegisterEntry> {
  private MemberInfo member;

  public RegisterEntry() {
  }

  public RegisterEntry(ReferenceManager<Entry<?>> referenceManager) {
    super(referenceManager);
  }

  /**
   * Returns the member info.
   *
   * @return The member info.
   */
  public MemberInfo getMember() {
    return member;
  }

  /**
   * Sets the member info.
   *
   * @param member The member info.
   * @return The register entry.
   */
  public RegisterEntry setMember(MemberInfo member) {
    this.member = member;
    return this;
  }

  @Override
  public void writeObject(Buffer buffer, Serializer serializer) {
    super.writeObject(buffer, serializer);
    serializer.writeObject(member, buffer);
  }

  @Override
  public void readObject(Buffer buffer, Serializer serializer) {
    super.readObject(buffer, serializer);
    member = serializer.readObject(buffer);
  }

  @Override
  public String toString() {
    return String.format("%s[index=%d, member=%s, timestamp=%d]", getClass().getSimpleName(), getIndex(), member, getTimestamp());
  }

}

{'fraction_non_alphanumeric': 0.1095679012345679, 'fraction_numerical': 0.006172839506172839, 'mean_word_length': 3.8551810237203497, 'pattern_counts': {'":': 0, '<': 15, '<?xml version=': 0, '>': 15, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7251000', 'n_tokens_mistral': 1136, 'n_tokens_neox': 1113, 'n_words': 355}