ClusterHostUtil

public class ClusterHostUtil
extends Object

java.lang.Object
   ↳ com.android.tradefed.cluster.ClusterHostUtil


ฟังก์ชันยูทิลิตีแบบคงที่สำหรับคลัสเตอร์ TF เพื่อรับอินสแตนซ์การกำหนดค่าส่วนกลาง ข้อมูลโฮสต์ ฯลฯ

สรุป

เครื่องมือสร้างสาธารณะ

ClusterHostUtil()

เมธอดสาธารณะ

static IClusterClient getClusterClient()

รับอินสแตนซ์ IClusterClient ที่ใช้โต้ตอบกับแบ็กเอนด์ TFC

static IClusterOptions getClusterOptions()

รับอินสแตนซ์ IClusterOptions ที่ใช้จัดเก็บการตั้งค่าที่เกี่ยวข้องกับคลัสเตอร์

static long getCurrentTimeMillis()

แสดงผลเวลาปัจจุบันของระบบ

static String getHostIpAddress()

รับที่อยู่ IP

static String getHostName()

รับชื่อโฮสต์

static String getLocalDeviceSerial(String serial)

แสดงผลหมายเลขซีเรียลของอุปกรณ์ในเครื่องสำหรับหมายเลขซีเรียลของอุปกรณ์ที่ไม่ซ้ำกันที่ระบุ

static String getRunTarget(DeviceDescriptor device, String runTargetFormat, Map<String, String> deviceTags)

แสดงผลเป้าหมายการเรียกใช้สำหรับตัวอธิบายอุปกรณ์ที่ระบุ

static String getTestHarness()
static long getTfStartTimeMillis()
static String getTfVersion()

รับเวอร์ชัน TF ที่ทำงานในโฮสต์นี้

static String getUniqueDeviceSerial(DeviceDescriptor device)

แสดงผลหมายเลขซีเรียลของอุปกรณ์ที่ไม่ซ้ำกันสำหรับอุปกรณ์

static boolean isLocalhostIpPort(String input)

ตรวจสอบว่าอินพุตที่ระบุเป็นสตริง IP:PORT ของ localhost หรือไม่

วิธีการที่ได้รับการป้องกัน

static String toValidTfVersion(String version)

ตรวจสอบเวอร์ชัน TF และแสดงผลหากถูกต้อง

เครื่องมือสร้างสาธารณะ

ClusterHostUtil

public ClusterHostUtil ()

เมธอดสาธารณะ

getClusterClient

public static IClusterClient getClusterClient ()

รับอินสแตนซ์ IClusterClient ที่ใช้โต้ตอบกับแบ็กเอนด์ TFC

การคืนสินค้า
IClusterClient

getClusterOptions

public static IClusterOptions getClusterOptions ()

รับอินสแตนซ์ IClusterOptions ที่ใช้จัดเก็บการตั้งค่าที่เกี่ยวข้องกับคลัสเตอร์

การคืนสินค้า
IClusterOptions

getCurrentTimeMillis

public static long getCurrentTimeMillis ()

แสดงผลเวลาปัจจุบันของระบบ

การคืนสินค้า
long เวลาในหน่วยมิลลิวินาที

getHostIpAddress

public static String getHostIpAddress ()

รับที่อยู่ IP

การคืนสินค้า
String สตริงที่อยู่ IPV4 หรือ "UNKNOWN" หากเราดึงข้อมูลไม่ได้

getHostName

public static String getHostName ()

รับชื่อโฮสต์

1. พยายามรับชื่อโฮสต์จาก InetAddress 2. หากไม่สำเร็จ ให้ลองรับชื่อโฮสต์จาก HOSTNAME env 3. หากไม่ได้ตั้งค่า ให้สร้างชื่อโฮสต์ที่ไม่ซ้ำกัน

การคืนสินค้า
String ชื่อโฮสต์หรือ null หากเราดึงข้อมูลไม่ได้

getLocalDeviceSerial

public static String getLocalDeviceSerial (String serial)

แสดงผลหมายเลขซีเรียลของอุปกรณ์ในเครื่องสำหรับหมายเลขซีเรียลของอุปกรณ์ที่ไม่ซ้ำกันที่ระบุ

TFC จะส่งหมายเลขซีเรียลของอุปกรณ์ที่ไม่ซ้ำกันสำหรับอุปกรณ์ที่ไม่ใช่ทางกายภาพ ซึ่ง TF ไม่เข้าใจ วิธีนี้จะแปลงกลับเป็นหมายเลขซีเรียลของอุปกรณ์ในเครื่อง

พารามิเตอร์
serial String: หมายเลขซีเรียลของอุปกรณ์ที่ไม่ซ้ำกันจาก TFC

การคืนสินค้า
String หมายเลขซีเรียลของอุปกรณ์ในพื้นที่

getRunTarget

public static String getRunTarget (DeviceDescriptor device, 
                String runTargetFormat, 
                Map<String, String> deviceTags)

แสดงผลเป้าหมายการเรียกใช้สำหรับตัวอธิบายอุปกรณ์ที่ระบุ

พารามิเตอร์
device DeviceDescriptor: DeviceDescriptor เพื่อรับเป้าหมายการวิ่ง

runTargetFormat String

deviceTags Map

การคืนสินค้า
String run target

getTestHarness

public static String getTestHarness ()

การคืนสินค้า
String

getTfStartTimeMillis

public static long getTfStartTimeMillis ()

การคืนสินค้า
long

getTfVersion

public static String getTfVersion ()

รับเวอร์ชัน TF ที่ทำงานในโฮสต์นี้

การคืนสินค้า
String เวอร์ชัน TF ของโฮสต์นี้

getUniqueDeviceSerial

public static String getUniqueDeviceSerial (DeviceDescriptor device)

แสดงผลหมายเลขซีเรียลของอุปกรณ์ที่ไม่ซ้ำกันสำหรับอุปกรณ์

อุปกรณ์ที่ไม่ใช่ทางกายภาพ (เช่น โปรแกรมจำลอง) มีหมายเลขซีเรียลจำลองซึ่งไม่ซ้ำกันในโฮสต์ เมธอดนี้จะนำหน้าด้วยชื่อโฮสต์เพื่อให้ไม่ซ้ำกัน

พารามิเตอร์
device DeviceDescriptor: ตัวอธิบายอุปกรณ์

การคืนสินค้า
String หมายเลขซีเรียลของอุปกรณ์ที่ไม่ซ้ำกัน

isLocalhostIpPort

public static boolean isLocalhostIpPort (String input)

ตรวจสอบว่าอินพุตที่ระบุเป็นสตริง IP:PORT ของ localhost หรือไม่

พารามิเตอร์
input String: สตริงที่จะตรวจสอบ

การคืนสินค้า
boolean เป็นจริงหากอินพุตที่ระบุเป็นสตริง IP:PORT ของ localhost

วิธีการที่ได้รับการป้องกัน

toValidTfVersion

protected static String toValidTfVersion (String version)

ตรวจสอบเวอร์ชัน TF และแสดงผลหากถูกต้อง

พารามิเตอร์
version String: สตริงสำหรับเวอร์ชัน TF ที่ VersionParser ระบุ

การคืนสินค้า
String เวอร์ชันหากถูกต้อง หรือเวอร์ชันเริ่มต้นหากไม่ถูกต้อง