本文整理了Java中com.amazonaws.services.ec2.model.Instance.<init>()
方法的一些代码示例,展示了Instance.<init>()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Instance.<init>()
方法的具体详情如下:
包路径:com.amazonaws.services.ec2.model.Instance
类名称:Instance
方法名:<init>
暂无
代码示例来源:origin: apache/incubator-druid
@Before
public void setUp()
{
amazonEC2Client = EasyMock.createMock(AmazonEC2Client.class);
describeInstancesResult = EasyMock.createMock(DescribeInstancesResult.class);
reservation = EasyMock.createMock(Reservation.class);
instance = new Instance()
.withInstanceId(INSTANCE_ID)
.withLaunchTime(new Date())
.withImageId(AMI_ID)
.withPrivateIpAddress(IP);
managementConfig = new SimpleWorkerProvisioningConfig().setWorkerPort(8080).setWorkerVersion("");
}
代码示例来源:origin: aws/aws-sdk-java
public Instance unmarshall(StaxUnmarshallerContext context) throws Exception {
Instance instance = new Instance();
int originalDepth = context.getCurrentDepth();
int targetDepth = originalDepth + 1;
代码示例来源:origin: stackoverflow.com
Instance[] a = new Instance[5];
for (int i == 0; i < a.length; i++) {
// first create your instance
a[i] = new Instance(); // don't know if this is a valid constructor
// and only *then* can you use it
a[i].setAttribute(i);
a[i].setLabel(i % 2 == 0);
}
代码示例来源:origin: stackoverflow.com
synchronized (instanceMutex) {
final Instance no = new Instance();
while (no.getInstances() > 0) { // this check will need to be synchronized as well
instanceMutex.wait();
}
// and only increment `no` once you've made a successful check.
no.incrementInstance();
}
代码示例来源:origin: stackoverflow.com
if(instance == null){
instance = new Instance();
}
return instance
代码示例来源:origin: stackoverflow.com
synchronized (instanceMutex) {
// each thread will make its own instance here
final Instance no = new Instance();
代码示例来源:origin: stackoverflow.com
private static Instance INSTANCE = new Instance();
代码示例来源:origin: stackoverflow.com
synchronized (instanceMutex) {
final Instance no = new Instance();
if (no.getInstances() > 0) {
instanceMutex.wait();
} else {
no.incrementInstance();
}
try {
// do something
} finally {
if (no.Instances() > 0) {
no.decementInstance();
}
instanceMutex.notify();
}
}
代码示例来源:origin: stackoverflow.com
Instance a1 = new Instance();
a[0] = a1;
Instance a2 = new Instance();
..
Instance a5 = new Instance();
代码示例来源:origin: stackoverflow.com
String str="123/false"
String[] ss = str.split("/");
Object[] value = new Object[ss.length];
// Conversion String to int, first parameter
value[0] = Integer.parseInt(ss[0]);
// Conversion String to boolean, second parameter
value[1] = Boolean.parseBoolean(ss[1]);
method.invoke(new Instance(), value);
代码示例来源:origin: stackoverflow.com
//assuming we already have arff loaded in a variable called dataset
Instance newInstance = new Instance();
for(int i = 0 ; i < dataset.numAttributes() ; i++)
{
newInstance.setValue(i , value);
//i is the index of attribute
//value is the value that you want to set
}
//add the new instance to the main dataset at the last position
dataset.add(newInstance);
//repeat as necessary
代码示例来源:origin: stackoverflow.com
Instance retrieve = new Instance()
method doSomething() {
retrievedVal = retrieve.retrieveFromDB(something)
return transform(retrievedVal)
}
代码示例来源:origin: stackoverflow.com
//assuming we already have arff loaded in a variable called dataset
Instance newInstance = new Instance();
for(int i = 0 ; i < dataset.numAttributes() ; i++)
{
newInstance.setValue(i , value);
//i is the index of attribute
//value is the value that you want to set
}
//add the new instance to the main dataset at the last position
dataset.add(newInstance);
//repeat as necessary
代码示例来源:origin: stackoverflow.com
Instance instance = new Instance("https://blah.service-now.com", "username", "password");
GlideFilter filter = new GlideFilter("category=network^active=true");
GlideRecordIterator iter = instance.table("incident").
bulkFetcher().setFilter(filter).getAllRecords().iterator();
while (iter.hasNext()) {
GlideRecord rec = iter.next();
System.out.println(
rec.getField("number") + " " + rec.getField("short_description"));
}
代码示例来源:origin: stackoverflow.com
int numAttributes = trainHeader.numAttributes();
double[] vals = new double[numAttributes];
for (int i = 0; i < numAttributes - 1; i++) {
Attribute attribute = trainHeader.attribute(i);
//If your attribute is nominal or string:
double value = attribute.indexOfValue(myStrVal); //get myStrVal from your source
//If your attribute is numeric
double value = myNumericVal; //get myNumericVal from your source
vals[i] = value;
}
vals[numAttributes] = Instance.missingValue();
Instance instance = new Instance(1.0, vals);
instance.setDataset(trainHeader);
return instance;
代码示例来源:origin: stackoverflow.com
Instance inst = new Instance(4); <-- Adjust number of instances you want to add.
inst.setValue(trainData.attribute(0), age);
inst.setValue(trainData.attribute(1), administrativeGenderCode);
inst.setValue(trainData.attribute(2), zipCode);
inst.setValue(trainData.attribute(3), race);
// inst.setValue(trainData.attribute(4), "H2034"); <-- Do not add the instance you want to classify.
代码示例来源:origin: stackoverflow.com
private Instance makeInstance(Instance i) {
Instance instance = new Instance(2); // two attributes
Attribute messageAttribute = dataset.attribute("Msg");
instance.setValue(messageAttribute, messageAttribute.addStringValue(getMsg(i)));
instance.setDataset(this.dataset);
instance.setClassValue(getClassValue(i));
return instance
}
代码示例来源:origin: stackoverflow.com
// Msg: String, Class: String
private Instance makeInstance(String text, String classValue) {
Instance instance = new Instance(2); // two attributes
Attribute messageAttribute = data.attribute("Msg");
instance.setValue(messageAttribute, messageAttribute.addStringValue(text));
instance.setClassValue(classValue);
instance.setDataset(this.dataset);
return instance;
}
代码示例来源:origin: LendingClub/mercator
@Test
public void testEc2Instance() throws IOException {
Instance instance = new Instance();
instance.setInstanceId("i-123456");
instance.setTags(Lists.newArrayList(new Tag("foo", "bar"), new Tag("fizz", "buzz")));
JsonNode n = new JsonConverter().toJson(instance);
Assertions.assertThat(n.path("aws_instanceId").asText()).isEqualTo("i-123456");
Assertions.assertThat(n.path("aws_tag_foo").asText()).isEqualTo("bar");
Assertions.assertThat(n.path("aws_tag_fizz").asText()).isEqualTo("buzz");
logger.info("{}", mapper.writerWithDefaultPrettyPrinter().writeValueAsString(n));
}
代码示例来源:origin: aws-amplify/aws-sdk-android
public Instance unmarshall(StaxUnmarshallerContext context) throws Exception {
Instance instance = new Instance();
int originalDepth = context.getCurrentDepth();
int targetDepth = originalDepth + 1;
内容来源于网络,如有侵权,请联系作者删除!