ppe.ec2
Class Ec2InstanceType

java.lang.Object
  extended by ppe.ec2.Ec2InstanceType
All Implemented Interfaces:
nbl.utilj.TableModelRowable

public class Ec2InstanceType
extends java.lang.Object
implements nbl.utilj.TableModelRowable

Some descriptive information about ec2 instance types.


Nested Class Summary
static class Ec2InstanceType.VirtualizationType
           
 
Field Summary
 boolean clusterSupport
           
 java.lang.String description
           
 com.amazonaws.services.ec2.model.InstanceType instanceType
           
 int nCores
           
 double ramGB
           
 Ec2InstanceType.VirtualizationType vt
           
 
Constructor Summary
Ec2InstanceType(com.amazonaws.services.ec2.model.InstanceType instanceType, int nCores, double ramGB, boolean clusterSupport, Ec2InstanceType.VirtualizationType vt, java.lang.String description)
           
 
Method Summary
 java.lang.Class getColumnClass(int colIndex)
           
 java.lang.String getColumnName(int colIndex)
           
 java.lang.Object getColumnValue(int colIndex)
           
 java.lang.String getDescription()
           
static Ec2InstanceType getInstanceInfo(com.amazonaws.services.ec2.model.InstanceType instanceType)
           
static com.amazonaws.services.ec2.model.InstanceType getInstanceType(java.lang.String instanceTypeName)
          NOTE/WARNING: there is a bug in the aws implementation of InstanceType|.
static java.io.File getInstanceTypeFile()
           
static java.util.List<Ec2InstanceType> getInstanceTypes()
          Gets a list of supported ec2 instance types as specified in the instance type file supplied by
 int getNColumns()
           
static int getNCores(com.amazonaws.services.ec2.model.InstanceType instanceType)
           
 boolean isFullySpecified()
           
 boolean isHvm()
           
static boolean isHvm(java.lang.String s)
           
 boolean isPv()
           
static boolean isPv(java.lang.String s)
          There may be an inconsistency in AWS's strings for virtualization type.
 void setColumnValue(int colIndex, java.lang.Object value)
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

instanceType

public com.amazonaws.services.ec2.model.InstanceType instanceType

vt

public Ec2InstanceType.VirtualizationType vt

nCores

public int nCores

ramGB

public double ramGB

clusterSupport

public boolean clusterSupport

description

public java.lang.String description
Constructor Detail

Ec2InstanceType

public Ec2InstanceType(com.amazonaws.services.ec2.model.InstanceType instanceType,
                       int nCores,
                       double ramGB,
                       boolean clusterSupport,
                       Ec2InstanceType.VirtualizationType vt,
                       java.lang.String description)
Method Detail

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

isPv

public boolean isPv()

isHvm

public boolean isHvm()

getDescription

public java.lang.String getDescription()

getInstanceType

public static com.amazonaws.services.ec2.model.InstanceType getInstanceType(java.lang.String instanceTypeName)
                                                                     throws java.lang.IllegalArgumentException
NOTE/WARNING: there is a bug in the aws implementation of InstanceType|. InstanceType.valueOf(java.lang.String). It throws an exception on t1.micro even if it obtained from InstanceType.values().toString(). They've added a kluge method InstanceType.fromValue(java.lang.String) that solves the problem. That method is used in this function. All instance type translation should be done with this method only.

Parameters:
instanceTypeName -
Returns:
Throws:
java.lang.IllegalArgumentException

getInstanceTypes

public static java.util.List<Ec2InstanceType> getInstanceTypes()
                                                        throws java.io.FileNotFoundException,
                                                               java.io.IOException,
                                                               java.lang.NullPointerException
Gets a list of supported ec2 instance types as specified in the instance type file supplied by

Returns:
Throws:
java.io.FileNotFoundException
java.io.IOException
java.lang.NullPointerException

getInstanceTypeFile

public static java.io.File getInstanceTypeFile()

getInstanceInfo

public static Ec2InstanceType getInstanceInfo(com.amazonaws.services.ec2.model.InstanceType instanceType)
                                       throws java.io.FileNotFoundException,
                                              java.io.IOException
Throws:
java.io.FileNotFoundException
java.io.IOException

getNCores

public static int getNCores(com.amazonaws.services.ec2.model.InstanceType instanceType)
                     throws java.io.FileNotFoundException,
                            java.io.IOException
Throws:
java.io.FileNotFoundException
java.io.IOException

isPv

public static boolean isPv(java.lang.String s)
There may be an inconsistency in AWS's strings for virtualization type. It may be that both 'pv' and 'paravitual' are used. So


isHvm

public static boolean isHvm(java.lang.String s)

getColumnClass

public java.lang.Class getColumnClass(int colIndex)
Specified by:
getColumnClass in interface nbl.utilj.TableModelRowable

getColumnName

public java.lang.String getColumnName(int colIndex)
Specified by:
getColumnName in interface nbl.utilj.TableModelRowable

getColumnValue

public java.lang.Object getColumnValue(int colIndex)
Specified by:
getColumnValue in interface nbl.utilj.TableModelRowable

getNColumns

public int getNColumns()
Specified by:
getNColumns in interface nbl.utilj.TableModelRowable

setColumnValue

public void setColumnValue(int colIndex,
                           java.lang.Object value)
Specified by:
setColumnValue in interface nbl.utilj.TableModelRowable

isFullySpecified

public boolean isFullySpecified()