<commit_before>/*
 * Licensed to the Apache Software Foundation (ASF) under one or more
 * contributor license agreements.  See the NOTICE file distributed with
 * this work for additional information regarding copyright ownership.
 * The ASF licenses this file to You 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 org.apache.ignite.internal.pagemem.snapshot;

import java.io.File;
import java.io.Serializable;
import java.util.Collection;
import java.util.Set;

/**
 * Description and parameters of snapshot operation
 */
public class SnapshotOperation implements Serializable {
    /** */
    private static final long serialVersionUID = 0L;

    /** */
    private final SnapshotOperationType type;

    /**
     * Snapshot ID (the timestamp of snapshot creation).
     */
    private final long snapshotId;

    /** */
    private final Set<String> cacheNames;

    /** Message. */
    private final String msg;

    /** Additional parameter. */
    private final Object extraParam;

    /**
     * @param type Type.
     * @param snapshotId Snapshot id.
     * @param cacheNames Cache names.
     * @param msg
     * @param extraParam Additional parameter.
     */
    public SnapshotOperation(
        SnapshotOperationType type,
        long snapshotId,
        Set<String> cacheNames,
        String msg,
        Object extraParam
    ) {
        this.type = type;
        this.snapshotId = snapshotId;
        this.cacheNames = cacheNames;
        this.msg = msg;
        this.extraParam = extraParam;
    }

    /**
     *
     */
    public SnapshotOperationType type() {
        return type;
    }

    /**
     * Snapshot ID (the timestamp of snapshot creation).
     *
     * @return Snapshot ID.
     */
    public long id() {
        return snapshotId;
    }

    /**
     * Cache names included to this snapshot.
     *
     * @return Cache names.
     */
    public Set<String> cacheNames() {
        return cacheNames;
    }

    /**
     * Additional info which was provided by client
     */
    public String message() {
        return msg;
    }

    /**
     *
     */
    public Object extraParameter() {
        return extraParam;
    }


    /**
     * @param op Op.
     */
    public static Collection<File> getOptionalPathsParameter(SnapshotOperation op) {
        assert (op.type() == SnapshotOperationType.CHECK || op.type() == SnapshotOperationType.RESTORE)
            && (op.extraParameter() == null || op.extraParameter() instanceof Collection);

        return (Collection<File>)op.extraParameter();
    }

    /**
     * @param op Op.
     */
    public static Boolean getFullSnapshotParameter(SnapshotOperation op) {
        assert op.type() == SnapshotOperationType.CREATE && op.extraParameter() instanceof Boolean;

        return (Boolean)op.extraParameter();
    }

    /**
     * @param op Op.
     */
    public static File getMovingPathParameter(SnapshotOperation op) {
        assert op.type() == SnapshotOperationType.MOVE && op.extraParameter() instanceof File;

        return (File)op.extraParameter();
    }

    @Override public boolean equals(Object o) {
        if (this == o)
            return true;
        if (o == null || getClass() != o.getClass())
            return false;

        SnapshotOperation operation = (SnapshotOperation)o;

        if (snapshotId != operation.snapshotId)
            return false;
        if (type != operation.type)
            return false;
        if (msg != null ? !msg.equals(operation.msg) : operation.msg != null)
            return false;
        return extraParam != null ? extraParam.equals(operation.extraParam) : operation.extraParam == null;

    }

    @Override public int hashCode() {
        int result = type.hashCode();
        result = 31 * result + (int)(snapshotId ^ (snapshotId >>> 32));
        result = 31 * result + (msg != null ? msg.hashCode() : 0);
        result = 31 * result + (extraParam != null ? extraParam.hashCode() : 0);
        return result;
    }

    @Override public String toString() {
        return "SnapshotOperation{" +
            "type=" + type +
            ", snapshotId=" + snapshotId +
            ", cacheNames=" + cacheNames +
            ", msg='" + msg + '\'' +
            ", extraParam=" + extraParam +
            '}';
    }
}<commit_msg>ignite-gg-12163  refactoring updates, move copy page to snapshot manager<commit_after>/*
 * Licensed to the Apache Software Foundation (ASF) under one or more
 * contributor license agreements.  See the NOTICE file distributed with
 * this work for additional information regarding copyright ownership.
 * The ASF licenses this file to You 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 org.apache.ignite.internal.pagemem.snapshot;

import java.io.File;
import java.io.Serializable;
import java.util.Collection;
import java.util.Set;

/**
 * Description and parameters of snapshot operation
 */
public class SnapshotOperation implements Serializable {
    /** */
    private static final long serialVersionUID = 0L;

    /** */
    private final SnapshotOperationType type;

    /**
     * Snapshot ID (the timestamp of snapshot creation).
     */
    private final long snapshotId;

    /** */
    private final Set<String> cacheNames;

    /** Message. */
    private final String msg;

    /** Additional parameter. */
    private final Object extraParam;

    /**
     * @param type Type.
     * @param snapshotId Snapshot id.
     * @param cacheNames Cache names.
     * @param msg
     * @param extraParam Additional parameter.
     */
    public SnapshotOperation(
        SnapshotOperationType type,
        long snapshotId,
        Set<String> cacheNames,
        String msg,
        Object extraParam
    ) {
        this.type = type;
        this.snapshotId = snapshotId;
        this.cacheNames = cacheNames;
        this.msg = msg;
        this.extraParam = extraParam;
    }

    /**
     *
     */
    public SnapshotOperationType type() {
        return type;
    }

    /**
     * Snapshot ID (the timestamp of snapshot creation).
     *
     * @return Snapshot ID.
     */
    public long id() {
        return snapshotId;
    }

    /**
     * Cache names included to this snapshot.
     *
     * @return Cache names.
     */
    public Set<String> cacheNames() {
        return cacheNames;
    }

    /**
     * Additional info which was provided by client
     */
    public String message() {
        return msg;
    }

    /**
     *
     */
    public Object extraParameter() {
        return extraParam;
    }


    /**
     * @param op Op.
     */
    public static Collection<File> getOptionalPathsParameter(SnapshotOperation op) {
        assert (op.type() == SnapshotOperationType.CHECK || op.type() == SnapshotOperationType.RESTORE)
            && (op.extraParameter() == null || op.extraParameter() instanceof Collection);

        return (Collection<File>)op.extraParameter();
    }

    /**
     * @param op Op.
     */
    public static Boolean getFullSnapshotParameter(SnapshotOperation op) {
        assert op.type() == SnapshotOperationType.CREATE && op.extraParameter() instanceof Boolean;

        return (Boolean)op.extraParameter();
    }

    /**
     * @param op Op.
     */
    public static File getMovingPathParameter(SnapshotOperation op) {
        assert op.type() == SnapshotOperationType.MOVE && op.extraParameter() instanceof File;

        return (File)op.extraParameter();
    }

    /** {@inheritDoc} */
    @Override public boolean equals(Object o) {
        if (this == o)
            return true;
        if (o == null || getClass() != o.getClass())
            return false;

        SnapshotOperation operation = (SnapshotOperation)o;

        if (snapshotId != operation.snapshotId)
            return false;
        if (type != operation.type)
            return false;
        if (msg != null ? !msg.equals(operation.msg) : operation.msg != null)
            return false;

        return extraParam != null ? extraParam.equals(operation.extraParam) : operation.extraParam == null;

    }

    /** {@inheritDoc} */
    @Override public int hashCode() {
        int res = type.hashCode();
        res = 31 * res + (int)(snapshotId ^ (snapshotId >>> 32));
        res = 31 * res + (msg != null ? msg.hashCode() : 0);
        res = 31 * res + (extraParam != null ? extraParam.hashCode() : 0);
        return res;
    }

    /** {@inheritDoc} */
    @Override public String toString() {
        return "SnapshotOperation{" +
            "type=" + type +
            ", snapshotId=" + snapshotId +
            ", cacheNames=" + cacheNames +
            ", msg='" + msg + '\'' +
            ", extraParam=" + extraParam +
            '}';
    }
}
{'fraction_non_alphanumeric': 0.10834447988476181, 'fraction_numerical': 0.0036011935384298796, 'mean_word_length': 2.2837837837837838, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 19, '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': '3528313', 'n_tokens_mistral': 2591, 'n_tokens_neox': 2523, 'n_words': 813}