ctubbsii commented on code in PR #4116: URL: https://github.com/apache/accumulo/pull/4116#discussion_r1464080030
########## server/tserver/src/main/java/org/apache/accumulo/tserver/log/CreateEmptyWal.java: ########## @@ -0,0 +1,110 @@ +/* + * 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 + * + * https://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.accumulo.tserver.log; + +import static java.nio.charset.StandardCharsets.UTF_8; +import static java.nio.file.StandardOpenOption.CREATE_NEW; +import static org.apache.accumulo.tserver.log.DfsLogger.LOG_FILE_HEADER_V4; +import static org.apache.accumulo.tserver.logger.LogEvents.OPEN; + +import java.io.DataOutputStream; +import java.io.IOException; +import java.nio.file.Files; +import java.nio.file.Path; + +import org.apache.accumulo.core.cli.ConfigOpts; +import org.apache.accumulo.core.crypto.CryptoEnvironmentImpl; +import org.apache.accumulo.core.crypto.CryptoUtils; +import org.apache.accumulo.core.spi.crypto.CryptoEnvironment; +import org.apache.accumulo.core.spi.crypto.CryptoService; +import org.apache.accumulo.server.ServerContext; +import org.apache.accumulo.start.spi.KeywordExecutable; +import org.apache.accumulo.tserver.logger.LogFileKey; +import org.apache.accumulo.tserver.logger.LogFileValue; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import com.beust.jcommander.Parameter; +import com.google.auto.service.AutoService; +import com.google.common.annotations.VisibleForTesting; + +import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; + +@AutoService(KeywordExecutable.class) +public class CreateEmptyWal implements KeywordExecutable { + private static final Logger LOG = LoggerFactory.getLogger(CreateEmptyWal.class); + private static final LogFileValue EMPTY = new LogFileValue(); + + static class Opts extends ConfigOpts { + @Parameter( + description = " <path> the path / filename of the created empty wal file. The file cannot exist", + required = true) + String walFilename; Review Comment: If this is to work like CreateEmpty for wal files, this needs to be: ```suggestion List<String> files = new ArrayList<>(); ``` And then the execute method needs to loop over each file name to create a WAL for each one. Also, like CreateEmpty, each path should be a URL and be written to a Path in HDFS (`org.apache.hadoop.fs.Path`), not a `java.nio.file.Path`. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: notifications-unsubscr...@accumulo.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org