簡體   English   中英

從在HDInsight群集中運行的Map / Reduce作業訪問Azure Table存儲

[英]Accessing Azure Table storage from Map/Reduce job running in a HDInsight cluster

我們正在用C#編寫的4節點HDInsight群集上運行M / R作業。 Mapper類之一使用Azure表存儲來應用業務特定的規則。

如果未創建CloudTable,CloudTableClient和CloudStorageAccount對象,則M / R作業將正確運行。

但是,在為對象添加對象引用時,它會產生錯誤,並且作業執行將停止。 下面給出了部分代碼片段:

public class TopProgMapper : MapperBase
{
    CloudTable table = null;
    CloudStorageAccount storageAccount = null;
    CloudTableClient tableClient = null;

    //The above objects are instantiated and queried in the Mapper ctor

    public TopProgMapper()
    {
        // instantiation code here, which currently has been commented
    }
}

如上所述,即使沒有創建對象引用,映射器的ctor中的代碼也被注釋為執行錯誤。

從MapReduceResult對象(Info.ExitCode)收到的錯誤代碼為1,指示M / R代碼存在問題。 但是,當未創建上述參考對象時,其余代碼絕對可以正常運行並產生正確的輸出。

任何幫助,將不勝感激。 如果需要,將提供其他詳細信息。

謝謝與問候,Subho

聽起來像包含CoudTable,CloudStorageAccount和CloudTableClient的程序集在運行映射器的群集上不可用。 這應該是Microsoft.WindowsAzure.Storage.dll或Microsoft.WindowsAzure.StorageClient.dll,具體取決於您使用的API的版本。

嘗試添加config.FilesToInclude.Add("Microsoft.WindowsAzure.Storage.dll"); 在您的Configure方法中。

如果這樣做沒有幫助,請共享您嘗試啟動作業時的命令行和輸出或代碼和異常詳細信息。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM