Skip to content
Permalink
Browse files
Add ability for jvm-dtest to grep instance logs
Patch by David Capwell; reviewed by Alex Petrov, Yifan Cai for CASSANDRA-16120
  • Loading branch information
David Capwell authored and dcapwell committed Sep 18, 2020
1 parent 15d9595 commit 672af9b56f1729c6511a2279923eb435df4b7b9b
Showing 6 changed files with 740 additions and 1 deletion.
@@ -70,7 +70,7 @@
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.mockito</groupId>
<groupId>org.mockito</groupId>
<artifactId>mockito-core</artifactId>
<version>3.5.10</version>
<scope>test</scope>
@@ -90,4 +90,23 @@ default int nodetool(String... commandAndArgs)

void forceCompact(String keyspace, String table);

List<Throwable> getUncaughtExceptions();

default boolean getLogsEnabled()
{
try
{
logs();
return true;
}
catch (UnsupportedOperationException e)
{
return false;
}
}

default LogAction logs()
{
throw new UnsupportedOperationException();
}
}
@@ -0,0 +1,37 @@
/*
* 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.cassandra.distributed.api;

import java.util.Iterator;

public interface LineIterator extends Iterator<String>, AutoCloseable
{
/**
* @return current position of the iterator
* @see LogAction#grep(long, String)
* @see LogAction#watchFor(long, String)
*/
long mark();

@Override
default void close()
{

}
}

0 comments on commit 672af9b

Please sign in to comment.