The SwappyItems Key-Values Store
Classes | Macros | Typedefs | Functions | Variables
such.cpp File Reference
#include <cstdio>
#include <utility>
#include <inttypes.h>
#include <vector>
#include "SwappyItems.hpp"
#include "osmpbfreader.hpp"

Classes

struct  NodeData
 
struct  Routing
 

Macros

#define __STDC_FORMAT_MACROS
 
#define FILE_ITEMS   ( 64*1024)
 
#define FILE_MULTI   16
 
#define RAM_MULTI   8
 
#define BBITS   5
 
#define BMASK   ((BBITS+4)* FILE_ITEMS)
 

Typedefs

typedef uint64_t Key
 
typedef SwappyItems< Key, NodeData, FILE_ITEMS, FILE_MULTI, RAM_MULTI, BBITS, BMASKSwappyItemsNODES
 

Functions

void logEntry ()
 
int main (int argc, char **argv)
 

Variables

SwappyItemsNODESnodes
 

Macro Definition Documentation

◆ __STDC_FORMAT_MACROS

#define __STDC_FORMAT_MACROS

◆ BBITS

#define BBITS   5

◆ BMASK

#define BMASK   ((BBITS+4)* FILE_ITEMS)

◆ FILE_ITEMS

#define FILE_ITEMS   ( 64*1024)

◆ FILE_MULTI

#define FILE_MULTI   16

◆ RAM_MULTI

#define RAM_MULTI   8

Typedef Documentation

◆ Key

typedef uint64_t Key

◆ SwappyItemsNODES

Function Documentation

◆ logEntry()

void logEntry ( )
35  {
36  auto stat = nodes->getStatistic();
37  printf(
38  "%10ld i "
39  "%10ld q "
40 
41  "%10" PRId64 " u "
42  "%10" PRId64 " d "
43 
44  "%10" PRId64 " r "
45  "%10" PRId64 " b "
46  "%10" PRId64 " e "
47 
48  "%10" PRId64 " s "
49  "%10" PRId64 " l "
50  "%10ld filekB "
51 
52  "%10" PRId64 " "
53  "%10" PRId64 "\n",
54 
55  stat.size,
56  stat.queue,
57 
58  stat.updates,
59  stat.deletes,
60 
61  stat.rangeSaysNo,
62  stat.bloomSaysNotIn,
63  stat.rangeFails,
64 
65  stat.swaps,
66  stat.fileLoads,
67  stat.fileKB,
68 
69  stat.minKey,
70  stat.maxKey
71  );
72 }
struct statistic_s getStatistic(void)
Definition: SwappyItems.hpp:288
SwappyItemsNODES * nodes
Definition: such.cpp:33

◆ main()

int main ( int  argc,
char **  argv 
)
102  {
103  if(argc != 2) {
104  printf("Usage: %s file_to_read.osm.pbf\n", argv[0]);
105  return 1;
106  }
107 
108  nodes = new SwappyItemsNODES(42);
109  Routing routing;
110 
111  read_osm_pbf(argv[1], routing, false); // read nodes and relations
112 
113  delete nodes;
114  return 0;
115 }
void read_osm_pbf(const std::string &filename, Visitor &visitor, bool wayOnly)
Definition: osmpbfreader.hpp:359
Definition: osm2graph.cpp:120
SwappyItems< Key, NodeData, FILE_ITEMS, FILE_MULTI, RAM_MULTI, BBITS, BMASK > SwappyItemsNODES
Definition: such.cpp:32

Variable Documentation

◆ nodes