私はGoogle融合表を埋めます。私は約2mioのエントリをfusionテーブルに追加する必要があります。Google Fusion Tablesデータをインポートするときに割り当て量が超過
私はこれは、いくつかのmonthesのために働いGoogle.Apis.Fusiontables.v2 1.10.0.50
を使用しています。しかし今では、制限を超過してしまいます。
Google.Apis.Requests.RequestErrorクォータ超過[403]エラー[ メッセージ[クォータが超過]ロケーション[ - ]理由[quotaExceeded]ドメイン[usageLimits]
あるように、より多くのデータこれは驚くべきことではありません。
しかし、私はhttps://console.developers.google.com/apis/api/fusiontables/quotasの割り当てを見ると、私はどんな制限も当たっていないことがわかります。
また、グローバルクォータダッシュボードでは、私が当てはまる制限はありません。
私はテーブルあたり250MBを打つかもしれないと思った。しかし、私がデータソースをダウンロードすると、CSVには40 MBしかありません。 しかし、これは読み取り専用のクォータではないと思いますか?
private static void WriteItem()
{
await WriteAsync("map_data", index.AllEdges<BusEdge<TId>>().Where(x => x.MinFrequentPriceInEur > 0), (busEdge, csvWriter) =>
{
WriteItem(busEdge, csvWriter);
itemHandled();
});
}
private static void WriteItem(BusEdge<TId> busEdge, CsvWriter csvWriter)
{
csvWriter.WriteField(Source.Id.ToString());
csvWriter.WriteField(sink.Id.ToString());
csvWriter.WriteField(string.Format(CultureInfo.InvariantCulture, "{0} {1}",
sink.Geolocation.Latitude,
sink.Geolocation.Longitude));
csvWriter.WriteField(sink.Population);
foreach (Language language in Languages.AllLanguages)
{
csvWriter.WriteField(sink.DisplayName[language], true);
}
var priceWithDate =
busEdge.Prices.GroupBy(x => x.Value.MinimumFrequentInEur)
.OrderByDescending(x => x.Count()).SelectMany(x => x)
.OrderBy(x => x.Key)
.FirstOrDefault();
double price = priceWithDate.Value.MinimumFrequentInEur;
csvWriter.WriteField(Math.Round(price, 2));
csvWriter.WriteField(Math.Round(CurrencyInfo.EUR.ConvertMoney(price, CurrencyInfo.GBP), 2));
csvWriter.WriteField(Math.Round(CurrencyInfo.EUR.ConvertMoney(price, CurrencyInfo.HRK), 2));
csvWriter.WriteField(Math.Round(CurrencyInfo.EUR.ConvertMoney(price, CurrencyInfo.PLN), 2));
csvWriter.WriteField(priceWithDate.Key.ToString("s"));
public static async Task WriteAsync<T>(string tableName, IEnumerable<T> list, Action<T, CsvWriter> writerAction)
{
using (FusiontablesService service = Connect())
{
var tables = service.Table.List().Execute();
var tableId = tables.Items.Where(x => x.Name == tableName).Select(x => x.TableId).First();
MemoryStream memoryStream = new MemoryStream();
bool hasWritten = false;
Func<Task> uploadAsync = async() =>
{
if (memoryStream.Length > 0)
{
memoryStream.Position = 0;
ResumableUpload<string> request =
hasWritten ?
(ResumableUpload<string>)service.Table.ImportRows(tableId, memoryStream, "application/octet-stream") :
(ResumableUpload<string>)service.Table.ReplaceRows(tableId, memoryStream, "application/octet-stream");
var response = await request.UploadAsync();
if (response.Exception != null)
{
throw response.Exception;
}
memoryStream = new MemoryStream();
hasWritten = true;
}
};
using (StreamWriter writer = new StreamWriter(memoryStream, Encoding.UTF8, 1024, true))
{
using (CsvWriter csvWriter = new CsvWriter(writer, new CsvConfiguration { Delimiter = "," }))
{
foreach (T item in list)
{
writerAction(item, csvWriter);
csvWriter.NextRecord();
writer.Flush();
if (memoryStream.Length >= Limit)
{
await uploadAsync();
}
}
}
}
await uploadAsync();
}
私は特定の限界を見つけることができますどのように任意のアドバイスはありますか?コードの改善に関する推奨事項はありますか?
GoogleフュージョンテーブルではGoogleドライブに特別なストレージスペースが使用されますが、[google開発者](https://productforums.google.com/forum/?utm_medium=)の容量は1GBですメール&utm_source =フッター#!msg/google-fusion-tables/XXxVkTHDFQk/iCNSkjAAAQAJ)。融合テーブルが複数ある場合は、結合サイズが1GBを超えているかどうかを確認してください。 –