AdlaCompute 類別
管理 Azure Machine Learning 中的 Azure Data Lake Analytics計算目標。
Azure Data Lake Analytics 是 Azure 雲端中的巨量資料分析平台。 它可以當做具有 Azure Machine Learning 管線的計算目標使用。 如需詳細資訊,請參閱 什麼是 Azure Machine Learning 中的計算目標?
類別 ComputeTarget 建構函式。
擷取與所提供工作區相關聯的 Compute 物件的雲端標記法。 傳回對應至所擷取之 Compute 物件之特定類型的子類別實例。
- 繼承
-
AdlaCompute
建構函式
AdlaCompute(workspace, name)
參數
備註
在使用 Azure Data Lake Analytics 之前,請先建立其帳戶。 若要建立一個,請參閱開始使用 Azure Data Lake Analytics。
下列範例示範如何使用 方法,將 ADLA 帳戶附加至工作區 attach_configuration 。
adla_compute_name = 'testadl' # Name to associate with new compute in workspace
# ADLA account details needed to attach as compute to workspace
adla_account_name = "<adla_account_name>" # Name of the Azure Data Lake Analytics account
adla_resource_group = "<adla_resource_group>" # Name of the resource group which contains this account
try:
# check if already attached
adla_compute = AdlaCompute(ws, adla_compute_name)
except ComputeTargetException:
print('attaching adla compute...')
attach_config = AdlaCompute.attach_configuration(resource_group=adla_resource_group, account_name=adla_account_name)
adla_compute = ComputeTarget.attach(ws, adla_compute_name, attach_config)
adla_compute.wait_for_completion()
print("Using ADLA compute:{}".format(adla_compute.cluster_resource_id))
print("Provisioning state:{}".format(adla_compute.provisioning_state))
print("Provisioning errors:{}".format(adla_compute.provisioning_errors))
方法
attach |
已淘汰。 請改用 將現有的 Azure Data Lake Analytics計算資源與提供的工作區產生關聯。 |
attach_configuration |
建立設定物件以附加 Azure Data Lake Analytics計算目標。 |
delete |
從相關聯的工作區中移除 AdlaCompute 物件。 如果此物件是透過 Azure Machine Learning 建立的,則也會刪除對應的雲端式物件。 如果此物件是在外部建立,而且只會附加至工作區,則會引發 ComputeTargetException ,而且不會變更任何專案。 |
deserialize |
將 JSON 物件轉換成 AdlaCompute 物件。 |
detach |
將 AdlaCompute 物件與其相關聯的工作區中斷連結。 基礎雲端物件不會刪除,只會移除關聯。 |
refresh_state |
執行物件的屬性就地更新。 此方法會根據對應雲端物件的目前狀態來更新屬性。 這主要用於手動輪詢計算狀態。 |
serialize |
將此 AdlaCompute 物件轉換成 JSON 序列化字典。 |
attach
已淘汰。 請改用 attach_configuration
方法。
將現有的 Azure Data Lake Analytics計算資源與提供的工作區產生關聯。
static attach(workspace, name, resource_id)
參數
傳回
計算物件的 AdlaCompute 物件表示。
傳回類型
例外狀況
attach_configuration
建立設定物件以附加 Azure Data Lake Analytics計算目標。
static attach_configuration(resource_group=None, account_name=None, resource_id=None)
參數
傳回
附加計算物件時要使用的組態物件。
傳回類型
例外狀況
delete
從相關聯的工作區中移除 AdlaCompute 物件。
如果此物件是透過 Azure Machine Learning 建立的,則也會刪除對應的雲端式物件。 如果此物件是在外部建立,而且只會附加至工作區,則會引發 ComputeTargetException ,而且不會變更任何專案。
delete()
例外狀況
deserialize
將 JSON 物件轉換成 AdlaCompute 物件。
static deserialize(workspace, object_dict)
參數
傳回
所提供 JSON 物件的 AdlaCompute 標記法。
傳回類型
例外狀況
備註
ComputeTargetException如果提供的工作區不是計算相關聯的工作區,則引發 。
detach
refresh_state
serialize
將此 AdlaCompute 物件轉換成 JSON 序列化字典。
serialize()
傳回
這個 AdlaCompute 物件的 JSON 表示。
傳回類型
例外狀況
意見反應
https://aka.ms/ContentUserFeedback。
即將登場:在 2024 年,我們將逐步淘汰 GitHub 問題作為內容的意見反應機制,並將它取代為新的意見反應系統。 如需詳細資訊,請參閱:提交並檢視相關的意見反應