MCPcopy Create free account
hub / github.com/OpenTSDB/asynchbase / BrokenMetaException

Class BrokenMetaException

src/BrokenMetaException.java:32–97  ·  view source on GitHub ↗

Indicates that the .META. or -ROOT- table is corrupted.

Source from the content-addressed store, hash-verified

30 * Indicates that the {@code .META.} or {@code -ROOT-} table is corrupted.
31 */
32public final class BrokenMetaException extends NonRecoverableException {
33
34 private final byte[] table;
35
36 /**
37 * Constructor.
38 * @param region The region we were looking up
39 * (if known, can be {@code null} if not known).
40 * @param msg A message describing as precisely as possible what's wrong
41 * with the META table.
42 */
43 BrokenMetaException(final RegionInfo region, final String msg) {
44 super("Your .META. table seems broken for "
45 + (region == null ? "(unknown table)" : region)
46 + ". " + msg);
47 this.table = region.table();
48 }
49
50 /**
51 * Constructor.
52 * @param msg A message describing as precisely as possible what's wrong
53 * with the META table.
54 * @param cause The exception that occurred while we were trying to
55 * de-serialize an entry of the META table (e.g. a protobuf exception).
56 */
57 BrokenMetaException(final String msg, final Exception cause) {
58 super("Your .META. table seems broken. " + msg, cause);
59 this.table = null;
60 }
61
62 /**
63 * Constructor.
64 * @param msg A message describing as precisely as possible what's wrong
65 * with the META table.
66 */
67 BrokenMetaException(final String msg) {
68 super("Your .META. table seems broken. " + msg, null);
69 this.table = null;
70 }
71
72 /**
73 * Returns the name of the table for which we were trying to lookup a region.
74 * @return A possibly {@code null} byte array.
75 */
76 public byte[] table() {
77 return table;
78 }
79
80 /**
81 * Helper to complain about a particular {@link KeyValue} found.
82 * @param region The region we were looking up
83 * (if known, can be {@code null} if not known).
84 * @param msg A message describing as precisely as possible what's wrong
85 * with the META table.
86 * @param kv The {@link KeyValue} in which the problem was found.
87 */
88 static BrokenMetaException badKV(final RegionInfo region,
89 final String msg,

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…