Project

General

Profile

Feature #7200

Updated by Tom Clegg over 8 years ago

The response should follow the same API as keepstore's own index handler. In keepproxy terms this means: 
 * Unless a complete index is retrieved for _every_ service (i.e., http 200 and terminated by a single blank line), the index is incomplete, and keepproxy's response must not end with a blank line. 
 * If a block appears 2x in each of N keepstore "index" responses, it appears 2N times in keepproxy's response, too. 
 * If the index is complete, it must end with a single blank line. 
 * The index is given in whatever order is convenient for keepproxy (the caller does not expect it to be sorted). 

 h3. Implementation 

 New public function in sdk/go/keepclient: 

 <pre> 
 // GetIndex retrieves a list of blocks stored on the given server whose hashes 
 // begin with the given prefix. The returned reader will return an error (other 
 // than EOF) if the complete index cannot be retrieved. This should only be 
 // expected to return useful results if the client is using a "data manager token" 
 // recognized by the Keep services. 
 func (kc *KeepClient) GetIndex(keepServiceUUID, prefix string) (io.Reader, error) { 
 ... 
 } 
 </pre> 

 Tests for this function must include "caller sees error if partial index is retrieved from keepstore" (i.e., no blank line before EOF). 

 Some of the existing code in Data Manager may be useful here. (Data Manager might also deserve to be updated to use this new SDK feature instead of having duplicate code, but this might wait for a separate branch/story.) 

Back