我无法将所有数据存储到firebase。我有一个函数来存储数据,使用一个类,成员作为数据。
我将数据写入firebase,firebase存储数据,但只存储我想要存储的数据的1/2左右。我有一个由我的sql数据游标提供的数据日志,我创建了一个抽象游标窗口。
然后我循环这个并存储所有条目。它只在上半年左右储存。然而,存储的数据变量在完成时是正确的,这意味着它已经成功地在我的数据库中循环
因此,我在firebase的存储有问题。
我要将172155个值存储到firebase。我的data stored变量在完成my的mass store函数时等于这个值,但是当我提取数据时,它限制为81789个条目。我已经检查了json中的所有数据。
我的问题是如何正确地存储这些数据。如果我尝试存储较少的数据,它可以工作,但我需要能够存储这种大小的数据。
为什么这样不行? mDatareff_User.child(valueOf(i)).setValue(member);
我的代码如下:
private void Mass_store_to_firebase() {
Cursor data;
data = BLE_DB.showData_Filtered_Log();
data.moveToFirst();
data_stored = 0;
if (data.getCount() == 0) {
Utils.toast(getApplicationContext(), "No data selected");
}
if (data.getCount() != 0) {
//Cursor window fix and get data
if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.P) {
CursorWindow cw = new CursorWindow("mass_store", 536870912);//16777216 broke
AbstractWindowedCursor ac = (AbstractWindowedCursor) data;
ac.setWindow(cw);
ac.moveToFirst();//0
if (ac.getCount() == 0)//No data selected
{
Utils.toast(getApplicationContext(), "No data selected");
}
for (int i = 0; i < ac.getCount(); i++) {
member.setT1_Data_string(ac.getString(1));//T1
member.setT2_Data_string(ac.getString(2));//T2
member.setT3_Data_string(ac.getString(4));//T3
member.setT4_Data_string(ac.getString(5));//T4
member.setPdiff_Data_string(ac.getString(6));//P1 data
member.setTime_string(ac.getString(7));
//Userdata_number_of_data = Userdata_number_of_data + 1;
//mDatareff_User.child(valueOf(Userdata_number_of_data)).setValue(member);//Increment max id count
mDatareff_User.child(valueOf(i)).setValue(member);//Use i to set the data.
data_stored++;
ac.moveToNext();
}
ac.close();
}
Log.d(TAG, "Stored mass data");//Log the event
Utils.toast(getApplicationContext(), "Stored mass data");//Inform the user
}
}
洛格猫之剪
2020-06-04 14:52:44.128 8113-8223/com.example.firebase D/EventRaiser: Raising 2 event(s)
2020-06-04 14:52:44.129 8113-8223/com.example.firebase D/Connection: conn_0 - Sending data: {t=d, d={a=p, r=54242, b={p=D3:68:62:99:90:C3/54238, d={t4_Data_string=2268, t2_Data_string=2268, t3_Data_string=2268, t1_Data_string=2268, pdiff_Data_string=-0.020000, time_string=2020-05-30 01:27:22 GMT}}}}
2020-06-04 14:52:44.129 8113-8224/com.example.firebase D/WebSocket: ws_0 - ws message: {"t":"d","d":{"b":{"p":"D3:68:62:99:90:C3/54235","d":{"pdiff_Data_string":"-0.020000","t1_Data_string":"2268","t2_Data_string":"2268","t3_Data_string":"2268","t4_Data_string":"2268","time_string":"2020-05-30 01:27:19 GMT"}},"a":"d"}}
2020-06-04 14:52:44.129 8113-8223/com.example.firebase D/WebSocket: ws_0 - Reset keepAlive. Remaining: 42807
2020-06-04 14:52:44.130 8113-8223/com.example.firebase D/RepoOperation: Aborting transactions for path: /D3:68:62:99:90:C3/54238. Affected: /D3:68:62:99:90:C3/54238
2020-06-04 14:52:44.130 8113-8223/com.example.firebase D/RepoOperation: set: /D3:68:62:99:90:C3/54239
2020-06-04 14:52:44.130 8113-8223/com.example.firebase D/DataOperation: set: /D3:68:62:99:90:C3/54239 {
pdiff_Data_string=-0.010
t1_Data_string=2268
t2_Data_string=2268
t3_Data_string=2268
t4_Data_string=2268
time_string=2020-05-30 01:27:23 GMT
}
2020-06-04 14:52:44.130 8113-8224/com.example.firebase D/WebSocket: ws_0 - ws message: {"t":"d","d":{"r":54239,"b":{"s":"ok","d":""}}}
2020-06-04 14:52:44.131 8113-8223/com.example.firebase D/EventRaiser: Raising 2 event(s)
2020-06-04 14:52:44.131 8113-8224/com.example.firebase D/WebSocket: ws_0 - ws message: {"t":"d","d":{"b":{"p":"D3:68:62:99:90:C3/54236","d":{"pdiff_Data_string":"-0.020000","t1_Data_string":"2268","t2_Data_string":"2268","t3_Data_string":"2268","t4_Data_string":"2268","time_string":"2020-05-30 01:27:20 GMT"}},"a":"d"}}
2020-06-04 14:52:44.131 8113-8224/com.example.firebase D/WebSocket: ws_0 - ws message: {"t":"d","d":{"r":54240,"b":{"s":"ok","d":""}}}
2020-06-04 14:52:44.131 8113-8224/com.example.firebase D/WebSocket: ws_0 - ws message: {"t":"d","d":{"b":{"p":"D3:68:62:99:90:C3/54237","d":{"pdiff_Data_string":"-0.020000","t1_Data_string":"2268","t2_Data_string":"2268","t3_Data_string":"2268","t4_Data_string":"2268","time_string":"2020-05-30 01:27:21 GMT"}},"a":"d"}}
2020-06-04 14:52:44.131 8113-8224/com.example.firebase D/WebSocket: ws_0 - ws message: {"t":"d","d":{"r":54241,"b":{"s":"ok","d":""}}}
2020-06-04 14:52:44.137 8113-8223/com.example.firebase D/Connection: conn_0 - Sending data: {t=d, d={a=p, r=54243, b={p=D3:68:62:99:90:C3/54239, d={t4_Data_string=2268, t2_Data_string=2268, t3_Data_string=2268, t1_Data_string=2268, pdiff_Data_string=-0.010, time_string=2020-05-30 01:27:23 GMT}}}}
2020-06-04 14:52:44.137 8113-8223/com.example.firebase D/WebSocket: ws_0 - Reset keepAlive. Remaining: 44992
2020-06-04 14:52:44.137 8113-8223/com.example.firebase D/RepoOperation: Aborting transactions for path: /D3:68:62:99:90:C3/54239. Affected: /D3:68:62:99:90:C3/54239
2020-06-04 14:52:44.137 8113-8223/com.example.firebase D/RepoOperation: set: /D3:68:62:99:90:C3/54240
2020-06-04 14:52:44.137 8113-8223/com.example.firebase D/DataOperation: set: /D3:68:62:99:90:C3/54240 {
暂无答案!
目前还没有任何答案,快来回答吧!