Refine search
/** * Adds a shutdownHook with a priority, the higher the priority * the earlier will run. ShutdownHooks with same priority run * in a non-deterministic order. * * @param shutdownHook shutdownHook <code>Runnable</code> * @param priority priority of the shutdownHook. */ @InterfaceAudience.Public @InterfaceStability.Stable public void addShutdownHook(Runnable shutdownHook, int priority) { if (shutdownHook == null) { throw new IllegalArgumentException("shutdownHook cannot be NULL"); } if (shutdownInProgress.get()) { throw new IllegalStateException("Shutdown in progress, cannot add a " + "shutdownHook"); } hooks.add(new HookEntry(shutdownHook, priority)); }
/** * Interface to notify state changes of a service. */ @Public @Stable public interface ServiceStateChangeListener { /** * Callback to notify of a state change. The service will already * have changed state before this callback is invoked. * * This operation is invoked on the thread that initiated the state change, * while the service itself in in a sychronized section. * <ol> * <li>Any long-lived operation here will prevent the service state * change from completing in a timely manner.</li> * <li>If another thread is somehow invoked from the listener, and * that thread invokes the methods of the service (including * subclass-specific methods), there is a risk of a deadlock.</li> * </ol> * * * @param service the service that has changed. */ void stateChanged(Service service); }
@InterfaceAudience.Public @InterfaceStability.Stable public interface ByteBufferPool { /** * Get a new direct ByteBuffer. The pool can provide this from * removing a buffer from its internal cache, or by allocating a * new buffer. * * @param direct Whether the buffer should be direct. * @param length The minimum length the buffer will have. * @return A new ByteBuffer. This ByteBuffer must be direct. * Its capacity can be less than what was requested, but * must be at least 1 byte. */ ByteBuffer getBuffer(boolean direct, int length); /** * Release a buffer back to the pool. * The pool may choose to put this buffer into its cache. * * @param buffer a direct bytebuffer */ void putBuffer(ByteBuffer buffer); }
/** * JDOConnectURLHook is used to get the URL that JDO uses to connect to the * database that stores the metastore data. Classes implementing this must be * thread-safe (for Thrift server). */ @InterfaceAudience.Public @InterfaceStability.Stable public interface JDOConnectionURLHook { /** * Gets the connection URL to supply to JDO. In addition to initialization, * this method will be called after a connection failure for each reconnect * attempt. * * @param conf The configuration used to initialize this instance of the HMS * @return the connection URL * @throws Exception */ String getJdoConnectionUrl(Configuration conf) throws Exception; /** * Alerts this that the connection URL was bad. Can be used to collect stats, * etc. * * @param url */ void notifyBadConnectionUrl(String url); }
/** * AbortTxnEvent * Event generated for roll backing a transaction */ @InterfaceAudience.Public @InterfaceStability.Stable public class AbortTxnEvent extends ListenerEvent { private final Long txnId; /** * * @param transactionId Unique identification for the transaction that got rolledback. * @param handler handler that is firing the event */ public AbortTxnEvent(Long transactionId, IHMSHandler handler) { super(true, handler); txnId = transactionId; } /** * @return Long txnId */ public Long getTxnId() { return txnId; } }
@InterfaceAudience.Public @InterfaceStability.Stable public class DropTableEvent extends ListenerEvent { private final Table table; private final boolean deleteData; public DropTableEvent(Table table, boolean status, boolean deleteData, IHMSHandler handler) { super(status, handler); this.table = table; // In HiveMetaStore, the deleteData flag indicates whether DFS data should be // removed on a drop. this.deleteData = deleteData; } /** * @return the table */ public Table getTable() { return table; } /** * @return the deleteData flag */ public boolean getDeleteData() { return deleteData; } }
/** Thrown by {@link VersionedWritable#readFields(DataInput)} when the * version of an object being read does not match the current implementation * version as returned by {@link VersionedWritable#getVersion()}. */ @InterfaceAudience.Public @InterfaceStability.Stable public class VersionMismatchException extends IOException { private byte expectedVersion; private byte foundVersion; public VersionMismatchException(byte expectedVersionIn, byte foundVersionIn){ expectedVersion = expectedVersionIn; foundVersion = foundVersionIn; } /** Returns a string representation of this object. */ @Override public String toString(){ return "A record version mismatch occurred. Expecting v" + expectedVersion + ", found v" + foundVersion; } }
/** * OpenTxnEvent * Event generated for open transaction event. */ @InterfaceAudience.Public @InterfaceStability.Stable public class OpenTxnEvent extends ListenerEvent { private List<Long> txnIds; /** * @param txnIds List of unique identification for the transaction just opened. * @param handler handler that is firing the event */ public OpenTxnEvent(List<Long> txnIds, IHMSHandler handler) { super(true, handler); this.txnIds = Lists.newArrayList(txnIds); } /** * @return List<Long> txnIds */ public List<Long> getTxnIds() { return txnIds; } }
/** * CommitTxnEvent * Event generated for commit transaction operation */ @InterfaceAudience.Public @InterfaceStability.Stable public class CommitTxnEvent extends ListenerEvent { private final Long txnId; /** * * @param transactionId Unique identification for the transaction just got committed. * @param handler handler that is firing the event */ public CommitTxnEvent(Long transactionId, IHMSHandler handler) { super(true, handler); this.txnId = transactionId; } /** * @return Long txnId */ public Long getTxnId() { return txnId; } }
/** * This abstract class needs to be extended to provide implementation of actions that needs * to be performed before a particular event occurs on a metastore. These methods * are called before an event occurs on metastore. */ @InterfaceAudience.Public @InterfaceStability.Stable public abstract class MetaStorePreEventListener implements Configurable { private Configuration conf; public MetaStorePreEventListener(Configuration config){ this.conf = config; } public abstract void onEvent(PreEventContext context) throws MetaException, NoSuchObjectException, InvalidOperationException; @Override public Configuration getConf() { return this.conf; } @Override public void setConf(Configuration config) { this.conf = config; } }
/** * FileSystem related constants. */ @InterfaceAudience.Public @InterfaceStability.Stable public interface FsConstants { // URI for local filesystem public static final URI LOCAL_FS_URI = URI.create("file:///"); // URI scheme for FTP public static final String FTP_SCHEME = "ftp"; // Maximum number of symlinks to recursively resolve in a path static final int MAX_PATH_LINKS = 32; /** * ViewFs: viewFs file system (ie the mount file system on client side) */ public static final URI VIEWFS_URI = URI.create("viewfs:///"); public static final String VIEWFS_SCHEME = "viewfs"; }
@InterfaceAudience.Public @InterfaceStability.Stable public class ConfigChangeEvent extends ListenerEvent { private final String key; private final String oldValue; private final String newValue; public ConfigChangeEvent(IHMSHandler handler, String key, String oldValue, String newValue) { super(true, handler); this.key = key; this.oldValue = oldValue; this.newValue = newValue; } public String getKey() { return key; } public String getOldValue() { return oldValue; } public String getNewValue() { return newValue; } }