225c0d55992aefae478461bba278644bdfdda3c5 max Wed Jan 15 08:33:57 2014 -0800 library changes for the browser box: This changes mostly hdb and jksql,plus - to a smaller extent - various other places in the code that deal with /gbdb/ files. The overall aim is to make it possible to have the data remote at UCSC while having the CGIs on a machine far away. At up to 180msecs distance from UCSC (Europe,Japan), each query can get slow. So I tried to reduce the number of queries sent to UCSC while allowing to keep some mysql tables on localhost. I changed four things: - extend larry's table cache to include field names. The code uses "describe" very often, which is slow from remote. With a table name cache these queries can be handled locally. This is configured in hg.conf - mysql "failover" connections: a mysql connection can have a 2nd connection that is used if a query fails, configured in hg.conf (I didn't call it "remote" connections, because we use that term already in the code) - mysql lazy connects: don't connect a sqlConnection right away, but only when needed. a mysql connect takes >500msecs from across the atlantic. - move gbdb: patch various places that use absolute "/gbdb/" pathnames to go through a central function that can change the filename of gbdb files to something else, as configured in hg.conf Plus patch 1 or 2 lines for more speed + update the hgMirror script diff --git src/hg/inc/wiggle.h src/hg/inc/wiggle.h index af5fa2e..c76868f 100644 --- src/hg/inc/wiggle.h +++ src/hg/inc/wiggle.h @@ -411,31 +411,31 @@ unsigned long long maxOutput; /* maximum items fetched */ boolean isFile; /* TRUE == it is a file, FALSE == DB */ boolean bedConstrained; /* signal to output routines */ boolean useDataConstraint; /* to simplify checking if it is on */ enum wigCompare wigCmpSwitch; /* for compare function switch */ char *dataConstraint; /* one of < = >= <= == != 'in range' */ double limit_0; /* for constraint comparison */ double limit_1; /* for constraint comparison */ unsigned char ucLowerLimit; /* for comparison direct to bytes */ unsigned char ucUpperLimit; /* for comparison direct to bytes */ char *sqlConstraint; /* extra SQL constraints */ unsigned int currentSpan; /* for use during reading */ char *currentChrom; /* for use during reading */ char *wibFile; /* for use during reading */ - int wibFH; /* wibFile handle */ + struct udcFile *wibFH; /* wibFile handle */ struct sqlConnection *conn; /* SQL connection when talking to db */ struct sqlResult *sr; /* SQL result when talking to db */ char *chrName; /* for chrom==chrName on file reads */ unsigned spanLimit; /* for span==spanLimit on file reads */ int winStart; /* for fetches between winStart, winEnd */ int winEnd; /* for fetches between winStart, winEnd */ int offset; /* offset to add to positions on output */ unsigned long long rowsRead; /* reading stats, SQL rows read */ unsigned long long validPoints; /* reading stats, number of data bytes */ unsigned long long noDataPoints; /* reading stats, NO_DATA bytes */ unsigned long long bytesRead; /* reading stats, total wib bytes */ unsigned long long bytesSkipped; /* reading stats, bytes not examined */ unsigned long long valuesMatched; /* reading stats, number of data bytes */ unsigned long long totalBedElements; /* on all bed lists */ };