Skip to content

Instantly share code, notes, and snippets.

Avatar

Miloš Micić kombadzomba

  • Serbia
View GitHub Profile
View Logcat_2016_12_01
0 11-29 06:52:48.768 D/ACRA ( 6667): Connect to https://ngx.termin3.com/couchdb/acra-termin3/_design/acra-storage/_update/report
1 11-29 06:52:48.888 I/System.out( 6667): (HTTPLog)-Static: isSBSettingEnabled false
2 11-29 06:52:48.888 I/System.out( 6667): (HTTPLog)-Static: isSBSettingEnabled false
3 11-29 06:52:48.938 I/ACRA ( 6667): READ_LOGS granted! ACRA can include LogCat and DropBox data.
4 11-29 06:52:48.978 D/ACRA ( 6667): Sending request to https://ngx.termin3.com/couchdb/acra-termin3/_design/acra-storage/_update/report/8a3b2989-ae8d-420a-a613-fef4529efb77
5 11-29 06:52:48.988 D/ACRA ( 6667): Sending request to https://ngx.termin3.com/couchdb/acra-termin3/_design/acra-storage/_update/report/073d48cf-51a4-429e-aa3a-8eed307d3ebe
6 11-29 06:52:48.988 D/ACRA ( 6667): Retrieving logcat output...
7 11-29 06:52:49.028 D/ACRA ( 6667): Sending request to https://ngx.termin3.com/couchdb/acra-termin3/_design/acra-storage/_update/report/8a3b2989-ae8d-420a-a613-fef4529efb77
8 11-29 06:52:49.118 D/ACRA ( 6667): Wri
View filtered replication
database.setFilter("deviceFilter", new ReplicationFilter() {
@Override
public boolean filter(SavedRevision revision, Map<String, Object> params) {
String nameParam = (String) params.get(CommonEntity.FIELD_TYPE);
return nameParam != null && nameParam.equals(revision.getProperty(DocumentTypeCode.SYS_USER));
}
});
View gist:b3eadc88a4d5e488d3ec9a6d1b96e684
09-29 22:47:23.163 1917-2298/net.dzomba.termin3.stage D/Termin3 Stage -> CouchDbManager: Local replication ChangeEvent PUSH replication event. Source: Replication{http://user:pass@localhost:8160/org_974/, push} Transition: INITIAL -> RUNNING Total changes: 0 Completed changes: 0
09-29 22:47:23.184 1917-2338/net.dzomba.termin3.stage W/Router: Error 406: Can't satisfy request Accept: multipart/related, application/json (Content-Type = application/json)
09-29 22:47:23.186 1917-2300/net.dzomba.termin3.stage W/RemoteRequest: com.couchbase.lite.replicator.RemoteRequest {POST, http://---:---@localhost:8160/org_974/_revs_diff}: Got error status: 406 for http://user:pass@localhost:8160/org_974/_revs_diff. Reason: Not acceptable
09-29 22:47:23.190 1917-2300/net.dzomba.termin3.stage W/Sync: PusherInternal{http://---:---@localhost:8160/org_974/, push, 2a9b2}: Progress: set error = com.couchbase.lite.replicator.RemoteRequestResponseException: Not acceptable
09-29 22:48:19.557 1917-2298/net.dzomba.termin3.stage D/Termin3 S
View isue985_logcat3
0 09-18 08:28:59.673 E/Database(26613): at android.os.Handler.dispatchMessage(Handler.java:102)
1 09-18 08:28:59.673 E/Database(26613): at android.os.Looper.loop(Looper.java:148)
2 09-18 08:28:59.673 E/Database(26613): at android.app.ActivityThread.main(ActivityThread.java:5527)
3 09-18 08:28:59.673 E/Database(26613): at java.lang.reflect.Method.invoke(Native Method)
4 09-18 08:28:59.673 E/Database(26613): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:730)
5 09-18 08:28:59.673 E/Database(26613): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:620)
6 09-18 08:28:59.673 E/Termin3 -> CouchDbManager(26613): Couldn't find database
7 09-18 08:28:59.674 W/System.err(26613): com.couchbase.lite.CouchbaseLiteException: Unable to create a storage engine, Status: 401 (HTTP 401 unauthorized)
8 09-18 08:28:59.674 W/System.err(26613): at com.couchbase.lite.store.SQLiteStore.open(SQLiteStore.java:200)
9 09-18 08:28:59.674 W/System.err(26613): at com.couchbase.lite.Database.open(Data
View checkIfInitializationDone()
// inicijalizacija baze treba da je gotova tek kada se dovuku svi dokumenti replikacijom
public void checkIfInitializationDone() {
Log.d(TAG, "checkIfInitializationDone");
if (!isInitialized() && database.getDocumentCount() > 0) { // <-- LINE 375 IN FIRST LOGCAT: 36 09-13 22:45:23.180 E/Event (29395): at net.dzomba.termin3.model.couchdb.CouchDbManager.checkIfInitializationDone(CouchDbManager.java:375)
switch (databaseType) {
case ORG:
// initialization is done whenorg document exists
// and pull sync is over
if (CouchDbFacade.getInstance().getOrganization() != null && !isSyncInProgress()) {
setInitialized(true);
View view.getData()
public synchronized List<? extends CommonEntity> getData() {
Query orderedQuery = view.createQuery();
orderedQuery.setStartKey(startKey);
orderedQuery.setEndKey(endKey);
orderedQuery.setDescending(descending);
// data is protected variable
if (data == null) {
data = new LinkedList();
}
data.clear();
View four warmup queries
public LinkedList<TerminEntity> getTerminByDateAndClientName(StaffEntity staff, Date startDate, Date endDate, String clientName) {
if (couchDbOrg == null) {
EventBus.getDefault().post(new DbNotInitializedEvent());
return new LinkedList<>();
}
synchronized (viewFactory.terminByClientNameView) {
TerminByClientNameView view = viewFactory.terminByClientNameView;
view.setDescending(true);
LinkedList<TerminEntity> results = (LinkedList<TerminEntity>) view.getData();
return new LinkedList(results);
View four
public LinkedList<TerminEntity> getTerminByDateAndClientName(StaffEntity staff, Date startDate, Date endDate, String clientName) {
if (couchDbOrg == null) {
EventBus.getDefault().post(new DbNotInitializedEvent());
return new LinkedList<>();
}
synchronized (viewFactory.terminByClientNameView) {
TerminByClientNameView view = viewFactory.terminByClientNameView;
view.setDescending(true);
LinkedList<TerminEntity> results = (LinkedList<TerminEntity>) view.getData();
return new LinkedList(results);
View four warmup methods
public static void warmpupSearch() {
Observable observable = Observable.create(new Observable.OnSubscribe<LinkedList<TerminEntity>>() {
@Override
public void call(Subscriber<? super LinkedList<TerminEntity>> subscriber) {
try {
subscriber.onNext(CouchDbFacade.getInstance().getTerminByDateAndClientName(
null,
null,
null,
null));
View isue985_logcat2
0 09-15 20:54:42.617 W/Database( 7040): at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:588)
1 09-15 20:54:42.617 W/Database( 7040): at java.lang.Thread.run(Thread.java:818)
2 09-15 20:54:42.617 E/View ( 7040): Error getting last sequence indexed
3 09-15 20:54:42.617 E/View ( 7040): com.couchbase.lite.internal.database.sqlite.exception.SQLiteDatabaseCorruptException: database disk image is malformed (code 11): , while compiling: SELECT count(*) FROM sqlite_master
4 09-15 20:54:42.617 E/View ( 7040): at com.couchbase.lite.internal.database.sqlite.SQLiteConnection.nativePrepareStatement(Native Method)
5 09-15 20:54:42.617 E/View ( 7040): at com.couchbase.lite.internal.database.sqlite.SQLiteConnection.acquirePreparedStatement(SQLiteConnection.java:718)
6 09-15 20:54:42.617 E/View ( 7040): at com.couchbase.lite.internal.database.sqlite.SQLiteConnection.executeForLong(SQLiteConnection.java:522)
7 09-15 20:54:42.617 E/View ( 7040): at com.couchbase.lite.storage.SQLiteStorageEngineBase.
You can’t perform that action at this time.