xamplr 1.9.3 → 1.9.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/VERSION.yml +1 -1
- data/lib/xamplr/persisters/tokyo-cabinet.rb +24 -15
- data/xamplr.gemspec +1 -1
- metadata +1 -1
data/VERSION.yml
CHANGED
@@ -251,6 +251,7 @@ module Xampl
|
|
251
251
|
class_cache[class_name] = result_class
|
252
252
|
end
|
253
253
|
|
254
|
+
|
254
255
|
self.lookup(result_class, result['pid'])
|
255
256
|
end
|
256
257
|
|
@@ -490,6 +491,10 @@ module Xampl
|
|
490
491
|
place_dir = File.join( @files_dir, place_dir )
|
491
492
|
mentions = Set.new
|
492
493
|
xampl_in_xml = represent(xampl, mentions)
|
494
|
+
unless xampl_in_xml && 0 < xampl_in_xml.size then
|
495
|
+
puts "Cannot persist #{ xampl } because representation is unobtainable"
|
496
|
+
return
|
497
|
+
end
|
493
498
|
|
494
499
|
#get rid of any supplimentary indexes associated with this xampl object
|
495
500
|
# TODO -- This can be slow
|
@@ -581,26 +586,30 @@ module Xampl
|
|
581
586
|
end
|
582
587
|
|
583
588
|
note_errors("TC[[#{ @filename }]]:: write error: %s\n") do
|
584
|
-
|
585
|
-
|
586
|
-
|
587
|
-
|
588
|
-
|
589
|
-
|
590
|
-
|
591
|
-
|
592
|
-
|
589
|
+
begin
|
590
|
+
if Xampl.raw_persister_options[:write_through] then
|
591
|
+
FileUtils.mkdir_p(place_dir) unless File.exist?(place_dir)
|
592
|
+
file_place = "#{ @files_dir }/#{ place }"
|
593
|
+
File.open(file_place, "w") do |out|
|
594
|
+
out.write xampl_hash['xampl']
|
595
|
+
if :sync == Xampl.raw_persister_options[:write_through] then
|
596
|
+
out.fsync
|
597
|
+
if $is_darwin then
|
598
|
+
out.fcntl(51, 0) # Attempt an F_FULLFSYNC fcntl to commit data to disk (darwin *ONLY*)
|
599
|
+
end
|
593
600
|
end
|
594
601
|
end
|
595
|
-
|
596
|
-
|
597
|
-
|
598
|
-
|
599
|
-
|
602
|
+
if index_info[:primary] && 0 < index_info[:secondary].size then
|
603
|
+
file_place += ".idx"
|
604
|
+
File.open(file_place, "w") do |out|
|
605
|
+
out.write index_info.to_yaml
|
606
|
+
end
|
600
607
|
end
|
601
608
|
end
|
609
|
+
rescue => e
|
610
|
+
puts "#{ File.basename __FILE__ }:#{ __LINE__ } [#{__method__}] write through failed #{ xampl }"
|
602
611
|
end
|
603
|
-
|
612
|
+
|
604
613
|
@tc_db.put(place, xampl_hash)
|
605
614
|
end
|
606
615
|
|
data/xamplr.gemspec
CHANGED