You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@accumulo.apache.org by GitBox <gi...@apache.org> on 2020/02/26 22:17:37 UTC

[GitHub] [accumulo] ctubbsii commented on a change in pull request #1527: Added detailed trace logging for FATE #1316

ctubbsii commented on a change in pull request #1527: Added detailed trace logging for FATE #1316
URL: https://github.com/apache/accumulo/pull/1527#discussion_r384801460
 
 

 ##########
 File path: core/src/main/java/org/apache/accumulo/core/logging/FateLogger.java
 ##########
 @@ -0,0 +1,136 @@
+/*
+ * 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.accumulo.core.logging;
+
+import static org.apache.accumulo.fate.FateTxId.formatTid;
+
+import java.io.Serializable;
+import java.util.EnumSet;
+import java.util.List;
+import java.util.function.Function;
+
+import org.apache.accumulo.fate.ReadOnlyRepo;
+import org.apache.accumulo.fate.Repo;
+import org.apache.accumulo.fate.StackOverflowException;
+import org.apache.accumulo.fate.TStore;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+public class FateLogger {
+  private static final String PREFIX = Logging.PREFIX + "fate.";
+
+  // Logs all mutations to FATEs persistent storage. Enabling this logger could help debug
+  // reproducible problems with FATE transactions.
+  private static final Logger storeLog = LoggerFactory.getLogger(PREFIX + "store");
+
+  public static <T> TStore<T> wrap(TStore<T> store, Function<Repo<T>,String> toLogString) {
 
 Review comment:
   One possible solution is to create a simple pojo to be serialized... and put in it whatever you need from the Repo, and serialize the pojo with Gson rather than serialize the Repo. That's what I did for AccumuloMonitorAppender in #1528 rather than try to serialize Log4j's LogEvent type.

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services