zookeeper-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hanm <...@git.apache.org>
Subject [GitHub] zookeeper pull request #615: ZOOKEEPER-3137: add a utility to truncate logs ...
Date Wed, 05 Sep 2018 03:59:16 GMT
Github user hanm commented on a diff in the pull request:

    https://github.com/apache/zookeeper/pull/615#discussion_r215129999
  
    --- Diff: src/java/main/org/apache/zookeeper/server/util/LogChopper.java ---
    @@ -0,0 +1,152 @@
    +/**
    + * 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.zookeeper.server.util;
    +
    +import org.apache.jute.BinaryInputArchive;
    +import org.apache.jute.BinaryOutputArchive;
    +import org.apache.jute.Record;
    +import org.apache.zookeeper.server.persistence.FileHeader;
    +import org.apache.zookeeper.server.persistence.FileTxnLog;
    +import org.apache.zookeeper.txn.TxnHeader;
    +
    +import java.io.BufferedInputStream;
    +import java.io.BufferedOutputStream;
    +import java.io.EOFException;
    +import java.io.FileInputStream;
    +import java.io.FileOutputStream;
    +import java.io.IOException;
    +import java.io.InputStream;
    +import java.io.OutputStream;
    +import java.util.zip.Adler32;
    +import java.util.zip.Checksum;
    +
    +/**
    + * this class will chop the log at the specified zxid
    + */
    +public class LogChopper {
    --- End diff --
    
    This is public, so it needs to be annotated with interface annotation.
    See https://github.com/apache/zookeeper/commit/0cb4011dac7ec28637426cafd98b4f8f299ef61d#diff-40373c146f7f620581c943009c8b796f


---

Mime
View raw message