org.apache.hadoop.hive.ql.hooks
Class WriteEntity

java.lang.Object
  extended by org.apache.hadoop.hive.ql.hooks.Entity
      extended by org.apache.hadoop.hive.ql.hooks.WriteEntity
All Implemented Interfaces:
Serializable

public class WriteEntity
extends Entity
implements Serializable

This class encapsulates an object that is being written to by the query. This object may be a table, partition, dfs directory or a local directory.

See Also:
Serialized Form

Nested Class Summary
static class WriteEntity.WriteType
           
 
Nested classes/interfaces inherited from class org.apache.hadoop.hive.ql.hooks.Entity
Entity.Type
 
Constructor Summary
WriteEntity()
          Only used by serialization.
WriteEntity(org.apache.hadoop.hive.metastore.api.Database database, WriteEntity.WriteType type)
           
WriteEntity(DummyPartition p, WriteEntity.WriteType type, boolean complete)
           
WriteEntity(Partition p, WriteEntity.WriteType type)
          Constructor for a partition.
WriteEntity(org.apache.hadoop.fs.Path d, boolean islocal)
          Constructor for a file.
WriteEntity(org.apache.hadoop.fs.Path d, boolean islocal, boolean isTemp)
          Constructor for a file.
WriteEntity(Table t, WriteEntity.WriteType type)
          Constructor for a table.
WriteEntity(Table t, WriteEntity.WriteType type, boolean complete)
           
 
Method Summary
static WriteEntity.WriteType determineAlterTableWriteType(AlterTableDesc.AlterTableTypes op)
          Determine the type of lock to request for a given alter table type.
 boolean equals(Object o)
          Equals function.
 WriteEntity.WriteType getWriteType()
          Determine which type of write this is.
 boolean isTempURI()
           
 
Methods inherited from class org.apache.hadoop.hive.ql.hooks.Entity
getD, getDatabase, getLocation, getName, getP, getParameters, getPartition, getT, getTable, getTyp, getType, hashCode, isComplete, isDummy, setComplete, setD, setDatabase, setName, setP, setT, setTyp, toString
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

WriteEntity

public WriteEntity()
Only used by serialization.


WriteEntity

public WriteEntity(org.apache.hadoop.hive.metastore.api.Database database,
                   WriteEntity.WriteType type)

WriteEntity

public WriteEntity(Table t,
                   WriteEntity.WriteType type)
Constructor for a table.

Parameters:
t - Table that is written to.

WriteEntity

public WriteEntity(Table t,
                   WriteEntity.WriteType type,
                   boolean complete)

WriteEntity

public WriteEntity(Partition p,
                   WriteEntity.WriteType type)
Constructor for a partition.

Parameters:
p - Partition that is written to.

WriteEntity

public WriteEntity(DummyPartition p,
                   WriteEntity.WriteType type,
                   boolean complete)

WriteEntity

public WriteEntity(org.apache.hadoop.fs.Path d,
                   boolean islocal)
Constructor for a file.

Parameters:
d - The name of the directory that is being written to.
islocal - Flag to decide whether this directory is local or in dfs.

WriteEntity

public WriteEntity(org.apache.hadoop.fs.Path d,
                   boolean islocal,
                   boolean isTemp)
Constructor for a file.

Parameters:
d - The name of the directory that is being written to.
islocal - Flag to decide whether this directory is local or in dfs.
isTemp - True if this is a temporary location such as scratch dir
Method Detail

getWriteType

public WriteEntity.WriteType getWriteType()
Determine which type of write this is. This is needed by the lock manager so it can understand what kind of lock to acquire.

Returns:
write type

equals

public boolean equals(Object o)
Equals function.

Overrides:
equals in class Entity

isTempURI

public boolean isTempURI()

determineAlterTableWriteType

public static WriteEntity.WriteType determineAlterTableWriteType(AlterTableDesc.AlterTableTypes op)
Determine the type of lock to request for a given alter table type.

Parameters:
op - Operation type from the alter table description
Returns:
the write type this should use.


Copyright © 2014 The Apache Software Foundation. All rights reserved.