-
Notifications
You must be signed in to change notification settings - Fork 217
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Allow for automatically blacklisting any TWCS or DTCS tables within a…
- Loading branch information
1 parent
4124b79
commit dfa792f
Showing
31 changed files
with
765 additions
and
205 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
77 changes: 77 additions & 0 deletions
77
src/server/src/main/java/io/cassandrareaper/core/Table.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
/* | ||
* Copyright 2018-2019 The Last Pickle Ltd | ||
* | ||
* | ||
* Licensed 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 io.cassandrareaper.core; | ||
|
||
import com.google.common.base.Preconditions; | ||
|
||
public final class Table { | ||
|
||
private final String name; | ||
private final String compactionStrategy; | ||
|
||
private Table(Builder builder) { | ||
this.name = builder.name; | ||
this.compactionStrategy = builder.compactionStrategy; | ||
} | ||
|
||
public String getName() { | ||
return name; | ||
} | ||
|
||
public String getCompactionStrategy() { | ||
return compactionStrategy; | ||
} | ||
|
||
public static Builder builder() { | ||
return new Builder(); | ||
} | ||
|
||
public String toString() { | ||
return String.format("{name=%s, compactionStrategy=%s}", name, compactionStrategy); | ||
} | ||
|
||
public static final class Builder { | ||
|
||
private String name; | ||
private String compactionStrategy; | ||
|
||
private Builder() { | ||
} | ||
|
||
public Table.Builder withName(String name) { | ||
Preconditions.checkState(null == this.name, "`.withName(..)` can only be called once"); | ||
this.name = name; | ||
return this; | ||
} | ||
|
||
public Table.Builder withCompactionStrategy(String compactionStrategy) { | ||
Preconditions | ||
.checkState(null == this.compactionStrategy, "`.withCompactionStrategy(..)` can only be called once"); | ||
|
||
this.compactionStrategy = compactionStrategy; | ||
return this; | ||
} | ||
|
||
public Table build() { | ||
Preconditions.checkNotNull(name, "`.withName(..)` must be called before `.build()`"); | ||
Preconditions.checkNotNull(compactionStrategy, "`.withCompactionStrategy(..)` must be called before `.build()`"); | ||
return new Table(this); | ||
} | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.