comparison insert.cpp @ 320:a995e5ad999a large_adb

working LARGE_ADB support. Activiate at creation time with -N --ntracks 20001 or greater, or with --datasize 1356 or greater, or both. LARGE_ADB blocks non-indexed QUERY.
author mas01mc
date Wed, 20 Aug 2008 13:50:58 +0000
parents c270d9e4659a
children da2272e029b3
comparison
equal deleted inserted replaced
319:b9eff6896943 320:a995e5ad999a
155 error("too many timepoints in times file", timesFileName); 155 error("too many timepoints in times file", timesFileName);
156 } 156 }
157 } 157 }
158 158
159 void audioDB::insertPowerData(unsigned numVectors, int powerfd, double *powerdata) { 159 void audioDB::insertPowerData(unsigned numVectors, int powerfd, double *powerdata) {
160 if (usingPower) { 160 if(usingPower){
161 if (!(dbH->flags & O2_FLAG_POWER)) { 161 if (!(dbH->flags & O2_FLAG_POWER)) {
162 error("Cannot insert power data on non-power DB", dbName); 162 error("Cannot insert power data on non-power DB", dbName);
163 } 163 }
164 164
165 int one; 165 int one;
166 unsigned int count; 166 unsigned int count;
167 167
168 count = read(powerfd, &one, sizeof(unsigned int)); 168 count = read(powerfd, &one, sizeof(unsigned int));
169 if (count != sizeof(unsigned int)) { 169 if (count != sizeof(unsigned int)) {
170 error("powerfd read failed", "int", "read"); 170 error("powerfd read failed", "int", "read");
171 } 171 }
172 if (one != 1) { 172 if (one != 1) {
173 error("dimensionality of power file not 1", powerFileName); 173 error("dimensionality of power file not 1", powerFileName);
174 } 174 }
175 175
176 // FIXME: should check that the powerfile is the right size for 176 // FIXME: should check that the powerfile is the right size for
177 // this. -- CSR, 2007-10-30 177 // this. -- CSR, 2007-10-30
178 count = read(powerfd, powerdata, numVectors * sizeof(double)); 178 count = read(powerfd, powerdata, numVectors * sizeof(double));
179 if (count != numVectors * sizeof(double)) { 179 if (count != numVectors * sizeof(double)) {
180 error("powerfd read failed", "double", "read"); 180 error("powerfd read failed", "double", "read");